Remi Despres-Smyth
Remi Despres-Smyth

Reputation: 4253

NHibernate query against nested class

I'm using NHibernate. I have a class which has a nested type. Is there any way, using NHibernate, to query against the nested type, asides from using a native SQL query?

Nested classes are not allowed in HQL currently.

EDIT: The outer class has an IList of nested class instances.

Upvotes: 2

Views: 672

Answers (2)

Remi Despres-Smyth
Remi Despres-Smyth

Reputation: 4253

Can't be done currently.

Upvotes: 0

rebelliard
rebelliard

Reputation: 9611

Use a component mapping.

More information @ NHibernate nested class mapping issue

Then, using HQL or Linq to NHibernate, you would simple say something like string hql = "from Store s where s.Employee.Id = 3";

Upvotes: 1

Related Questions