Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Multiple generated values in one Entity

This is not directly supported.  You could use an event, such as preInsert to
assign the generated value using the Session getNextSequenceNumberValue()
API.  This takes the class however, there does not seem to be an API to get
the next sequence number by name (please log a bug for this).

You may also be able to assign the values on the database, and use
EclipseLink returning support to return the assigned values.

Please log an enhancement request for having support for multiple generated
values in a class.

_es wrote:
> Hi, Is there any way to define more than one field in one Entity to be
> generated with sequence generator that uses Oracle db sequences? If I try
> to define GeneratedValue + SequenceGenerator annotations for more than one
> field in entity EcliseLink throws an exception that states that it is not
> allowed to have two GeneratedValues in one Entity.
> Is there any way to go round that or does anyone have any other idea how I
> could use DB sequences to generate values to columns when Entity is
> inserted?

----- James Sutherland
 EclipseLink ,
Wiki: EclipseLink , TopLink 
Forums: TopLink , EclipseLink 
Book: Java Persistence 
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top