File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate Generator for Oracle 11g Sequence. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Generator for Oracle 11g Sequence." Watch "Hibernate Generator for Oracle 11g Sequence." New topic
Author

Hibernate Generator for Oracle 11g Sequence.

Gaurav Pravin Dighe
Greenhorn

Joined: Jun 12, 2011
Posts: 23

Hello All,

I am using Oracle 11g and Hibernate 3.6.10 in Java Application. I am at starting level of Hibernate.
I have a table name USERDETAILS

UserDetails
---------------------
userID-----------PK---Oracle 11g Sequence created
userName

Could you please uide me which generatot to be used

Below is the hibernate.cfg.xml



Could anyone let me know which generator class to be used?


Regards,
Gaurav Dighe
Pr Gupta
Greenhorn

Joined: Oct 15, 2012
Posts: 1
You can use sequence generator class.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1666
    
    7

You could also look at a table generator. It is a little more portable.

See this blog
http://blog.eyallupu.com/2011/01/hibernatejpa-identity-generators.html

have a look here
http://docs.jboss.org/hibernate/orm/3.5/api/org/hibernate/id/enhanced/TableGenerator.html
and
http://docs.jboss.org/hibernate/orm/3.5/api/org/hibernate/id/MultipleHiLoPerTableGenerator.html


[How To Ask Questions][Read before you PM me]
tester anders
Greenhorn

Joined: Nov 21, 2012
Posts: 1
http://codermanual.blogspot.com/2012/11/hibernate-custom-sequence-for-oracle.html
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1666
    
    7

Manikandan Govindaraj,
Your post was moved to a new topic.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate Generator for Oracle 11g Sequence.