Im receive the
Foreign key must have same number of columns as the referenced primary key
for the mappin usin join table as show
I can't modify the data base, how i have to make the mapping?
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3.0
Mapping documents:
<hibernate-mapping package="com.gml.ib.hb.extracto">
<class name="Portafolio2" table="ad_vlrin">
<composite-id name="id" class="PortafolioId">
<key-property name="codTitu" column="cod_titu" type="java.lang.String" length="10"/>
<key-property name="numTitu" column="num_titu" type="java.lang.String" length="20"/>
<key-property name="canIngr" column="can_ingr" type="java.lang.Long" length="10"/>
</composite-id>
<property name="conCuen" column="con_cuen" type="java.lang.Long" not-null="true" length="9"/>
<join table="ad_adictitulos">
<key>
<column name="cod_titu"/>
<column name="num_titu"/>
<column name="can_ingr"/>
</key>
<property name="conEsta" column="con_esta" type="java.lang.Long"/>
</join>
<join table="lm_cuent">
<key>
<column name="con_cuen"/>
</key>
<property name="nomCuen" column="nom_cuen" type="java.lang.String"/>
</join>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:
Name and version of the database you are using:MsSqlServer 2000
Debug level Hibernate log excerpt:
18:04:18,328 ERROR GmlHibernateInit:49 - ERROR: GmlHibernateInit: static: Initial SessionFactory creation failed. Foreign key (f04ad_vlrin:lm_cuent [con_cuen])) must have same number of columns as the referenced primary key (ad_vlrin [cod_titu,num_titu,can_ingr])
org.hibernate.MappingException: Foreign key (f04ad_vlrin:lm_cuent [con_cuen])) must have same number of columns as the referenced primary key (ad_vlrin [cod_titu,num_titu,can_ingr])