I have encountered the same problem described in this issue, and am left wondering why this was not considered an issue.
Documentation shows the following
Quote:
(3)force (optional - defaults to false) "force" NHibernate to specify allowed discriminator values even when retrieving all instances of the root class.
The force attribute is (only) useful if the table contains rows with "extra" discriminator values that are not mapped to a persistent class. This will not usually be the case.
The patch provided by the user clearly shows that his mapping was not retrieving all instances of the root class, but rather the mapping was asking explicitly for Apples in one collection and Oranges in the other. Assuming that the table contained only items that had mappings it seems that the user was obeying the rules.
What is not clear to me is that if I specify the following
Code:
<bag name="Oranges" cascade="all-delete-orphan" inverse="true">
<key column="ContainerID"/>
<one-to-many class="NHibernate.Test.NHSpecificTest.NH1579.Orange, NHibernate.Test"/>
</bag>
where I have explicitly stated that bag is to contain oranges, then how does this not line up with what the documentation states? This bag is to contain only Oranges, not the root class (in this case entity).
If someone could help me to clarify this that would be most appreciated. I have always assumed that a table per hierarchy would allow me to map collections containing a single sub class of the hierarchy in exactly the way shown above.
Thanks much
John