-->
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: ParameterizedType and owner object
PostPosted: Wed Jul 05, 2006 3:44 pm 
Regular
Regular

Joined: Sat Jan 07, 2006 8:30 pm
Posts: 68
Hibernate version:3.1.3

Hi,

I have a tipical address mapping that among other fields has state and country.

State and Country are parametirezed types but here's the problem. The state lookup depends on the country so no mater what I try to do the owner object is not populated with the country.

So I have the following fields. How do I get my hands on the country while handling the statetype ?


Code:
        <property name="countryType" column="country" not-null="true">              
           <type name="com.framework.core.utils.hibernate.GenericEnumUserType">
            <param name="lookupClass">com.gsi.core.domain.enums.CountryType</param>
            <param name="identifierMethod">getValue</param>
            <param name="lookupMethod">lookup</param>
            </type>
        </property>
       
         <property name="stateType" column="state" not-null="true">              
           <type name="com.framework.core.utils.hibernate.GenericEnumUserType">
            <param name="lookupClass">com.gsi.core.domain.enums.StateType</param>
            <param name="identifierMethod">getValue</param>
            <param name="lookupMethod">lookup</param>
            </type>
        </property>   


Thanks,
Q


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 06, 2006 2:35 pm 
Regular
Regular

Joined: Sat Jan 07, 2006 8:30 pm
Posts: 68
So, basically, what I'm asking is... How can I read a column in a UserType implementation, column different that's the one mapped.

I can probably get the ResultSet metadata but that doesn't seems to be right.. Isn't there a simple way ?


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.