Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.1
Mapping documents:Participants.hbm.xml, Course.hbm.xml, Student.hbm.xml
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using: PostgreSql 8.1
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
I have problems with using composite-id. Here is the mapping document:
Code:
<hibernate-mapping>
<class name="elitchildren.db.model.Participants" table="participants" lazy="false">
<composite-id name="participantId" class="elitchildren.db.model.ParticipantId">
<key-many-to-one name="course" class="elitchildren.db.model.Course" column="COURSE_ID"/>
<key-many-to-one name="student" class="elitchildren.db.model.Student" column="STUDENT_ID"/>
</composite-id>
...
</class>
</hibernate-mapping>
The problem is, that I get this error, when I start the schemaexport:
BUILD FAILED
D:\...\build.xml:47: Schema text failed: component class
not found: elitchildren.db.model.ParticipantId
Total time: 8 seconds
Can somebody help?
Thank you!
Samuel
p.s.:
Here is the mapping document for the Course:
Code:
<hibernate-mapping>
<class name="elitchildren.db.model.Course" table="course" lazy="false">
<id name="id" type="integer" column="id" unsaved-value="null">
<generator class="sequence">
<param name="sequence">course_id_seq</param>
</generator>
</id>
<property name="time" type="string" column="time" length="64" not-null="true"/>
<property name="startingDate" type="date" column="starting_date" not-null="true"/>
<property name="finishingDate" type="date" column="finishing_date" not-null="false"/>
<many-to-one name="courseType" class="elitchildren.db.model.CourseType" not-null="true"/>
<many-to-one name="teacher" class="elitchildren.db.model.Teacher" not-null="true"/>
<many-to-one name="languageSchool" class="elitchildren.db.model.LanguageSchool" not-null="true"/>
<array name="lessons" table="lesson">
<key column="COURSE_ID"/>
<list-index column="index"/>
<element column="date" type="date"/>
</array>
</class>
</hibernate-mapping>
and for the Student:
Code:
<hibernate-mapping>
<class name="elitchildren.db.model.Student" table="student" lazy="false">
<id name="id" type="integer" column="id" unsaved-value="null">
<generator class="sequence">
<param name="sequence">student_id_seq</param>
</generator>
</id>
<property name="name" type="string" column="name" length="200" not-null="true"/>
<property name="birthDate" type="date" column="birth_date" not-null="true"/>
<property name="healthProblem" type="string" column="health_problem" not-null="false"/>
<property name="motherTongue" type="string" column="mother_tongue" not-null="true"/>
<many-to-one name="sybling" class="elitchildren.db.model.Sybling" />
<many-to-one name="caretaker" class="elitchildren.db.model.Caretaker" not-null="true"/>
</class>
</hibernate-mapping>