-->
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: many-to-many Probleme im mapping
PostPosted: Fri Aug 21, 2009 11:32 am 
Newbie

Joined: Fri Aug 21, 2009 11:23 am
Posts: 1
Hallo,

ich plage mich seit 2 Stunden mit einem kleinen Problem in meinen mapping-Dateien rumm.
Ich möchte eine many-to-many Verknüpfung zwischen Benutzern und ihren Rollen erstellen.
Dabei ist logisch das ein Benutzer mehrere Rollen haben kann und eine Rolle mehreren Benutzern zugeordnet ist.

Mein Set in der user.hbm.xml sieht wie folgt aus:
Code:
<id name="user_id" type="long" column="USER_ID">
         <generator class="assigned" />
</id>
<set name="roles" table="USERROLES">
  <key column="ID_USER" />
  <many-to-many class="com.dis.security.Role" column="ID_ROLE"/>
</set>
<property name="firstname">
  <column name="FIRSTNAME" length="30" not-null="true" />
</property>

...



Meine role.hbm.xml:

Code:
<class name="com.dis.security.Role" table="ROLES" lazy="false">
      <id name="id" type="long" column="ROLE_ID">
         <generator class="hilo" />
      </id>
      <set name="users" table="USERROLE">
              <key column="ID_ROLE" />
              <many-to-many class="com.dis.domain.User" column="ID_KUNDE"/>
           </set>
        <property name="name" length="80" column="NAME" not-null="true"/>
        <property name="description" length="80" column="DESCRIPTION" not-null="false"/>     
</class>


Der Fehler:

Initial SessionFactory creation failed.org.hibernate.InvalidMappingException: Could not parse mapping document from resource user.hbm.xml

Kann mir jemand sagen wo der Tippfehler liegt?
Ich habe in den jeweiligen Klassen jeweils ein Set hinterlegt.

Danke für Eure Hilfe


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.