Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » One entity with two sequences
One entity with two sequences [message #546719] Tue, 13 July 2010 18:33 Go to next message
Eclipse UserFriend
Another issue about migrating a system from openjpa to eclipselink:

For some reason one entity of this system has two columns with values attributed from a sequence:


@Entity
@Table(name = "VGS_SERV_HEMOT")
 class ServHemotED implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ServHemotED_SEQ")
	@SequenceGenerator(name = "ServHemotED_SEQ", sequenceName = "ID_SERV_HEMOT_SEQ", allocationSize = 1)
	@Column(name = "NRO_INT_SERV_HEMOT")
	private Long nroIntServHemot;

	@SequenceGenerator(name="CodVisa_SEQ", sequenceName="ID_COD_VISA_SEQ", allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CodVisa_SEQ")
	@Column(name = "COD_VISA")
	private Long codVisa;


The following exception occurs:
Exception [EclipseLink-7169] (Eclipse Persistence Services - 1.2.0.v20091016-r5565): org.eclipse.persistence.exceptions.ValidationExcept
ion
Exception Description: Class [class com.procergs.vgs.ed.ServHemotED] has two @GeneratedValues: for fields [VGS_SERV_HEMOT.COD_VISA] and
[VGS_SERV_HEMOT.NRO_INT_SERV_HEMOT]. Only one is allowed.


Correctly or not, openjpa supports this feature. Unfortunately eclipselink doesn't seam to support.

Besides changing the code to set the value of one of the column programmatically, is there another approach?

Thanks, again. Mauro.
Re: One entity with two sequences [message #547147 is a reply to message #546719] Thu, 15 July 2010 12:59 Go to previous messageGo to next message
Eclipse UserFriend
Please log a bug/enhancement request.

Setting the value yourself is the only solution I can think of.
Re: One entity with two sequences [message #548190 is a reply to message #547147] Tue, 20 July 2010 22:38 Go to previous message
Eclipse UserFriend
An enhancement was requested:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=320456
Previous Topic:help with moving to JPA
Next Topic:Obtaining EM properties outside a transaction
Goto Forum:
  


Current Time: Wed Jul 23 19:26:52 EDT 2025

Powered by FUDForum. Page generated in 0.03531 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top