-->
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: Duplicate property name causing issues in polymorphic assoc.
PostPosted: Mon Oct 12, 2009 3:17 pm 
Newbie

Joined: Mon Oct 12, 2009 12:44 pm
Posts: 1
I'm a newbie to Hibernate and JPA and am hoping that some of you with more experience can help me out with some unexpected behavior that I've been seeing in Hibernate.

I'm using a table-per-subclass inheritance strategy in which a subset of my subclasses share a duplicate property name. I didn't want to pull this property into the base class, since it is not an attribute of all of the subclasses. What's confusing me is, when Hibernate generates the polymorphic HQL with this specific property in the where clause, the where condition is always joining on the first subclass that it comes to that contains that property, rather than against the subclass of the actual instance. If I rename the property to force it to be unique, then the query works as expected.

Has anyone else seen this behavior before? Short of giving the property a unique name in each of the entities, I'm not sure how else to handle this. I'll rename the property if I have to, but it just doesn't seem like it should be necessary if Hibernate is handling the polymorphic associations correctly.

I would greatly appreciate any feedback you have!

Thanks!


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.