2

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 generete SQLs against both the PersonAlpha and PersonBeta tables. Why is this?

Im using version 3.2.0 2001 og nHibernate.

Thanks!

Vegard
  • 35
  • 1
  • 8
  • 1
    It seems [this bug-report](https://nhibernate.jira.com/browse/NH-2843) adresses the same issue... – Vegard Sep 28 '11 at 09:06

0 Answers0