• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate create tables,column order and indexes

Alex Armenteros
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Beware the other head of science - it bites! Nibble on this message:
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!