Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
I'm using Hibernate inside NetBeans 5.0 with a JDK 1.4.2.05. Everything is working fine, but when I try to map a table with a composite key and generate the database schema I get a "component class not found error". If I generate the same class with a single field primary key it works just fine and I get no class not found exceptions.
Hibernate version: Hibernate 3.0
Mapping documents:
Code:
<hibernate-mapping package="it.gpa.passcompagnia.domain">
<class name="RGIVersione" table="pcversio" lazy="false">
<composite-id>
<key-property name="idpolizza" column="idpolizza" type="string" length="12" />
<key-property name="nverinizio" column="nverinizio" type="string" length="12" />
</composite-id>
<!-- a bunch of other properties -->
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:09:51:15,259 INFO Configuration:893 - processing foreign key constraints
C:\localrep\myProject\06Deployment\build-hibernate.xml:50: Schema text failed: component class not found: my.package.RGIVersione
Name and version of the database you are using: Microsoft SQL Server 2000
Debug level Hibernate log excerpt:Code:
10:01:21,747 INFO HbmBinder:258 - Mapping class: it.gpa.passcompagnia.domain.RGIMovimento -> pcmovime
10:01:21,747 INFO Configuration:440 - Mapping resource: it/gpa/passcompagnia/service/persistenza/domain/RGIVersione.hbm.xml
10:01:21,762 INFO HbmBinder:258 - Mapping class: it.gpa.passcompagnia.domain.RGIVersione -> pcversio
10:01:21,794 WARN HbmBinder:421 - Could not perform validation checks for component as the class it.gpa.passcompagnia.domain.RGIVersione was not found
If I use a class as an identifier, e.g.
Code:
<composite-id name="idrgiversione" class="IDRGIVersione">
<key-property name="idpolizza" column="idpolizza" type="string" length="12" />
<key-property name="nverinizio" column="nverinizio" type="string" length="12" />
</composite-id>
I get the same error, only referencing the class of the identifier.
I have read two books, the online documentation, looked for a solutions in a ton of posts: everything looks fine but it doesn't work. Where am I wrong?
t.i.a.