Hi,
I got a question on using implicit joins with Hibernate 3. I've tried to make an implicit join using Criteria API with the following query.
Code:
session.createCriteria(Key.class)
.add(Restrictions.eq("customer.name","abc"))
.uniqueResult();
This doesn't work and results in an error ("Cannot find property cusomter.name"). When I'm trying to make the same query with a (more or less silly) alias the whole things works fine:
Code:
session.createCriteria(Key.class)
.createAlias("customer","alias1")
.add(Restrictions.eq("alias1.name","abc"))
.uniqueResult();
Can somebody explain this behavoir?
Greetings
Joerg
Hibernate version: 3.0.5