-->
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: UserTypes:how to get owning entity and type's property?
PostPosted: Tue Oct 24, 2006 8:01 pm 
Newbie

Joined: Tue Oct 24, 2006 7:47 pm
Posts: 4
Hi all,

I've been scratching my head with this for a number of hours to no avail.

Hibernate 3.1.3 / Mac OS X / JDK 1.4

Here's the problem I can't solve:

I have a UserType which resolves int column values to specific instances of a type (call it Foo) internal to our app.

When Foo is 5, nullSafeGet() returns Foo.CAR or Foo.BIKE depending on the owning entity (These are public static final's a la enumeration pattern).

Is there any way to get the owner of the property we're nullSafeGet()ing?

Consider if I have two mappings which map to two classes. Both mappings have one column of this usertype. I want to return a value based on the whether nullSafeGet() is being called in the context of one, or the other. The owner property in nullSafeGet() seems to never be set.

Secondly - is there any way to fetch the name of the property nullSafeGet() is populating? I know this is a bit of a long shot.

If there's anything unclear here, please let me know

JC


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.