-->
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: reference to a different object
PostPosted: Mon Nov 03, 2008 1:56 pm 
Newbie

Joined: Fri Oct 31, 2008 11:35 am
Posts: 12
Hi, i got two fields referenced to the same table, and in my map use this map for two fields, the problem is when i got the same value for both fields they have the same object reference but its a problem for me, i need an object for each one.

this is my map.




Code:
<hibernate-mapping>
  <class dynamic-insert="false" dynamic-update="false" mutable="true" name="Comercio.Pedimento.Pedimento" optimistic-lock="version" polymorphism="implicit" select-before-update="false" table="PEDIMENTO">
      <id column="ID_PEDIMENTO" name="idPedimento" unsaved-value="-1">
          <generator class="assigned"/>
      </id>
<many-to-one class="Comercio.Anexo22.Aduana" insert="false" lazy="false" name="aduanaEntradaSalida" update="false" not-null="false">
          <column name="ID_ADUANA"/>
          <column name="SECCION"/>
      </many-to-one>
      <many-to-one class="Comercio.Anexo22.Aduana" insert="false" lazy="false" name="aduanaDespacho" update="false" not-null="false">
          <column name="ID_ADUANA_DESPACHO"/>
          <column name="SECCION_DESPACHO"/>
      </many-to-one>






Code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
  <class dynamic-insert="false" dynamic-update="false" mutable="true" name="Comercio.Anexo22.Aduana" optimistic-lock="version" polymorphism="implicit" select-before-update="false" table="ADUANA">
    <composite-id>
      <key-property column="ID_ADUANA" name="idAduana"/>
      <key-property column="SECCION" name="seccion"/>
    </composite-id>
    <property column="DENOMINACION" name="denominacion"/>
  </class>
</hibernate-mapping>





how can i resolve this problem???


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.