Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] find after persist is not finding persisted value

Ids are being assigned using @PrePersist methods. We are using UUIDs and
cannot rely on database sequences or jpa generated values.



How is your Id assigned?  Is it using an IDENTITY GeneratedValue?  If so
then it cannot be assigned an Id on persist(), only on flush, so doing a
find() using its null Id will not find the object.

Either call flush(), or switch to using a TABLE or SEQUENCE GeneratedValue,
it is much more efficient anyway.

-- 
View this message in context: http://www.nabble.com/find-after-persist-is-not-finding-persisted-value-tp23041581p23059365.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top