my issue was that I set the cascade to all, and then deleted to root object, which naturally deleted all the child objects. Setting it to save-update was what I wanted to do
Components are only defined inside the context of their containing entity, and can’t declare an Id.
Because components do not have Ids, in case that some child object has changed, NHibernate can’t determine which row in the database need to be updated
To fully understand the relational structure and performance characteristics, we must also consider the structure of the primary key that is used by Hibernate to update or delete collection rows.
indexed collections (maps, lists, and arrays)
primary key consisting of the <key> and <index>
Sets have
primary key consisting of <key> and element columns
idbag
Bags are the worst case since they permit duplicate element
All collection types except ISet and bag have an index column - a column that maps to an array or IList index or IDictionary ke
ndexes are mapped using <index>, <index-many-to-many>, <composite-index> or <index-many-to-any>
Please note that NHibernate does not support bidirectional one-to-many associations with an indexed collection (list, map or array) as the "many" end, you have to use a set or bag mapping.
PAYMENT_ID
joined-subclass
key column="PAYMENT_ID"/>
a polymorphic association to IPayment is mapped using <many-to-one>.
class="IPayment"
NHibernate distinguishes "new" (unsaved) instances from "existing" (saved or loaded in a previous session) instances by the value of their identifier (or version, or timestamp) property
which values should be interpreted as representing a "new" instance
We may use lazy to define a contract for what data is always available in any detached instance of a particular class.
NHibernate uses lazy select fetching for collections
lazy proxy fetching for single-valued associations.
NHibernate does not support lazy initialization for detached objects
value type (eg, a composite element)
entity
Consider using a custom type.
it is much better to use two one-to-many associations to an intermediate link class.
An NHibernate session has an internal (first-level) cache where it keeps its entities
An important point is that the second-level cache does not cache instances of the object type being cached; instead it caches the individual values of the properties of that object.