Hello,

Just stumbled about a little problem:

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="Continental.SignalList.Domain"
namespace="Continental.SignalListManager.Domain">
  <class name="SignalList" table="SL_SIGNALLIST" lazy="false"
optimistic-lock="version" >
   <id name="SignalListId" column="ID_SIGNALLIST" type="Decimal">
     <generator class="sequence">
      <param name="sequence">SL_SIGNALLIST_SEQ</param>
     </generator>
   </id>
   <version column="NH_VERSION" name="NhVersion" />
   <property name="Description" type="String" column="DESCRIPTION" />
   <component class="SignalCollection" name="Signals">
     <many-to-one class="SignalList" name="SignalList"
column="CollectionSignalList" foreign-
key="fk_ColSignalList_SignalList"/>
     <bag name="Signals" table="SL_SIGNAL" lazy="false" cascade="all-
delete-orphan" inverse="true">
      <key column="ID_SIGNALLIST" />
      <one-to-many class="Signal" />
     </bag>
   </component>
  </class>
</hibernate-mapping>

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="Continental.SignalList.Domain"
namespace="Continental.SignalListManager.Domain">
  <class name="Signal" table="SL_SIGNAL" lazy="true">
   <id name="SignalId" column="ID_SIGNAL" type="Decimal">
     <generator class="sequence">
      <param name="sequence">SL_SIGNAL_SEQ</param>
     </generator>
   </id>
   <version column="NH_VERSION" name="NhVersion"/>
   <many-to-one class="SignalList" column="ID_SIGNALLIST"
name="SignalList"  foreign-key="fk_Signal_SignalList"/>
   <property name="PinNumber" type="String" column="PIN_NUMBER" />
   <property name="ContiTevesName" type="String"
column="CONTI_TEVES_NAME" />
  </class>
</hibernate-mapping>


This is the mapping of my SignalList class. It holds another class
called SignalCollection implementing the IList<Signal> Interface. It's
named "Signals" in this mapping file. This class holds the mechanism
to add the Signal to the internal List (also named "Signals") and to
update the added signals SignalList.

Something Like

if(!Signals.Contains(item))
{
  item.SignalList = SignalList;
  Signals.Add(item);
}


If I call update on a detached object where I just changed the
Description of a SignalList, it also updates all the Childs in the
Signals Collection.
Does NHibernate always update ALL reattached objects? Or can't
NHibernate determine if an Object is dirty, because it was detached
from a session?
At the moment this is no big problem, because objects are very small.
But I think this can get a real issue if NHibernate tries to update
thousand of records just because you changed one String.

Thanks for your help :)

Reflection

P.S.: I wouldn't mind either if anybody would have a better solution
for the Collection Component :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" 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/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to