aspose file tools*
The moose likes Object Relational Mapping and the fly likes Middlegen -Hibernate - use sequences for primary key Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Middlegen -Hibernate - use sequences for primary key " Watch "Middlegen -Hibernate - use sequences for primary key " New topic
Author

Middlegen -Hibernate - use sequences for primary key

Sagar Bilgi
Ranch Hand

Joined: Apr 26, 2001
Posts: 37
Hi All,
Should be a simple question for all you middlegen-hibernate veterans out there..

I am using the middlegen-hibernate plug in to read an existing schema
and generate the appropriate hbm.xml files. I can specifiy which tables I
want the mapping files for ( by using the <table> element) but in cases where I want the primary key of the table to be generated using a sequence, I cant seem to find the syntax or the construct to specify that in the middlegen ant task.

Any pointers on this?

Thanks in advance
Sagar Bilgi
Ranch Hand

Joined: Apr 26, 2001
Posts: 37
Was browsing through this forum and saw my unanswered question and figured I'd post what I did if it might help anyone else.

Since no one replied I figured the easiest way would be to use the middlegen UI and enter the sequence names for the tables I wanted.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Middlegen -Hibernate - use sequences for primary key