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: Many-to-one composite id
PostPosted: Fri May 13, 2005 8:31 am 
Regular
Regular

Joined: Thu Feb 24, 2005 2:34 pm
Posts: 80
Hibernate version:3.03
I don't understand, if i made an association many-to-one with a composite id, why hibernate don't check in my "Getter/Setter" class?
It seems that to hibernate not amounts null of what I have defined in the class pojo. Otherwise if I define a UserType, hibernate me it considers in the association?

It's correct this answer:
1)Hiberanate with <many-to-one> with composite id don't check my pojo definition, but access by "field".


Can you help me please?
Devis

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>


   <class name="vo.as400.CScontrinoVO" table="sdgtwb_dat.aynau00f" lazy="false" >

         <composite-id name="pk" class="vo.pk.CScontrinoPK">
              <key-property name="cbara" column="cbar$a" type="string"/>
              <key-property name="filia" column="fili$a" type="string"/>
              <key-property name="numta" column="numt$a" />
        </composite-id>





        <property name="staga"  column="stag$a" type="dao.hibernate.TrimmedString"/>
        <property name="modea"  column="mode$a" type="dao.hibernate.TrimmedString"/>
        <property name="matea"  column="mate$a" type="dao.hibernate.TrimmedString"/>
        <property name="coloa"  column="colo$a" type="dao.hibernate.TrimmedString"/>
        <property name="varia"  column="vari$a" type="dao.hibernate.TrimmedString"/>
        <property name="cdtga"  column="cdtg$a" type="dao.hibernate.TrimmedString"/>
        <property name="tgsia"  column="tgsi$a" type="dao.hibernate.TrimmedString"/>
        <property name="pvena"  column="pven$a" />
        <property name="pacqa"  column="pacq$a" />
        <property name="de20a"  column="de20$a" type="dao.hibernate.TrimmedString"/>
        <property name="dcola"  column="dcol$a" type="dao.hibernate.TrimmedString"/>
        <property name="dcmpa"  column="dcmp$a" type="dao.hibernate.TrimmedString"/>
        <property name="ggspa"  column="ggsp$a" />
        <property name="mmspa"  column="mmsp$a" />
        <property name="aaspa"  column="aasp$a" />
        <property name="ndoca"  column="ndoc$a" />


        <many-to-one name="spedizioni"  access="property"   lazy="false" update="false" insert="false">
      <column name="GGSP$A"/>
      <column name="MMSP$A"/>
      <column name="AASP$A"/>
      <formula>20</formula>
      <column name="NDOC$A"/>
      
      
      
   </many-to-one>

        </class>



a bit java code

  public void setNdoca(String ndoca) {
    int nr_ddt=0;
    if(!ndoca.equals(null))
    {
      nr_ddt=Integer.parseInt(ndoca.substring(0,8).trim());
    }
    this.ndoca =String.valueOf(nr_ddt);

  }



  public String getNdoca() {
    return ndoca;
  }





</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.