Hibernate version:
3.2.5GA
Mapping documents:
not relevant
Code between sessionFactory.openSession() and session.close():
not relevant
Full stack trace of any exception that occurs:
not relevant
Name and version of the database you are using:
DB2 8.3.2
The generated SQL (show_sql=true):
not relevant
Debug level Hibernate log excerpt:
not relevant
Hello there!
I want to customize the table creation script which is generated by the hibernate tool, namely:
instead of
Code:
create table customer (id bigint generated by default as identity, name varchar(255), primary key (id));
I would love to get this splitted to the two expressions:
Code:
create table customer (id bigint generated by default as identity, name varchar(255));
alter table customer add constraint pcustomer primary key (id);
The reason for that is that in the latter case I can specify the soundable name of the PK-constraint.
After a short investigation I have found that currently it is not possible to do it this way because it is not enough just to write a custom implementation of the
Dialect, but it is also necessary to subclass a
Table due to the fact that the generation of a primary key is happened directly in the
Table class. Or maybe I have to subclass
Configuration? But how coud I use subclassed
Configuration in hibernate?
The second problem is that currenty there is no way to define a name for a primary key constrain at all (but using a reasonable naming convention I still could generate a suitable PK name automatically).
Is my understanding of that problem correct?
Is there any other solution to this task?
Regards,
TCh