Lici
Lici

Reputation: 998

Hibernate Specific DDL Generation

i'm using hibernate schema export tool. As I'm using MySql as RDBMS provider, i wonder if i can place specific mysql parameters somewhere ,like using collation utf8_bin ...

Thanks

Upvotes: 1

Views: 1020

Answers (2)

Gareth Davis
Gareth Davis

Reputation: 28059

The short answer is no, there isn't a way to do this. Hibernate only reconmends that you use the schema export tool as a starting point thus there isn't any obvious hook points where you can add db specific stuff to the create statements.

Possible work arounds:

  1. create an import.sql on the classpath, the export will run this after all of the generated statements, you might be able to run some alter table style stuff to make the changes you need
  2. there might some milage in extending the mysql dialect to add the options that you need. I've not looked in to it to see if there are enough hook points to change things like the collation sequence, but it's about as good as your going to get I'm afraid.

Upvotes: 2

FoxyBOA
FoxyBOA

Reputation: 5846

I disagree with gid. Hibernate allows you to define own or change standard dialect that will have an impact for resulting DMS. Some details can be found in the article. We are using the approach for generating specific parameters for Microsoft SQL Server, Oracle and other supported databases.

Upvotes: 3

Related Questions