I have two hbm.xml mappingfiles. They are identical except for the class table and class entity-name properties. They are supposed to populate the same Entity. They have entity-name= Alpha and Beta, table= PersonAlpha and PersonBeta respectively.
I have tryed using both QueryOver and Criteria to populate the entity Person:
var person = session.QueryOver<Person>("Alpha").Where(p => p.Firstname == "Donald").SingleOrDefault<Person>();
var person2 = session.CreateCriteria("Beta").Add(Restrictions.Eq("Firstname", "Donald")).UniqueResult<Person>();
As Im ref to the entity-name I thought nHibernate would know which mappingfile to use, but according to Profiler each of the above statements gene开发者_如何学编程rete SQLs against both the PersonAlpha and PersonBeta tables. Why is this?
Im using version 3.2.0 2001 og nHibernate.
Thanks!
精彩评论