Java - Problemas mapeo Hibernate one to many

 
Vista:

Problemas mapeo Hibernate one to many

Publicado por Ramiro (2 intervenciones) el 01/06/2009 14:05:22
Buenas! , tengo el siguiente problema:

Mi base de datos tiene por ejemplo las tablas Arreglos y Temaarreglos

Arreglos tiene : Id_Arreglos , Nombre
Temaarreglos tiene: Id_Arreglos , Id_Tema

La relacion es uno a muchos , 1 Temaarreglos puede tener 1 o mas Arreglos.

Cuando voy a ejecutar el save de un elemento Arreglos me da error de mapeo:

Association references unmapped class: Servidor.Temaarreglo

Los mapeos son:

#<hibernate-mapping>
# <class name="Servidor.Arreglos" table="arreglos" catalog="disqueria">
# <id name="idArreglo" type="java.lang.Integer">
# <column name="Id_Arreglo" />
# <generator class="identity" />
# </id>
# <property name="nombre" type="java.lang.String">
# <column name="Nombre" length="45" not-null="true" />
# </property>
# <set name="temaarreglos" inverse="true">
# <key>
# <column name="Id_Arreglo" not-null="true" />
# </key>
# <one-to-many class="Servidor.Temaarreglo" />
# </set>
# </class>
#</hibernate-mapping>

#<hibernate-mapping>
# <class name="Servidor.Temaarreglo" table="temaarreglo" catalog="disqueria">
# <composite-id name="id" class="Servidor.TemaarregloId">
# <key-many-to-one name="arreglos" class="Servidor.Arreglos">
# <column name="Id_Arreglo" />
# </key-many-to-one>
# <key-property name="idTema" type="java.lang.Integer">
# <column name="Id_Tema" />
# </key-property>
# </composite-id>
# <many-to-one name="arreglos" class="Servidor.Arreglos" update="false" insert="false" fetch="select">
# <column name="Id_Arreglo" not-null="true" />
# </many-to-one>
# <one-to-one name="temas" class="Servidor.Temas"></one-to-one>
# </class>
#</hibernate-mapping>

#<hibernate-configuration>

# <session-factory>
# <property name="connection.username">root</property>
# <property name="connection.url">
# jdbc:mysql:///disqueria
# </property>
# <property name="dialect">
# org.hibernate.dialect.MySQLDialect
# </property>
# <property name="myeclipse.connection.profile">MySQL</property>
# <property name="connection.password"></property>
# <property name="connection.driver_class">
# com.mysql.jdbc.Driver
# </property>
# <mapping resource="Servidor/Autores.hbm.xml" />
# <mapping resource="Servidor/Ingenieros.hbm.xml" />
# <mapping resource="Servidor/Soportes.hbm.xml" />
# <mapping resource="Servidor/Temainterprete.hbm.xml" />
# <mapping resource="Servidor/Discos.hbm.xml" />
# <mapping resource="Servidor/Autorrol.hbm.xml" />
# <mapping resource="Servidor/Pistas.hbm.xml" />
# <mapping resource="Servidor/Arreglos.hbm.xml" />
# <mapping resource="Servidor/Temaautor.hbm.xml" />
# <mapping resource="Servidor/Invitados.hbm.xml" />
# <mapping resource="Servidor/Temaarreglo.hbm.xml" />
# <mapping resource="Servidor/Temainvitado.hbm.xml" />
# <mapping resource="Servidor/Estilos.hbm.xml" />
# <mapping resource="Servidor/Temas.hbm.xml" />
# <mapping resource="Servidor/Interpretes.hbm.xml" />
# <mapping resource="Servidor/Temaingeniero.hbm.xml" />
# <mapping resource="./Usuarios.hbm.xml" />
# <mapping resource="./Historico.hbm.xml" />
#
# </session-factory>
#
#</hibernate-configuration>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder