-->
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: Mapping to Custom Type
PostPosted: Thu Apr 17, 2008 1:08 pm 
Newbie

Joined: Thu Apr 17, 2008 12:50 pm
Posts: 5
Hi everyone-

New to Hibernate and having a problem mapping an element. Here is the mapping file:

<hibernate-mapping>
<typedef class="org.acord.standards.pc_surety.acord1_12_0.xml.C25" name="C25"/>

<class name="org.acord.standards.pc_surety.acord1_12_0.xml.PCPOLICY" table="ZEUS_REP.POLICY_INQUIRY_MV">
<id name="PolicyNumber" column="POLICY_NO" type="C25">
<generator class="native"/>
</id>
<property name="CurrentTermAmt" column="POLICY_TERM" type="currency"/>
<property name="PolicyStatusCd" column="POLICY_STATUS" type="string"/>
<property name="ControllingStateProvCd" column="POLICY_STATE" type="string"/>
</class>

</hibernate-mapping>

Unfortunately the domain model did not use any simple Java types but instead created their own for every element. So although PolicyNumber is essentially just a String, it is of custom Java class C25.

This is the exception I get:

failed.org.hibernate.MappingException: Could not determine type for: org.acord.standards.pc_surety.acord1_12_0.xml.C25, for columns: [org.hibernate.mapping.Column(POLICY_NO)]

What simple piece am I missing?

Thanks,

-Allon


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.