hibernate - Is the ForeignKey annotation only used by HBM2DDL to generate the schema? -
hibernate - Is the ForeignKey annotation only used by HBM2DDL to generate the schema? -
i'm having issue how hibernate generates foreign key names when using table_per_class inheritance strategy: foreign keys have random number appended when using hibernate's table_per_class inheritance
so i'm wondering if can replace annotation following:
@inheritance(strategy = inheritancetype.table_per_class) @entity abstract class item { @manytoone @foreignkey(name="fk_item_org_changeme") @joincolumn(name="org_id") private organization org } that way know go generated ddl , replace occurrences of changeme. hibernate else @foreignkey attribute i'm not aware of or workaround?
possible, redefine such behavior via own naming staretgy - http://docs.jboss.org/hibernate/core/3.2/api/org/hibernate/cfg/namingstrategy.html#foreignkeycolumnname(java.lang.string, java.lang.string, java.lang.string, java.lang.string) ?
hibernate foreign-keys hbm2ddl
Comments
Post a Comment