Hi.
I've two classes dao.
Code:
class Addresses{
private Anag foo;
//getter and setter
}
class Anag{
private String name;
//getter and setter
}
The two classes are mapped with two hbm (into addresses.hbm.xml there ia a <many-to-one> relationship obviously).
The question is:
I would execute the following HQL query:
Code:
StringBuilder query = new StringBuilder();
query.append("SELECT A");
query.append(" FROM Addresses as I");
query.append(" inner join I.anag as A");
query.append(" where A.name = :foo.name");
But the method session.createQuery(String query) throws an Error and in particular write on console the following message:
Code:
org.hibernate.hql.ast.ErrorCounter.reportError(ErrorCounter.java:33) - ERROR - <AST>:1:148: unexpected AST node: :
Is it possible to refer to the variable "name" into my query and how?
Thanks in advance.