Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

EntityWalker is a class that based on a EntityMetaModel can traverse a object tree. EnityMetaModel describes the relationship between objects and the quality strength _of the relationship (_composition vs aggregation). The EntityMetaModel can be determined by looking at NHibernate's configuration and this is done by the NHibernateMetaModelProvider. Using this EMM the EntityWalker can create a set of objects which are reachable from the project root. The EntityWalker uses only Composite relationship relationships to traverse the object tree. So something that is only reachable by aggregate relationships is not considered in project (and will be considered an orphan if is in session).

NHibernateMetaModelProvider

This class is responsible for creating a EntityMetaModel based on a NHibernate configuration. It uses NHibernate's cascade styles to determine the strength of the relationship. Here the rule of thumb is that when a cascade includes delete the relation is a composition and otherwise it is a mere aggregate relationship. So

  • All -> Composite
  • All-Delete-Orphan -> Composite
  • Others -> Aggregation