public void addPerson () {
SampleDB newRecord = SampleDB.createSampleDB(myEditingContext, firstName, lastName);
myEditingContext.saveChanges();
newRecord.setSerial(newRecord.id());
myEditingContext.saveChanges();
}
I've some old code that does this 'by force', but in converting to Wonder, I don't seem to be able to get there.
If I tell Entity Modeler/EOgen to provide accessors on id then the SampleDB.createSampleDB method has id as a parameter, and I shouldn't be specifying the primary key in my code. If I don't provide accessors then I can't access the pkey. I tried specifying id as read-only, thinking that EOgen would then provide a getID, but no setID (or a need to specify it in SampleDB.createSampleDB), and that would work for me but no.
I suspect there is a really simple solution but it eludes me. As I noted, I've got Wonder-less code that works, so I'm looking for the best way to do it with Wonder ... so much of the WOLips/Wonder stuff seems to just work; I'm a tad perturbed that this one has me stumped.