-->
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: Subclass not supporting <properties>?
PostPosted: Wed Mar 24, 2010 7:57 am 
Newbie

Joined: Wed Mar 10, 2010 8:47 am
Posts: 4
Hi
If you have experience with the <properties> element you might be able to help me with a different problem in my other thread: https://forum.hibernate.org/viewtopic.php?f=1&t=1003443

I am using Hibernate core 3.3.2.
Situation: I have a class with three subclasses mapped as single table inheritance. I am working on legacy data, so I can't change the schema.

In the superclass I use the properties element to have a target for property-ref for another class:
Code:
      <properties name="mandantFilialeOrganization" unique="true">
         <property name="mandant" type="integer" column="mandant"></property>
         <property name="filiale" type="integer" column="filiale"></property>
         <property name="organization" type="integer" column="organization"></property>
      </properties>


This is working more or less (for the less part see the link above).

Now I need a target for a property-ref from another class that doesn't know the filiale element. So i would need this:
Code:
      <properties name="mandantOrganization" unique="true">
         <property name="mandant" type="integer" column="mandant"></property>
         <property name="organization" type="integer" column="organization"></property>
      </properties>


Of course I can't do that since I would have multiple definitions of the same property.

All of the subclasses have the properties mentioned here, but when using property-ref I know which subclass to target.
So I tried moving the different <properties> definitions to the respective subclasses which would solve my problem.
Unfortunately subclass seems to support only <property> but not <properties>.
Is there another way to do this? And is there a reason why subclass won't support this element?

Thank you
Best regards
Tobias


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.