-->
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: Mapping Associations using composite-key element ,property-r
PostPosted: Wed Apr 01, 2009 10:08 am 
Beginner
Beginner

Joined: Wed Aug 22, 2007 5:53 am
Posts: 38
I want, join should be performed on 3 properties out of which 2 are normal properties and one is part of composite key.
How can i specify these 3 properties inside <properties> tag ?

Code:
  <class name="Product" table="PRODUCT"  optimistic-lock="version">
      <id name="productId"  column="PRODUCTID">
       <generator class="assigned" />
       </id>
      <one-to-one name="productBasic" class="ProductBasic" cascade="save-update" property-ref="activeProduct">
        <formula>'001'</formula>
        <formula>TIMESTAMP ('9999-12-31 00:00:00.0')</formula>
        <formula>PRODUCTID</formula>
      </one-to-one>
    </class> 
     
      <class name="ProductBasic" table="PRODUCTBASIC" optimistic-lock="version">
         
    <composite-id name="compProductBasicBO" class="com.tietoenator.lis.db.impl.product.bo.CompProductBasicBO">
      <key-property name="productId" column="PRODUCTID" ></key-property>
      <key-property name="useType" column="USETYPE" ></key-property>
      <key-property name="startTimeStamp" column="STARTTIMESTAMP" ></key-property>
   </composite-id>
   
   
    <properties name="activeProduct">
        <!-- <property name="compProductBasicBO.useType" column="USETYPE" ></property> -->
        <property name="endTimeStamp" column="ENDTIMESTAMP" ></property>
        <many-to-one name="productBO" class="ProductBO" column="PRODUCTID" insert="false" update="false"/>
   </properties>
      </class>


The problem is with useType mapping.
Quote:
org.hibernate.PropertyNotFoundException: Could not find a getter for compProductBasicBO.useType in class com.tietoenator.lis.db.impl.product.bo.ProductBasicBO
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:282)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:275)


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.