views:

61

answers:

0

Hi,

short version: is there a HQL equivalent for session.CreateCriteria(string)?

Long version:

The mapping looks like this:

<class name="MyClass" entity-name="MyClass">
...
</class>
<class name="MyClass" entity-name="SomeEntityName">
...
</class>

When I use session.CreateCriteria("SomeEntityName"), only objects stored in "SomeEntityName" are returned. When I use session.CreateQuery("from SomeEntityName"), all objects of type "MyClass" are returned - but I only want the ones from "SomeEntityName". Is there a possibility to do this with HQL?

Thanks!