-->
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.  [ 3 posts ] 
Author Message
 Post subject: Mapping Exception when using compsite-id
PostPosted: Sat Sep 24, 2005 12:39 pm 
Newbie

Joined: Wed Jul 27, 2005 8:07 pm
Posts: 9
Hi there,

I have problem when using <compsite-id>. Here is my mapping file:

Code:
<hibernate-mapping>
   <class name="com.csc.timetracker.Work" table="Work">
      <composite-id name="workId" class="com.csc.timetracker.WorkId">
         <key-property name="projId" column="projid" type="java.lang.Integer"/>
         <key-property name="workDate" column="workdate" type="java.util.Date"/>
         <key-property name="type" column="type" type="java.lang.Integer"/>
      </composite-id>
      <property name="hours" column="hours" type="java.lang.Integer"/>
      <property name="notes" column="notes" type="java.lang.String"/>
      <many-to-one name="project" column="projid" class="com.csc.timetracker.Project" not-null="true"/>
   </class>
</hibernate-mapping>



When I run the application, I failed at the line:

Code:
sessionFactory = cfg.buildSessionFactory();


the output stacktrace says:

Quote:
09:16:40,890 INFO [STDOUT] net.sf.hibernate.MappingException: Bad identifier ty
pe: net.sf.hibernate.type.ComponentType
at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEnt
ityPersister.java:660)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.jav
a:716)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(Pers
isterFactory.java:42)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.ja
va:136)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.
java:791)
at com.csc.timetracker.ConnectionFactory.<init>(ConnectionFactory.java:3
6)
at com.csc.timetracker.ConnectionFactory.getInstance(ConnectionFactory.j
ava:55)


Can anybody give a light on this issue?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 8:52 am 
Beginner
Beginner

Joined: Tue Jun 28, 2005 4:33 pm
Posts: 21
Just some basic questions...

Do you have a physical workID class? Do you declare/set/get it in your Work class?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 1:01 pm 
Newbie

Joined: Wed Jul 27, 2005 8:07 pm
Posts: 9
I solved the problem by adding the un-saved attribute to the element <composite-id>


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

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.