Joined: Fri Apr 01, 2005 8:32 am Posts: 1
|
I just downloaded hibernate3 and tool set.
When I generated java classes from hbm.xml,
I realized that many-to-one relations are generated as
java.util.Map
Is this because of the Dynamic Model feature ?
Is there a way to tell to the codegenerator to generate those as class association ?
My hbm.xml is like
----------------------------------
<class name="Il" table="Il" >
<id type="int" name="plakaNo" column="plakaNo">
<generator class="assigned" />
</id>
<property name="ad" type="string" length="40" />
</class>
<class name="Acente" table="Acente">
<id type="string" name="acenteKod" column="acenteKod" length="12">
<generator class="assigned" />
</id>
<property name="ad" type="string" length="40" />
<many-to-one name="il" class="Il" column="plakaNo" not-null="true" />
</class>
-----------------------------
Generated Acente class is like
--------------------------------
public class Acente implements Serializable {
/** nullable persistent field */
private java.util.Map il;
--------------------------------
What I was expecting is
-------------------------------
public class Acente implements Serializable {
/** nullable persistent field */
private String ad;
/** nullable persistent field */
private Il il;
------------------------------
|
|