Hello,
I am using NHibernate now the second time in a project and it happens now, that I am running into deep problems with it - at least, it seems.
I have the following problem:
I have an inheritance mapping. A Person is the superclass. A User derives from Person and Kunde derives from User. ( Person < User < Kunde )
The mapping itself works fine, also saving, updating, inserting and deleting of data works fine.
But I am experiencing great problems when using filter. When using the <filter> and <filter-def> elements on Person, everything works fine. But when I want to filter a "Kunde" by its defined properties, I am getting the error, that <filter> definitions cannot be done in <joined-subclass>.
When I am trying to insert the <filter> and <filter-def> elements for the properties of a "Kunde" into the Person.hbm.xml file, NHibernate generates the wrong SQL statements, 'cause it thinks, that the properties I am going to filter are part of the Person table.
How can I solve this problem without any dirty hacks?
Hibernate version: 1.2.1
Name and version of the database you are using: SQL Server 2005 Express
If someone wants me to add some code in here, please feel free to ask.
Kind regards,
Harald
|