-->
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.  [ 4 posts ] 
Author Message
 Post subject: Entity Model and many-to-many
PostPosted: Tue May 23, 2006 7:58 am 
Newbie

Joined: Tue May 23, 2006 7:47 am
Posts: 1
I try to visualize the mapping described below. The inheritance relationship between "DaemonAccount "and "RealPerson" to the base class "BasicUser" gets visualized by the Hibernate Entity Model view and I can also see the entity "Group". But the many-to-many relationship between "Group" and "BasicUser" is not shown as a (bi-directional) link. Am I missing something or is a workaround required? Do I have to resolve the relation as two many-to-one relations in order to see the association?

Hibernate version: 3.1.0 beta5

Mapping documents:
<class name="mail.BasicUser" discriminator-value="Bu">
<id name="id" column="userId">
<generator class="identity"/>
</id>
<discriminator type="string"/>
<property name="uid" unique="true" not-null="true"/>
<property name="uidNumber" unique="true" not-null="true"/>

<set name="groups" table="User_Group" cascade="all-delete-orphan">
<key column="USER_ID"/>
<many-to-many column="GROUP_ID" class="mail.Group"/>
</set>

<subclass name="mail.RealPerson" discriminator-value="BuRp">
<property name="cname"/>
</subclass>

<subclass name="mail.DaemonAccount" discriminator-value="BuDa">
<property name="purpose"/>
</subclass>
</class>

<class name="mail.Group">
<id name="id" column="groupId">
<generator class="identity"/>
</id>
<property name="gid" unique="true" not-null="true"/>
<property name="gidNumber" unique="true" not-null="true"/>
<set name="members" table="User_Group" inverse="true" cascade="all-delete-orphan">
<key column="GROUP_ID"/>
<many-to-many column="USER_ID" class="mail.BasicUser"/>
</set>
</class>

Name and version of the database you are using: IBM db2 8.1

_________________
Those who can, do
Those who cannot, teach
(i) Those, who cannot teach, lecture trainee teachers teaching methodology
(ii) Those who cannot teach, administer


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 7:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Many-to-many support has not been a focus point in the tools.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 24, 2006 9:33 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
minor correction ;)

many-to-many have not been a focus point for the reverse engineering, the visualization should work for many-to-many. If they don't please submit a report to our jira.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 24, 2006 7:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I thought that was the case but I was not sure and did not have a setup to test it on. It has been noted though.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.