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.  [ 2 posts ] 
Author Message
 Post subject: Getting a mapping Exception for a primary Key Field
PostPosted: Tue Apr 24, 2007 12:19 pm 
Newbie

Joined: Tue Apr 24, 2007 12:01 pm
Posts: 2
Location: Pennsylvania
Quote:
Initial SessionFactory creation failed.org.hibernate.MappingException: Could not determine type for:<Fully Qualified Mapping Class Name>, for columns: [org.hibernate.mapping.Column(Column Name)].


I am getting the above exception on a primary key field of a class.
Could anybody throw some light what might be the reason?..



I have the Class properly coded with the <Identifier>Primary Key and also the mapping does not have any problem...
The mapping is as follows:

<hibernate-mapping>

<class name="com.refapp.bo.IPAbstract" table="INTD_PARTY">
<cache usage="nonstrict-read-write" />

<id name="id" column="INTD_PARTY_ID">
<generator class="sequence">
<param name="sequence">SEQ_INTED_PARTY_ID</param>
</generator>
</id>

<property name="name" column="LAST_NM" />

<set name="ipAddresses">
<key column="INTD_PARTY_ID"/>
<one-to-many class="com.refapp.bo.IPAddress" />
</set>

<joined-subclass name="com.refapp.bo.EmployerIP"
table="EMPLR">
<key column="INTD_PARTY_ID" />
<property name="employerAcctNo" column="EMPLR_ACCT_NBR" />
<many-to-one name="orgType"
class="com.refapp.bo.OrganizationType" column="ORGN_TYP_CD" />
</joined-subclass>

<joined-subclass name="com.refapp.bo.WorkerIP" table="WORKER">
<key column="INTD_PARTY_ID" />
</joined-subclass>

</class>

</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 5:00 pm 
Newbie

Joined: Tue Apr 24, 2007 12:01 pm
Posts: 2
Location: Pennsylvania
The problem is resolved as it was else where in the maping.
I had a mapping for Address.hbm.xml file, that was responsible for the error.

Old map:
<hibernate-mapping package="com.refapp.bo">
<class name="IPAddress" table="INTD_PARTY_ADR">
<cache usage="nonstrict-read-write" />
<composite-id name="id" class="IPAddressId">
<key-property name="interestedParty" column="INTD_PARTY_ID" />
<key-property name="address" column="ADR_ID"/>

</composite-id>
<property name="effectiveDate" column="EFFV_DT" />
<property name="endDate" column="END_DT" />
</class>
</hibernate-mapping>
New Mapping:
<hibernate-mapping package="com.refapp.bo">
<class name="IPAddress" table="INTD_PARTY_ADR">
<cache usage="nonstrict-read-write" />
<composite-id name="id" class="IPAddressId">
<key-property name="interestedParty" column="INTD_PARTY_ID" type="long" />
<key-property name="address" column="ADR_ID" type="long"/>

</composite-id>
<property name="effectiveDate" column="EFFV_DT" />
<property name="endDate" column="END_DT" />
</class>
</hibernate-mapping>


But then i am getting a new error now:

java.lang.ClassCastException

So could anyone throw some light on it?
Pls..


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.