Mapping:
Code:
<class name="party_info, model"
discriminator-value="~party"
table="portal_parties">
<id name="party_id" access="property" column="party_id" unsaved-value="-1">
<generator class="identity" />
</id>
<discriminator column="party_type" type="string" />
<subclass name="user_group_info, model"
discriminator-value="group">
<set name="hb_users" table="..." access="property" cascade="none" lazy="true">
<key column="group_id"/>
<many-to-many class="user_identity, model" column="user_id"/>
</set>
</subclass>
<subclass name="user_identity,model"
discriminator-value="~user">
<set name="hb_user_groups" table="..." access="property" inverse="true" cascade="none" lazy="true">
<key column="user_id"/>
<many-to-many class="user_group_info, model" column="group_id"/>
</set>
</subclass>
</class>
i'm load user_group, claer users, and fill new user list:
Code:
user_identity u1 = users.get_user( "Jeff" );
user_identity u2 = users.get_user( "Kelly" );
user_identity u3 = users.get_user( "Joe" );
user_group_info ug = user_groups.get_user_group( "Management" );
user_info_collection u = new user_info_collection();
u.Add( u1 );
u.Add( u2 );
u.Add( u3 );
using ( hibernate_transaction tr = new hibernate_transaction( connection_scope.current.hibernate_session ) )
{
ug.users.Clear();
ug.users.AddAll(u);
tr.Commit();
}
get assertion:
NHibernate.AssertionFailure : collection was not processed by Flush()
what's wrong?