-->
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.  [ 5 posts ] 
Author Message
 Post subject: complex mapping
PostPosted: Mon Oct 10, 2005 8:39 am 
I have this:


Users ------> usersmovils <------- Movils
|
|
|
V
rolesusersmovils <--------------Roles

And I wanna do something like this:
User u;
IList rolster= u.Movils.Roles;
and this return the roles of all moviles for that user.
Or
IList rolsmovter = u.Movils(3).Roles

All roles for the movil 3 and for the user


thanks.


Top
  
 
 Post subject: error in relations
PostPosted: Mon Oct 10, 2005 8:44 am 
this are the correct relations...

Users ------> usersmovils <------- Movils

usersmovils--------->rolesusersmovils <--------------Roles


Top
  
 
 Post subject: the question is
PostPosted: Mon Oct 10, 2005 8:53 am 
How can i map a nested relation one-to-many??

whith composite-element I can


Top
  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 9:31 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
What do you think about this:

User and Movil:
- UserMovils as <one-to-many>

UserMovil:
- User and Movil as <many-to-one>
- RoleUserMovils as <one-to-many>

RoleUserMovils:
- UserMovil and Role as <many-to-one>

Role:
- RoleUserMovils as <one-to-many>

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject: yes
PostPosted: Mon Oct 10, 2005 11:00 am 
that is a very good mapping.

thanks.

and what do you think about implemet nested collections of relations many-to-one? (using a reference to parent).


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