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: 72
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
 
jQuery in Action, 2nd edition
 
subject: Hibernate create tables,column order and indexes
 
Similar Threads
Hibernate and PostgreSQL
Cannot update object - Hibernate
Using Hibernate: getting same value 3 times
Please explain me the hibernate generated sql queries in console
can you help me about EL please