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.