These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: composite-id problem: component class not found
PostPosted: Mon Aug 21, 2006 10:59 am 
Newbie

Joined: Wed Aug 16, 2006 4:34 am
Posts: 1
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>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.