询问
List <t1> t1List = hibernateSession.createSqlQuery
("select * from t1 join t2 on t1.id = t2.id")
.addEntity("t1Alias",t1.class)
.addJoin("j1","t1Alias.id").list();
for(t1 object : t1List ){
log.debug(t1.id); //throws class cast exception
//Cannot convert object to class t1
}
但是如果我删除 addJoin (t1Alias.id) 会执行相同的代码
有人可以解释为什么吗?
编辑1:
t1:t2
N:1