Hello,
hbm2ddl generates a create table statement where the column names contain the dot character - while the used database Derby won't accept such a statement.
I'm using the org.hibernate.dialect.DerbyDialect and the org.hibernate.cfg.DefaultComponentSafeNamingStrategy for column names, which works fine for most of the mappings.
The problem occurs where the mapped domain model object has a primary key consisting of multiple columns and contains a persistent array of objects. hbm2ddl generates a new table for the array of objects contained in the domain object model. This new array table's columns referencing the primary key columns of the domain model object have names containing dot characters.
Simplified code example:
Code:
@Entity class X {
@Id ID id;
@org.hibernate.annotations.CollectionOfElements
@org.hibernate.annotations.IndexColumn(name="arrayIndex") Y[] y;
...
}
@Embeddable class ID {
String id1;
String id2;
}
tries to generate a new table for the Y[] member:
Code:
create table X_y (
X_id.id1 varchar(255) not null,
X_id.id2 varchar(255) not null,
...
Can I forbid the dot character for column names generated by hbm2ddl? Is the DefaultComponentSafeNamingStrategy configurable?
Thank you,
best regards,
Robert