wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Hibernate create tables,column order and indexes 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 create tables,column order and indexes" Watch "Hibernate create tables,column order and indexes" New topic
Author

Hibernate create tables,column order and indexes

Alex Armenteros
Ranch Hand

Joined: May 05, 2010
Posts: 73
I have this setting in the hibernate.cfg.xml


<property name="hibernate.hbm2ddl.auto">update</property>

and defined a class like this



I want to create the table at the start of the process.

But If I don't put the javax.persistence annotation, I get an exception telling me that table points to an unknown table.

Also I'd like to create the table with the columns in that order. but the table is generated with its columns in alphabetical order. (If it's pre-generated the order is respected,but I don't have that posibility)

Also Indexes are not being created.

What could be happening here?

I use Hibernate annotations 3.4.0.GA and Mysql 5.1.46
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate create tables,column order and indexes