Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Use of sequences with EclipseLink (native) and Postgres(customized sequence under postgres and eclipseLink native)
Use of sequences with EclipseLink (native) and Postgres [message #868585] Wed, 02 May 2012 05:03 Go to next message
Eclipse UserFriend
hi,
i have some troubles on use of eclipseLink native (without JPA) on a postgre DB.

EclipseLink use by default a sequence name SEQUENCE. But with postgres, eclipseLink failed tu used it because this term is reserved and must be between quotes to be used correctly.

I try to specify in persistance.xml an another name :

<class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
			<class>fr.astek.persistance.eclipselink.model.Category</class>
			<alias>Category</alias>
			<primary-key>
				<field table="category" name="categoryid" xsi:type="column" />
			</primary-key>
			<events />
			<querying />
			<attribute-mappings>
				...
			</attribute-mappings>
			<descriptor-type>independent</descriptor-type>
			<sequencing>
				<sequence-name>table_sequence</sequence-name>
				<sequence-field table="category" name="categoryid" />
			</sequencing>
			...
		</class-mapping-descriptor>

But eclipseLink continue to call the first!
I try to specify my sequence in serverSession or unitOfWork programatically. Without any success.

I would like to use my own sequence, how i could do that?

Regards,
Olivier
Re: Use of sequences with EclipseLink (native) and Postgres [message #868795 is a reply to message #868585] Wed, 02 May 2012 10:52 Go to previous message
Eclipse UserFriend
Sequencing is documented here: http://wiki.eclipse.org/Introduction_to_Projects_(ELUG)#Configuring_How_to_Obtain_Sequence_Values
Sequencing defined in the session.xml will override the settings in individual descriptors, so check you do not have it define there or manually in the session (such as in a prelogin event).

The Eclipselink docs mostly show how to set it up with the workbench or java, but you can look at the documentation for TopLink if you are setting up the xml files by hand.

Best Regards,
Chris

Previous Topic:quoted name and constraint
Next Topic:Where Is The Documentation and Examples For Eclipselink Exceptions especially Persistence Exception
Goto Forum:
  


Current Time: Tue Jul 22 20:52:54 EDT 2025

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

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

Back to the top