Hi,
I have tried lots of things but with no success. It am trying to add a
simple ManyToMany mapping but it isn't working. I am using
SchemaUpdate to create my tables using sqlite but no middle table is
being created and no exceptions are thrown when I tried to add a Group
to a user. The user and group tables are created and updates work.
Any help appreciated, it is driving me crazy. Is there a way to see
the hbm files that are created?
Here are my mappings:
public class GroupingMap : ClassMap<Grouping>
{
public GroupingMap()
{
Table("Group");
Id(x => x.Id, "Id")
.UnsavedValue(0)
.GeneratedBy.Identity();
Map(x => x.Name);
HasManyToMany(x => x.Users)
.Inverse();
Map(x => x.UserStamp);
Map(x => x.DateStamp);
}
}
public class UserMap : ClassMap<User>
{
public UserMap()
{
Table("User");
Id(x => x.Id, "Id")
.UnsavedValue(0)
.GeneratedBy.Identity();
Map(x => x.UserName);
Map(x => x.FullName);
Map(x => x.Password);
Map(x => x.PasswordRetries).Default("0");
Map(x => x.PasswordChanged);
Map(x => x.ForcePasswordChange);
HasManyToMany(x => x.Groups)
.Cascade.All();
Map(x => x.UserStamp);
Map(x => x.DateStamp);
}
}
--
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" 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/fluent-nhibernate?hl=en.