-->
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.  [ 2 posts ] 
Author Message
 Post subject: schemaexport produce an 'elt' column ?
PostPosted: Mon Jun 28, 2004 11:46 am 
Newbie

Joined: Wed Jun 23, 2004 4:03 am
Posts: 5
Hi !, I'm trying to do a many-to-many association :

On my User.hbm.xml I have :

Code:
        <set
            name="groups"
            table="UG"
            lazy="true"
            inverse="false"
            cascade="all"
            sort="unsorted"
        >

              <key
                  column="user_id"
              >
              </key>

              <many-to-many
                  class="aston.hibernate.objets.Group"
                  outer-join="auto"
               />

        </set>

On my Group.hbm.xml I have :

Code:
       <set
            name="users"
            table="UG"
            lazy="true"
            inverse="true"
            cascade="all"
            sort="unsorted"
        >

              <key
                  column="group_id"
              >
              </key>

              <many-to-many
                  class="aston.hibernate.objets.User"
                  outer-join="auto"
               />

        </set>


These are generated by Xdoclet.

But the schemaexport tool produce :

Code:
create table UG (
   user_id BIGINT not null,
   elt BIGINT not null,
   group_id BIGINT not null,
   primary key (group_id, elt)
)


and so when I'm trying to use it, it doesn't work !

Anybody could help me ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 28, 2004 12:48 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Code:
<set
            name="groups"
            table="UG"
            lazy="true"
            inverse="false"
            cascade="all"
            sort="unsorted"
        >

              <key
                  column="user_id"
              >
              </key>

              <many-to-many
                  class="aston.hibernate.objets.Group"
                  outer-join="auto" column="group_ip"
               />

        </set>

And same for the other side, add the column attribute in the many-to-many

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.