Joined: Thu Feb 01, 2007 7:29 pm Posts: 5
|
I have an abstract class mapping that defines a composite-id. The composite-id has 2 <key-many-to-one> properties that each define a foreign key. There are many concrete subclasses whose mappings create tables that have the foreign key constraints. The name of the foreign key is a generated name like this: FKB948BFAD9734296A. If I name the foreign key in the abstract class it only provides a prefix to the name like this: PARENT_ID_FK3b6e8e80.
Is there anyway I can name these foreign keys specifically for each subclass?
Here's the abstract class mapping:
<class
name="AbstractContent" abstract="true">
<composite-id
name="CONTENT_PK"
class="ContentKey">
<key-property
name="index"
column="NDX"
type="integer" />
<key-many-to-one
name="parent"
column="PARENT_ID"
foreign-key="PARENT_ID_FK"
class="ContentObject">
</key-many-to-one>
<key-many-to-one
name="feature"
column="FEATURE_ID"
foreign-key="FEATURE_ID_FK"
class="AbstractFeature">
</key-many-to-one>
</composite-id>
</class>
Here's one of the concrete subclass mappings:
<union-subclass
table="BOOLEAN_CONTENT"
name="BooleanContent"
extends="AbstractContent">
<property
name="value"
column="VALUE"
type="boolean"
not-null="true">
</property>
</union-subclass>
Thx,
Dan
|
|