I'm wondering if there is a way to tell my "any" mapping that all the classes it contains implement a common interface. For example I have:
interface IAlbumParent
{
sting Name;
}
class Artist : IAlbumParent
class GenericAlbumParent : IAlbumParent
<any name="Parent" meta-type="Int32" id-type="Int32">
<meta-value class="Artist" value="1"/>
<meta-value class="GenericAlbumParent" value="2"/>
<column name="ParentType"/>
<column name="ParentID"/>
</any>
Now, in my HQL I want to something like:
from Artist a where a.Parent.Name = "foo";
However, I get the error that NHib can't resolve a.Parent.Name. This makes sense since it doesn't know they implement an interface which requires they have a Name property. Is there someway, other than direct inheritance, to solve this issue?
|