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: id of a derived class
PostPosted: Tue Apr 12, 2005 9:24 am 
Newbie

Joined: Tue Apr 12, 2005 9:16 am
Posts: 3
Location: germany
Mapping documents:

Hi,

I have a class "person", where the mapping-file looks like that:

<class name="Person" table="person">
<meta attribute="generated-class">src_base.Person_base</meta>
<meta attribute="scope-class" inherit="false">public abstract</meta>
<id name="personId" column="personId" type="java.lang.Long"
unsaved-value="null">
<meta attribute="scope-set">protected</meta>
<generator class="native"/>
</id>



Now I want to map a derived class "user" from person-class. I tried to get the personId of the superclass as id for my user-class with composite-id, but it doesn´t work (I really don´t know, whether it´s possible, but think, I might be not the first with that problem, so hibernate should have a quick solution?!)

<class name="User" table="user">
<meta attribute="generated-class">src_base.User_base</meta>
<meta attribute="extends">Person</meta>
<meta attribute="scope-class" inherit="false">public abstract</meta>
<meta attribute="implement-equals">true</meta>
<composite-id name="mandantId" class="Person"
unsaved-value="none">
<key-property name="personId"/>
</composite-id>


<property name="text" column="text" type="java.lang.String" >
<meta attribute="use-in-equals">true</meta>
</property>

When I create the java-files with ant, I do not get the text-property in my java-file.


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.