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

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -