Beginner |
|
Joined: Tue Aug 29, 2006 8:08 am Posts: 34
|
Something quite weird is firing a bug in my code
(only executing under Windows !!!) where before it all went right.
Besides, Exception (see bellow) says:
"..refers to an unmapped class: com.interfaz.ContainerInterfaz.." which is
the interface implemented by Container and not a class at all even to be referred at
any mapping at all (hibernate surfed my hierarchy and got me into troubles).
Details below:
-----------------
Hibernate version: 3.2.5GA
Mapping documents:
<hibernate-mapping>
<class name="com.impl.Container"
table="CONTAINERS">
<id name="id" column="CONTAINER_ID">
<generator class="native"/>
</id>
<property name="date" type="timestamp" column="CREATION_DATE"/>
<set name="names" table="CONTAINER_NAMES">
<key column="CONTAINER_ID"/>
<element column="name" unique="true"
not-null="true" type="string"/>
</set>
<set name="versions" fetch="join"
lazy="false" order-by="VERSION_DATE" inverse="true">
<key column="CONTAINER_ID"/>
<one-to-many
class="com.impl.ContainerVersion"/>
</set>
</class>
</hibernate-mapping>
<hibernate-mapping>
<class name="com.impl.ContainerVersion"
table="CONTAINER_VERSIONS">
<id name="id" column="VERSION_ID">
<generator class="native"/>
</id>
<property name="date" type="timestamp" column="VERSION_DATE"/>
<property name="xml" type="text"
not-null="true" column="CONTENT" lazy="false"/>
<property name="mainVersion" type="boolean" not-null="true"/>
<many-to-one name="container" column="CONTAINER_ID" not-null="true"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
N/A (happens right at the beggining at creation of tables)
Full stack trace of any exception that occurs:
INFO: Mapping collection: com.impl.Container.versions
-> CONTAINER_VERSIONS
Exception uncaught in thread main
org.hibernate.MappingException: An association from the table CONTAINER_VERSIONS refers to an unmapped class: com.interfaz.ContainerInterfaz
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configur
ation.java:1134)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:
1052)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1168)
Name and version of the database you are using:
hsqldb 1.8.0
|
|