-->
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: Intermediate table and same column Join
PostPosted: Tue Feb 10, 2009 9:26 am 
Newbie

Joined: Wed Jan 21, 2009 9:36 am
Posts: 5
Problem

I have 3 tables.

Userversion is a intermediate table with this:
- id
- idinstancia
- id version
- etc.

Instancia
- id
- etc

and Solinstancia
- id
- etc

the id from Instancia and Solinstancia is the foreign key in userversion (the idinstancia field). So I need make a join between this 3 tables. Somebody know how make this?


PD: I'm sorry for my very bad inglish



Hibernate version:

- Hibernate 3.2.6


Mapping documents:

<?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 name="cl.vsoft.liferay.domain.Userversion" table="vsc_userversion">
<id name="id" column="id_">
<generator class="native" />
</id>
<property name="idusuario" column="idusuario" insert="false" update="false"/>
<property name="idinstanciados" column="idinstancia" insert="false" update="false" />
<property name="idinstancia" column="idinstancia" insert="false" update="false" />
<property name="idversion" column="idversion" insert="false" update="false"/>
<property name="idproceso" column="idproceso" />


<many-to-one
name="Usuario"
column="idusuario"
unique="true"
class="cl.vsoft.liferay.domain.UsuarioPostulacion"
fetch="join"
foreign-key = "idusuario"
/>

<many-to-one
name="Versiones"
column="idversion"
unique="true"
class="cl.vsoft.liferay.domain.Version"
fetch="join"
foreign-key = "idversion"
/>

<many-to-one
name="Instancia"
column="idinstancia"
unique="true"
class="cl.vsoft.liferay.domain.Instancia"
fetch="join"
foreign-key = "idinstancia"
/>




<many-to-one
name="Solinstancia"
column="idinstancia"
unique="true"
class="cl.vsoft.liferay.domain.Solinstancia"
fetch="join"
foreign-key = "idinstanciados"
/>

</class>
</hibernate-mapping>


Full stack trace of any exception that occurs:

org.hibernate.MappingException: Repeated column in mapping for entity: cl.vsoft.liferay.domain.Userversion column: idinstancia (should be mapped with insert="false" update="false")


Name and version of the database you are using:

- mysql


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.