Re: The right way to populate meaningful keys

2009-07-30 Thread Michael Gentry
Eric > +1 (917) 589-6579 > > > --- On Thu, 7/30/09, Michael Gentry wrote: > >> From: Michael Gentry >> Subject: Re: The right way to populate meaningful keys >> To: user@cayenne.apache.org >> Date: Thursday, July 30, 2009, 11:01 AM >> Hi Juergen, >>

Re: The right way to populate meaningful keys

2009-07-30 Thread Juergen Saar
9, Michael Gentry wrote: > > > From: Michael Gentry > > Subject: Re: The right way to populate meaningful keys > > To: user@cayenne.apache.org > > Date: Thursday, July 30, 2009, 11:01 AM > > Hi Juergen, > > > > I suspect that you need to assign the key on t

Re: The right way to populate meaningful keys

2009-07-30 Thread Eric Lazarus
try > Subject: Re: The right way to populate meaningful keys > To: user@cayenne.apache.org > Date: Thursday, July 30, 2009, 11:01 AM > Hi Juergen, > > I suspect that you need to assign the key on the other side > of your > 1:1 relationship, too.  Another thing you could try &g

Re: The right way to populate meaningful keys

2009-07-30 Thread Juergen Saar
Pretty hint ... I moved to-dep-pk from 'source' to 'target' of the relation ... it worked A little strage because the join-fields were filled in on both sides It is a typical optional Information that ist attached by the 1:1 relation so to-dep-pk would be right on both sides of the relation. Th

Re: The right way to populate meaningful keys

2009-07-30 Thread Michael Gentry
Hi Juergen, I suspect that you need to assign the key on the other side of your 1:1 relationship, too. Another thing you could try doing is using the To Dep PK checkbox in the DbEntity Relationship panel to see if Cayenne will auto-copy your meaningful PK for you. http://cayenne.apache.org/doc/t

Re: The right way to populate meaningful keys

2009-07-30 Thread Juergen Saar
This was my way ... But I ran in deep trouble with the ObjectId ... this seems not to be sycronized My actual CayenneRuntimeException: Can't extract a master key. Missing key (esd_abteil), master ID () It belongs to a 1:1 Relation and the PK-Values in source and target are correctly set. The Com

Re: The right way to populate meaningful keys

2009-07-30 Thread Michael Gentry
Cayenne, by default, doesn't map keys from the DbEntity (database definition) to the ObjEntity (Java definition), but you can go into the ObjEntity and add them and it should be fine. After you do that, just call the set/get methods for the keys to set/get them. If you set a key on a new object b

The right way to populate meaningful keys

2009-07-29 Thread Juergen Saar
Hi all, I'm using cayenne within an old 4GL-Project with meaningful Primary Keys. Is there a 'best practice' to get this keys into the DataObject-Instance? Actually I've various trouble with this ... Any hint or code-sniplet would be helpful ... -Juergen-