Hibernate version:3
Name and version of the database you are using:MySQL 5.0.27
Hi! I'm new to hibernate and I'm trying to create a parent-child relationship between two tables without any success.
The first table (Permisos) has a composite id.
These are the hibernate mapping:
Menu.hbm.xml
<hibernate-mapping>
<class name="abm.per.tables.Menu" table="menues">
<composite-id>
<key-property name="menu"/>
<key-property name="accion"/>
</composite-id>
<property name="descripcion"/>
<property name="orden"/>
<list name="permisos" cascade="all">
<key>
<column name="menu"></column>
<column name="accion"></column>
</key>
<index column="permiso"/>
<one-to-many class="abm.per.tables.Permiso"/>
</list>
</class>
</hibernate-mapping>
*************************************
Permiso.hbm.xml
<hibernate-mapping>
<class name="abm.per.tables.Permiso" table="permisos">
<composite-id>
<key-property name="tipoCliente"/>
<key-property name="menu"/>
<key-property name="accion"/>
</composite-id>
<property name="permiso"/>
</class>
</hibernate-mapping>
*****************************************
The menu bean class contains getter and setter methods for all attributes including
a List of permisos.
When I get a Menu Object, it fills the list of permisos with a PersistentList instead of a list of Permiso Object.
I don't know what I'm doing wrong, can anyone give me a little help!
much appreciated!
|