I apologize if this has been asked before, but I can't find the
answer. I'm trying to map a many-to-many relationship using
NHibernate 3.2 ConventionModelMapper. I'd like to get the same
results that I would get if using ConfOrm's
CoolTablesAndColumnsNamingPack. For example,
class Role
{
public virtual ISet<User> Users { get; set; }
}
class User
{
public virtual ISet<Role> Roles { get; set; }
}
Using ConfOrm, I could use CoolTablesAndColumnsNamingPack
(specifically, the ManyToManyInCollectionTableApplier). By doing so,
I would automatically get a UsersToRoles table which serves as the
association table for the many to many relationship. However, using
mappings by convention, I can't see how to get the X_to_Y association
table automatically. Right now, what's happening is the two tables
have foreign keys to each other which I don't want. For example, the
Users table has a "role_key" column which is not good.
Would the IsManyToMany method of ConventionModelMapper do the trick?
If so, does someone have a working example of using this method to get
the association table?
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.