Hi,
I'm new of this forum and I don't know if I'm posting in the correct section.
I have a problem with an sqlquery with not mapped entity. I have two classes
Code:
public class X {
private String name;
private Y y= new Y();
}
public class Y{
private String auto;
}
I have created my sql query and mapped the result with a ResultTransformer and added the addScalar to map correctly the resultSet property names as in the next code and my query is something like this:
Code:
SQLQuery query1 = session.createSQLQuery("select a.nome as name, a.auto as auto from a");
query1.setResultTransformer(new AliasToBeanResultTransformer(X.class)).addScalar("name");
actFav=query1.list();
the problem is that I'm not able to reference the attribute of Y class (auto attribute) in my query result set.
Is there a solution? Is there someone with the same problem?
thanks,
Tiziana