Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] DB-generated values as properties on JPA-entity

På søndag 18. august 2013 kl. 00:39:41, skrev Andrei Ilitchev <andrei.ilitchev@xxxxxxxxxx>:
Seems pretty natural to me: the value is generated by INSERT statement,
so until INSERT statement is executed there is no value.
Identity (in SyBase, MS SQLServer etc) works exactly the same way.
 
This is an implementation-detail, and should be hidden from the programmer.
IMO EL should detect this situation and execute the INSERT immediately and not wait for commit() or flush(). Else the entity (object) is not consistent. This does not follow the principal of least surprise; The programmer shouldn't be concerned with having to flush() or commit the session in order to get the field populated.
 
That said, I'm glad it works and appreciate your help, thanks.
 
--
Andreas Joseph Krogh <andreak@xxxxxxxxxxxx>      mob: +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc
 

Back to the top