BTW, the Programs bag should probably be mapped as inverse, meaning, it's 
the other endpoint (the programs table) that store the foreign key.

RP

On Tuesday, December 30, 2014 12:43:53 PM UTC, fba wrote:
>
> Should your read the documentation, you would find out why it is not 
> working.
> From a logical point of view :
> You map a bag specifying none on cascading. Why would you expert then any 
> action from nh on the bag objects?
>
> I don't mean to be rude but it is over nh a very common relationnal 
> béhavior principle.
>
> Envoyé de mon iPhone
>
> Le 30 déc. 2014 à 13:23, [email protected] <javascript:> a 
> écrit :
>
> Hi,
>
> this is my mapping, can you tell what is wrong with it?
>
>   <class name="Menu" table="s_menu">
>     <id name="Id">
>       <column name="id" />
>       <generator class="native" />
>     </id>
>     <property name="Name">
>       <column name="name" />
>     </property>
>     <bag name="Programs" table="s_menu_programs" cascade="none" 
> lazy="false">
>       <key column ="Id" />
>       <many-to-many class="Program" column="program_id" />
>     </bag>
>   </class>
>
>   <class name="Program" table="s_programs">
>     <id name="Id">
>       <column name="id" />
>       <generator class="native" />
>     </id>
>     <property name="Type">
>       <column name="type" />
>     </property>
>     <property name="Description">
>       <column name="description" />
>     </property>
>     <property name="Code">
>       <column name="code" />
>     </property>
>     <property name="Form">
>       <column name="form" />
>     </property>
>   </class>
>
> Op maandag 29 december 2014 00:17:02 UTC+1 schreef fba:
>>
>> Check you cascading options in the mapping.
>>
>> Envoyé de mon iPhone
>>
>> Le 28 déc. 2014 à 23:38, [email protected] a écrit :
>>
>> Hi all,
>>
>> I'm using NHibernate in combination with VB.Net, and have following code:
>>
>> Dim rmen As IMenu = New MenuRepository
>> Dim rpgm As IProgram = New ProgramRepository
>> Dim menus As MCls.Domain.Menu = rmen.GetByName(Menu.SelectedItem)
>> Dim prog As Program = rpgm.Get(MenuItems.SelectedValue)
>> menus.Programs.Remove(prog)
>> rmen.Update(menus)
>>
>>
>> This is not working, the item is still in the "bag"
>> What am I doing wrong?
>>
>> Benjamin
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "nhusers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/nhusers.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>  -- 
> You received this message because you are subscribed to the Google Groups 
> "nhusers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected] <javascript:>
> .
> Visit this group at http://groups.google.com/group/nhusers.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to