Hi all,
Following the example from section 18.3 of the Hibernate's reference manual, I was trying to model a many-to-many relationship between a Dictionary/DictionaryCode/Code tables. Here is how it works, DictionaryCode holds different Code's image translation for different Dictionary/Code combinations and Code also have a one-to-many association to a default Dictionary. But for some reason my join-table , e.g. DictionaryCode, wasn't not created when I export mapping to create database tables. Only Dictionary and Code table were created.
Please help me see what I did wrong.
Here are the mappings that was generated by xDoclet:
Code:
<hibernate-mapping>
<class
name="Dictionary"
proxy="Dictionary"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="id"
column="id"
type="java.lang.Long"
>
<generator class="native">
</generator>
</id>
<version
name="version"
type="timestamp"
column="UPDT_DTS"
/>
<property
name="name"
type="java.lang.String"
update="true"
insert="true"
column="name"
length="20"
not-null="true"
unique="true"
/>
<property
name="description"
type="java.lang.String"
update="true"
insert="true"
column="description"
length="256"
not-null="false"
unique="false"
/>
</class>
<class
name="Code"
proxy="Code"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="id"
column="id"
type="java.lang.Long"
>
<generator class="native">
</generator>
</id>
<version
name="version"
type="timestamp"
column="UPDT_DTS"
/>
<property
name="name"
type="java.lang.String"
update="true"
insert="true"
column="name"
length="20"
not-null="true"
unique="true"
/>
<property
name="description"
type="java.lang.String"
update="true"
insert="true"
column="description"
length="256"
not-null="false"
unique="false"
/>
<many-to-one
name="dictionary"
class="Dictionary"
cascade="none"
outer-join="auto"
update="true"
insert="true"
column="dictionary_id"
not-null="true"
/>
<list
name="dictionaryCodes"
table="DictionaryCode"
lazy="true"
inverse="false"
cascade="none"
>
<key column="code_id" />
<index column="code_index" />
<composite-element class="DictionaryCode">
<property
name="image"
type="java.lang.String"
update="true"
insert="true"
column="image"
length="80"
not-null="true"
/>
<many-to-one
name="dictionary"
class="Dictionary"
cascade="none"
outer-join="auto"
update="true"
insert="true"
column="dictionary_id"
not-null="true"
/>
</composite-element>
</list>
</class>
</hibernate-mapping>
Thanks for any help...
--danny