[jboss-dev-forums] [EJB3 Development] - Re: Oracle custom sequence instead of select hibernate_seque

Uwe Risse do-not-reply at jboss.com
Tue May 28 08:54:34 EDT 2013


Uwe Risse [https://community.jboss.org/people/uwe.risse] created the discussion

"Re: Oracle custom sequence instead of select hibernate_seque"

To view the discussion, visit: https://community.jboss.org/message/819864#819864

--------------------------------------------------------------
The thread is rather old but I have the same problem with hibernate 3.6.4. 
I could solve this by adding the attribute allocationSize=1 to the annotation

In your case:

 @Id(generate = GeneratorType.SEQUENCE, generator = "mysequence")
 @SequenceGenerator(name = "mysequence", sequenceName = "MY_SEQ",*allocationSize=1*)
 //@SequenceGenerator(name = "mysequence", sequenceName = "hibernate_sequence")
 @Column(name = "COVT_ID", primaryKey=*true*)
 *public* *long* getId() {
 *return* m_id;
 }

should work.

|   |
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/819864#819864]

Start a new discussion in EJB3 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2030]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20130528/c819ca0e/attachment-0001.html 


More information about the jboss-dev-forums mailing list