-->
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: quests about "list's id that make from xml "
PostPosted: Wed Mar 30, 2005 8:36 am 
Newbie

Joined: Wed Mar 30, 2005 7:50 am
Posts: 1
When using aaa.hbm.xml file and bbb.hbm.xml file,
both has attribute 'list', and their ids are as another table's id(tablename:aaa_bbb),
this is required.

than list has attribute 'index', name : serial
but the primary key indeed in database aaa_bbb is serial and aaa's id.


would you tell me my errer ?
thank you very much

Hibernate version: 2.1.2

Mapping document:

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
       <class name="aaa" table="aaa">
                 <cache usage="read-write"/>
                 <id name="userID" type="long" unsaved-value="0">
         <column name="USERID" not-null="true"/>
         <generator class="native"/>
                 </id>
                <list name="roles" table="aaa_bbb" lazy="true" inverse="true" outer-join="auto" >
                        <key column="USERID"/>
                        <index type="int">
                          <column name="serial"/>
                        </index>
                        <many-to-many class="bbb" column="ROLEID"/>
      </list>
   </class>
</hibernate-mapping>



Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
       <class name="bbb" table="bbb">
                 <cache usage="read-write"/>
                 <id name="roleID" type="long" unsaved-value="0">
         <column name="ROLEID" not-null="true"/>
         <generator class="native"/>
                 </id>
                 <list name="users" table="aaa_bbb" lazy="true" outer-join="auto">
                        <key column="ROLEID"/>
                        <index type="int">
                          <column name="serial"/>
                        </index>
                        <many-to-many class="aaa" column="USERID"/>
      </list>
   </class>
</hibernate-mapping>




[/code]


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.