number of cylinders is directly related to the engine, not the car. A
car has an engine and Car can be an aggregate. I would expose a
property on Car which references the engine.
public class Car
{
private Engine engine;
public int NumberOfCylinders
{
get { return engine.CylinderCount; }
}
}
<class name="Car">
<id name ="ID">
<generator class="guid"/>
</id>
<property name="Color"/>
<property name="TopSpeed"/>
<many-to-one name="engine" class="Engine" column="engine_id" not-
null="true" access="nosetter.camelcase" />
</class>
<class name="Engine">
<id name ="ID">
<generator class="guid"/>
</id>
<property name="NumberOfCylinders"/>
<bag name="cars" table="car" ... >
<key column="order_number" />
<one-to-many class="Car" />
</bag>
</class>