lol, my whole DB is meaningful primary keys...yay us! So far, Cayenne's default logic has handled it without exception, but I've got all of the relationships mapped out. I'm assuming your situation is different, but I had to jump in and give a hooray for meaningful PKs. :P
On Thu, Nov 1, 2018 at 7:58 AM John Huss <johnth...@gmail.com> wrote: > Without having more details my general recommendation would be to handle > the details up front before you get to the Cayenne level. Put things in > order in memory and then create your Cayenne Objects and commit them one at > a time. > > On Thu, Nov 1, 2018 at 9:35 AM Hugi Thordarson <h...@karlmenn.is> wrote: > > > Hi all. > > I have a set of new (uncommitted) objects that I need to insert into the > > DB in a certain order. For… Reasons. (let's hear it for legacy DBs with > > meaningful PKs, yay!) > > > > The action is not performance sensitive and the whole thing occurs within > > a transaction, so performing multiple commits is OK. My initial though > was > > that when saving, I could just iterate through the new objects, > localizing > > each one in a new ObjectContext and committing that on each > iteration—but I > > haven't found a way to get that to work. > > > > Any ideas? > > > > Cheers, > > - hugi >