Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » zero as a primary key
zero as a primary key [message #1177116] Fri, 08 November 2013 19:45 Go to next message
Amita Mehta is currently offline Amita MehtaFriend
Messages: 9
Registered: May 2013
Junior Member
Is there a way to set eclipselink.allow-zero-id using the "TopLink legacy" eclipseLink configuration and API?
We're migrating from TopLink to EclipseLink for many of our legacy applications.
We do NOT intend to switch them to JPA.
TopLink allowed zero for a primary key and EclipseLink is throwing an exception.
We've found solutions for JPA, but would like to apply this property in a non-JPA context.

Thanks

[Updated on: Fri, 08 November 2013 21:17]

Report message to a moderator

Re: zero as a primary key [message #1181290 is a reply to message #1177116] Mon, 11 November 2013 14:02 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1039
Registered: July 2009
Senior Member
The eclipselink.allow-zero-id property is equivalent to the static org.eclipse.persistence.internal.helper.Helper.isZeroValidPrimaryKey boolean, which you could set in a session event method or customizer. This property was deprecated though in favor of using "eclipselink.id-validation" which you would call session.getProject().setDefaultIdValidation(IdValidation.NULL) in a customizer/event to use.

Best Regards,
Chris
Previous Topic:Customize JPA field name mapping using EclipseLink
Next Topic:JavaDbGenerator error on Luna Release
Goto Forum:
  


Current Time: Thu Nov 27 22:16:36 GMT 2014

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

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