Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl
In directory sc8-pr-cvs1:/tmp/cvs-serv18853/hibernate/impl
Modified Files:
QueryImpl.java
Log Message:
better handling of proxies in QueryImpl
Index: QueryImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/QueryImpl.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** QueryImpl.java 12 Mar 2003 12:40:52 -0000 1.25
--- QueryImpl.java 13 Mar 2003 02:52:19 -0000 1.26
***************
*** 158,164 ****
}
! public void setEntity(int position, Object val) throws HibernateException, SQLException {
! val = HibernateProxyHelper.unproxy(val, session);
! setParameter( position, val, Hibernate.association( val.getClass() ) );
}
--- 158,163 ----
}
! public void setEntity(int position, Object val) {
! setParameter( position, val, Hibernate.association( HibernateProxyHelper.getClass(val) ) );
}
***************
*** 203,209 ****
}
! public void setEntity(String name, Object val) throws HibernateException, SQLException {
! val = HibernateProxyHelper.unproxy(val, session);
! setParameter( name, val, Hibernate.association( val.getClass() ) );
}
--- 202,207 ----
}
! public void setEntity(String name, Object val) {
! setParameter( name, val, Hibernate.association( HibernateProxyHelper.getClass(val) ) );
}
***************
*** 268,282 ****
}
! public void setParameter(int position, Object val) throws HibernateException, SQLException {
setParameter( position, val, guessType(val) );
}
! public void setParameter(String name, Object val) throws HibernateException, SQLException {
setParameter( name, val, guessType(val) );
}
! private Type guessType(Object param) throws HibernateException, SQLException {
! param = HibernateProxyHelper.unproxy(param, session);
! Class clazz = param.getClass();
return guessType(clazz);
}
--- 266,279 ----
}
! public void setParameter(int position, Object val) throws HibernateException {
setParameter( position, val, guessType(val) );
}
! public void setParameter(String name, Object val) throws HibernateException {
setParameter( name, val, guessType(val) );
}
! private Type guessType(Object param) throws HibernateException {
! Class clazz = HibernateProxyHelper.getClass(param);
return guessType(clazz);
}
***************
*** 333,337 ****
public void setProperties(Object bean) throws HibernateException, SQLException {
- bean = HibernateProxyHelper.unproxy(bean, session);
Class clazz = bean.getClass();
Iterator iter = session.getFactory().getNamedParameters(queryString).iterator();
--- 330,333 ----
|