beginner hibernate

"Aníbal Jalil" <[email protected]>
Newsgroups gmane.comp.java.javaspain
Message-ID <[email protected]>
Hola grupo, estoy principiando con hibernate, y tal vez me puedan ayudar,
estoy corriendo este comando y me sale que me falta una clase no mapeada, he
metido el archivo xml en todas partes a ver que problema es, pero nada,
finalmente lo deje donde se supone que va... aqui esta mi hibernate.cfg.xml
necesitaria borrar hibernate.properties? la documentacion de hibernate dice
que el cfg.xml sobreescribe la conf del .properties asi qe no creo

la verdad es que ni idea donde esta el error pues igualmente ya compile la
clase y se encuentra en su paquete:

un detalle: al repetir la linea en el hibernate.cfg.xml donde hago <mapping
resource... del xml que supuestamente falta, lo agarra y mapea, pero luego
sale otro error de duplicidad..

pd. cualquier critica, sugerencia, jalada de oreja, adicionales,
bienvenidas, gracias a todos..


C:\JAVACODE\ZOOCWARE\ZOOCWARE\CLASSES\COM\CTG\ZOOCWARE
├───base
│       Alimento.class
│       Lote.class
│       MovimientoLote.class
│       Nido.class
│       Pieles.class
│
├───beans
│       Alimento.class
│       Lote.class
│       NumerosAleatorios.class
│       Persistente.class
│       TipoAlimento.class
│       TipoLote.class
│
├───dao
│       AbstractDaoZooc.class
│       AlimentoDao.class
│       DataAccessLayerExceptionZooc.class
│       HibernateFactoryZooc.class
│
├───gui
│       Alimentacion$1.class
│       Alimentacion.class
│       CrecimientoLevante$1.class
│       CrecimientoLevante.class
│       GeneracionLotes$1.class
│       GeneracionLotes.class
│       Incubacion$1.class
│       Incubacion.class
│       MainZoocware$1.class
│       MainZoocware$2.class
│       MainZoocware$ItemsListenerHandler.class
│       MainZoocware.class
│       Sacrificio$1.class
│       Sacrificio.class
│
└───hibernate
        EjemploCrearAlimento.class

--------------------------------------------------------------
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
    <session-factory>
        <!-- database connection settings -->
        <property
name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
        <property
name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost/zoocware</property>
        <property name="hibernate.connection.username">sa</property>
        <property name="hibernate.connection.password"></property>

        <!-- JDBC connection pool -->
        <property name="hibernate.connection.pool_size">1</property>

        <!-- dialect -->
        <property
name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>

        <!-- envie echo de todos los SQL ejecutados a stdout -->
        <property name="hibernate.show_sql">true</property>

        <mapping resource='Alimento.hbm.xml'></mapping>
        <mapping resource='TipoAlimento.hbm.xml'></mapping>
        <mapping resource='Lote.hbm.xml'></mapping>
        <mapping resource='TipoLote.hbm.xml'></mapping>
<!--
        <mapping resource='EspecieReptil.hbm.xml'></mapping>
        <mapping resource='Monitor.hbm.xml'></mapping>
        <mapping resource='Movimiento.hbm.xml'></mapping>
        <mapping resource='MovimientoLote.hbm.xml'></mapping>
        <mapping resource='Nido.hbm.xml'></mapping>
        <mapping resource='NivelIncubacion.hbm.xml'></mapping>
        <mapping resource='PesoLote.hbm.xml'></mapping>
        <mapping resource='Pieles.hbm.xml'></mapping>
        <mapping resource='RangoTamano.hbm.xml'></mapping>
        <mapping resource='SaldoLote.hbm.xml'></mapping>
        <mapping resource='TamanoLote.hbm.xml'></mapping>
-->
    </session-factory>
</hibernate-configuration>
-------------------------------------------------------------

C:\javacode\zoocware\zoocware\classes>java -classpath
../lib/hibernate3.jar;../lib/hsqldb.jar;../lib/commons-collections-2.1.1.jar;../lib/commons-logging-1
.0.4.jar;../lib/dom4j-1.6.1.jar;.
com.ctg.zoocware.hibernate.EjemploCrearAlimento
16/04/2008 12:28:04 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.2
16/04/2008 12:28:04 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
16/04/2008 12:28:04 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
16/04/2008 12:28:04 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
16/04/2008 12:28:05 PM org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
16/04/2008 12:28:05 PM org.hibernate.cfg.Configuration
getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
16/04/2008 12:28:05 PM org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : Alimento.hbm.xml
16/04/2008 12:28:05 PM org.hibernate.cfg.HbmBinder
bindRootPersistentClassCommonValues
INFO: Mapping class: com.ctg.zoocware.base.Alimento -> RACION_ALIMENTO
16/04/2008 12:28:06 PM org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : TipoAlimento.hbm.xml
16/04/2008 12:28:06 PM org.hibernate.cfg.HbmBinder
bindRootPersistentClassCommonValues
INFO: Mapping class: com.ctg.zoocware.beans.TipoAlimento -> TIPO_ALIMENTO
16/04/2008 12:28:06 PM org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : TipoLote.hbm.xml
16/04/2008 12:28:06 PM org.hibernate.cfg.HbmBinder
bindRootPersistentClassCommonValues
INFO: Mapping class: com.ctg.zoocware.beans.TipoLote -> TIPO_LOTE
16/04/2008 12:28:06 PM org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : Lote.hbm.xml
16/04/2008 12:28:06 PM org.hibernate.cfg.HbmBinder
bindRootPersistentClassCommonValues
INFO: Mapping class: com.ctg.zoocware.beans.Lote -> LOTE
16/04/2008 12:28:06 PM org.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null
Exception in thread "main"
com.ctg.zoocware.dao.DataAccessLayerExceptionZooc:
org.hibernate.MappingException: An association from the table LOTE refers to
an unmapped class: TipoLote
        at
com.ctg.zoocware.dao.HibernateFactoryZooc.buildIfNeeded(HibernateFactoryZooc.java:81)
        at
com.ctg.zoocware.dao.AbstractDaoZooc.<init>(AbstractDaoZooc.java:27)
        at com.ctg.zoocware.dao.AlimentoDao.<init>(AlimentoDao.java:19)
        at
com.ctg.zoocware.hibernate.EjemploCrearAlimento.main(EjemploCrearAlimento.java:20)
Caused by: org.hibernate.MappingException: An association from the table
LOTE refers to an unmapped class: TipoLote
        at
org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1252)
        at
org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1170)
        at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)
        at
com.ctg.zoocware.dao.HibernateFactoryZooc.configureSessionFactory(HibernateFactoryZooc.java:93)
        at
com.ctg.zoocware.dao.HibernateFactoryZooc.buildIfNeeded(HibernateFactoryZooc.java:79)
        ... 3 more

C:\javacode\zoocware\zoocware\classes>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.