-->
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: Foreign key used in set of sublass (hibernate 3.2 -> 3.3.)
PostPosted: Mon May 11, 2009 4:24 pm 
Newbie

Joined: Mon May 11, 2009 4:06 pm
Posts: 1
Hi,

I used the following mapping in Hibernate 3.2 successfully. However, in Hibernate 3.3.1 GA I receive a "property not found" error:
(org.hibernate.MappingException: property [address] not found on entity [com.company.hibernate.ServerImpl])

Do I have to use a different mapping now?
Or should HbmBinder.bindCollectionSecondPass use collection.getOwner().getReferencedProperty(property).getValue() instead of getRecursiveProperty in line 2429?

I have a class Server, a subclass ServerImpl and a referenced class User.
ServerImpl uses the property Server.address to find all users that have been used the server via User.last_used_address


Code:
<hibernate-mapping default-access="field"
package="com.company">

  <class name="User" table="USER">
    <id name="id" type="java.lang.Long" column="USER_ID" />     
    <property name="lastUsedAddress" type="string" column="LAST_USED_ADDRESS" />   
  </class>
 
 
  <class name="Server" table="SERVER" abstract="true">
    <id name="id" type="java.lang.Long" column="SERVER_ID" /> 
    <discriminator column="SERVER_TYPE"/>   
    <property name="serverType" type="string" column="SERVER_TYPE"  />
    <property name="address" unique="true" type="string" column="ADDRESS"  />   
  </class>
 
  <subclass name="ServerImpl" extends="Server" discriminator-value="1">       
     <!-- all users that have used this server -->         
    <set name="users" lazy="true" >
      <key property-ref="address">
          <column name="LAST_USED_ADDRESS"/>
      </key>             
      <one-to-many class="User"/>
    </set>                     
  </subclass>
 
</hibernate-mapping>


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.