views:

49

answers:

1

Hi,

I'm trying to do the following thing: ICriteria criteriaSelect = session .CreateCriteria(typeof(Employees)) .CreateCriteria("Orders") ; var test = criteriaSelect.List();

With: public class Orders{ public virtual int OrderID { get; private set;} }

public class Employees{ public virtual int EmployeeID { get; private set;} public virtual IList Orders { get; private set; } }

And I get the error: "No persister for: Employees".

Please note that for decoupling reason, I don't want Orders to reference Employees.

Thanks for your help, Stephane

A: 

The Criteria API is for indicating the specification you want during the query. You will need to establish mappings for your entities using either the older hbm.xml files or using Fluent NHibernate. See chapter 5 on Basic O/R Mapping for more details.

Derek Greer

related questions