What is the proper way to use HasAndBelongsToMany with an IUserType.
I have this class:
[ActiveRecord]
public partial class AclGroup : ActiveRecordBase<AclGroup>
{
[PrimaryKey(Generator = PrimaryKeyType.HiLo, Params =
"table=aclgroup_seq")]
public virtual int Id { get; set; }
[Property(Length = 50, NotNull = true)]
public virtual string Name { get; set; }
[HasAndBelongsToMany(Table = "AclGroupUser", ColumnKey =
"`Group`", ColumnRef = "`User`", Lazy = true, Fetch =
FetchEnum.Select, Element="`User`", ElementType =
typeof(MyApp.Domain.UserUserType))]
public virtual IList<System.Web.Security.MembershipUser> Users
{ get; set; }
}
But the XML it produces doesn't seem to be correct. It creates:
<?xml version="1.0" encoding="utf-16"?>
<hibernate-mapping auto-import="true" default-lazy="false"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance" xmlns="urn:nhibernate-
mapping-2.2">
<class name="NetMvcForum.Domain.AclGroup, NETMVCForum.Domain"
table="AclGroup">
<id name="Id" access="property" column="Id" type="Int32" unsaved-
value="0">
<generator class="hilo">
<param name="table">aclgroup_seq</param>
</generator>
</id>
<property name="Name" access="property" type="String">
<column name="Name" length="50" not-null="true"/>
</property>
<bag name="Users" access="property" table="AclGroupUser"
lazy="true" fetch="select">
<key column="`Group`" />
<element column="`User`"
type="System.Web.Security.MembershipUser, System.Web"/>
</bag>
</class>
</hibernate-mapping>
I would appreciate any help.
Thanks,
Dan
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" 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/castle-project-users?hl=en.