Re: retrieving PK immediately after saveChanges() ...

2008-06-11 Thread Mike Schrag
As an aside "primaryKeyInTransaction" was unresolved till I noticed that _Entity.java inherits from EOGenericRecord and not ERXGenericRecord. Is that intentional Mike? Well, you tell me, since that's up to your config :) You need to set the EOGenericRecord definition in your eogen file to b

Re: retrieving PK immediately after saveChanges() ...

2008-06-10 Thread Gavin Eadie
... newRecord.primaryKey() ? ... newRecord.primaryKeyInTransaction() Calling this method will return the primary key of the given enterprise object or if one has not been assigned to it yet, then it will have the adaptor channel generate one for it, cache it and then use that primary key

Re: retrieving PK immediately after saveChanges() ...

2008-06-10 Thread Gavin Eadie
On 10 Jun 2008, at 23:36, Gavin Eadie wrote: I need to provide a unique user-facing serial number on records, and it would be fine if it was the same as the primary key integer. What I've been trying to do is to save the record once so the pkey is assigned, then use it to set the serial.

Re: retrieving PK immediately after saveChanges() ...

2008-06-10 Thread Thomas
No need to save the entity: ERXGenericRecord primaryKeyInTransaction() Calling this method will return the primary key of the given enterprise object or if one has not been assigned to it yet, then it will have the adaptor channel generate one for it, cache it and then use that pr

retrieving PK immediately after saveChanges() ...

2008-06-10 Thread Gavin Eadie
I need to provide a unique user-facing serial number on records, and it would be fine if it was the same as the primary key integer. What I've been trying to do is to save the record once so the pkey is assigned, then use it to set the serial. Essentially, as follows: public void addPer