我正在尝试执行此命令:
Query q = sql.get().createQuery("SELECT object(p) from Participation p where p.member.address = :address").setParameter("address", address);
List<Participation> participations = q.getResultList();
当我调试函数时,'getResultList()'通过这个函数(来自包org.hibernate.engine.internal;)
public Object proxyFor(EntityPersister persister, EntityKey key, Object impl) throws HibernateException {
if(!persister.hasProxy()) {
return impl;
} else {
Object proxy = this.proxiesByKey.get(key);
return proxy != null?this.narrowProxy(proxy, persister, key, impl):impl;
}
}
如何通过HQL命令强制不使用代理?
答案 0 :(得分:0)