Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to implement an unowned one-to-many relationship in Siena/GAE
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Willem Salembier  
View profile  
 More options Feb 16 2012, 7:08 am
From: Willem Salembier <willem.salemb...@gmail.com>
Date: Thu, 16 Feb 2012 04:08:18 -0800 (PST)
Local: Thurs, Feb 16 2012 7:08 am
Subject: How to implement an unowned one-to-many relationship in Siena/GAE

The documentation explains Many<T> relations implemented as owned,
aggregated or embedded relationships.
But how do I implement an unowned one-to-many relation?

In GAE, this implemented by storing a List<Key> objects in the parent
object. The child object represented by a Key has its own lifecycle.

In Siena I can't use
- owned -> because it requires a link from the child to the parent back
- aggregated -> because child and parent are one entity group and the child
gets duplicated
- embedded -> because i can't query this structure natively in GAE because
it is represented as a YAML string.

Any suggestions?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal Voitot Dev  
View profile  
 More options Feb 16 2012, 7:59 am
From: Pascal Voitot Dev <pascal.voitot....@gmail.com>
Date: Thu, 16 Feb 2012 13:59:07 +0100
Local: Thurs, Feb 16 2012 7:59 am
Subject: Re: How to implement an unowned one-to-many relationship in Siena/GAE

Hi,

You can't use List<Key> in Siena because Siena abstracts the GAE Key type.
But you can store directly a List<Long> where the long is the ID of the
linked entity.

It should be work without any pb!

Pascal

On Thu, Feb 16, 2012 at 1:08 PM, Willem Salembier <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Willem Salembier  
View profile  
 More options Feb 16 2012, 8:07 am
From: Willem Salembier <willem.salemb...@gmail.com>
Date: Thu, 16 Feb 2012 05:07:41 -0800 (PST)
Local: Thurs, Feb 16 2012 8:07 am
Subject: Re: How to implement an unowned one-to-many relationship in Siena/GAE

This is an option, but not a pretty one because I loose the retrieval of
the linked entities using Many.asList() or asQuery().

I was hoping I could define something like this:

@Referenced
Many<T> relations;

so SIENA on GAE whould persist this relation as a List<Long> or List<Key>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal Voitot Dev  
View profile  
 More options Feb 16 2012, 8:40 am
From: Pascal Voitot Dev <pascal.voitot....@gmail.com>
Date: Thu, 16 Feb 2012 14:40:11 +0100
Local: Thurs, Feb 16 2012 8:40 am
Subject: Re: How to implement an unowned one-to-many relationship in Siena/GAE

yes it would be great but it's not implemented like that, yet :)
Sorry...
If you feel like doing this work, don't hesitate to contribute (as I said
several times, I don't have time to support Siena anymore as I work a lot
on other stuff :( )

Pascal

On Thu, Feb 16, 2012 at 2:07 PM, Willem Salembier <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »