Hallo,
I get the following Exception: foreign key (enumliteral [enumname])) must have same number of columns as the referenced primary key (enum [name,packageid])
The mapping for enum loosk like that:
Code:
<hibernate-mapping package="model.persistence">
<class
name="enum"
table="enum"
>
<composite-id name="PK" class="ClassifierPK">
<key-property
name="name"
column="name"
type="java.lang.String"
/>
<key-many-to-one
name="packageid"
class="Xpackage"
column="packageid"
/>
</composite-id>
<property ...
...and enumliteral mapping looks like that:
Code:
<hibernate-mapping package="model.persistence">
<class
name="enumliteral"
table="enumliteral"
>
<composite-id name="compositeID" class="EnumliteralPK">
<key-many-to-one
name="enumpackageid"
class="Enum"
column="enumpackageid"
/>
<key-many-to-one
name="enumname"
class="Enum"
column="enumname"
/>
<key-property
name="name"
type="java.lang.String"
column="name"
/>
</composite-id>
<property...
The enumliteral-mapping-file is wrong. I don't know how to make sure that
enumpackageid(references an id) and
enumname both references to the
primary key of enum(which is in class ClassifierPK).
Could You give me a pointer please? Thanks in advance,
Kurt