views:

24

answers:

0

I have some mapping:

   <class name="SomeItem" table="items" lazy="false">
    <id name="Id" type="Int32" column="id">
        <generator class="identity"/>
    </id>
    <property name="Name" column="EventName" type="String"/>
    <property name="Description" column="EventDesc" type="String"/>
   </class>

   <class name="ItemCount">
        <id name="DummyId" type="Int32" column="DummyId">
            <generator class="assigned"></generator>
        </id>
        <component name="Item" class="SomeItem">
          <property name="Name" type="String" column="name"></property>
          <property name="Description" column="desc" type="String"></property>
          <property name="Id" type="Int32" column="id"></property>
        </component>
        <property name="Count" type="Int32"></property>
        <property name="ParentId" type="Int32"/>
    </class>

When I try to Save or Update instance of class SomeItem

SomeItem obj = FaindById(5);
obj.Description = "lsdklsdf";
Session.SaveOrUpdateCopy(obj);

I get an error that ItemCount coudn't be updated, but I update only SomeItem, that mapped as ItemCount's component. Also I can't update ItemCount, because it is fake class that does not refere to any table. Please, help me, what I should do not to update all ItemCount, but only its component.