Skip to main content

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

Hi all.
 
I'm having the same issue as this guy: http://www.eclipse.org/forums/index.php/t/368890/
 
I'm having fields in my @Entity which are generated by the DB as insert-time and I need to map them.
 
In Hibernate it's possible using it's @Generated annotation:
@Column(name = "id", nullable = false, unique = true, updatable = false, insertable = false)
@org.hibernate.annotations.Generated(org.hibernate.annotations.GenerationTime.INSERT)
var activityId: java.lang.Long = null
Does EL has something similar?
 
BTW: The blog-post mentions Oracle is the only supported platform supporting the "returning ..." syntax in SQL INSERT/UPDATE. PostgreSQL supports this too.
 
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