From: <one...@us...> - 2003-04-08 09:50:04
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv11660/sf/hibernate/loader Modified Files: Loader.java Log Message: * imporvements to CompositeUserType * cascades for <any> mappings * fixed some bugs withy collection Filter parameters * correct Type for avg(int) Index: Loader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/Loader.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Loader.java 2 Apr 2003 01:06:53 -0000 1.16 --- Loader.java 8 Apr 2003 09:49:30 -0000 1.17 *************** *** 116,121 **** final List results = new ArrayList(); //new net.sf.hibernate.collections.List(this); ! final PreparedStatement st = prepareQueryStatement( getSQLString(), values, types, selection, false, session ); ! final ResultSet rs = getResultSet(st, namedParams, selection, session); if (collection) optionalCollection.beginRead(); --- 116,121 ---- final List results = new ArrayList(); //new net.sf.hibernate.collections.List(this); ! final PreparedStatement st = prepareQueryStatement( getSQLString(), values, types, namedParams, selection, false, session ); ! final ResultSet rs = getResultSet(st, selection, session); if (collection) optionalCollection.beginRead(); *************** *** 372,378 **** /** ! * Obtain a <tt>PreparedStatement</tt> and bind JDBC-style <tt>?</tt> parameters */ ! protected final PreparedStatement prepareQueryStatement(String sql, Object[] values, Type[] types, RowSelection selection, boolean scroll, SessionImplementor session) throws SQLException, HibernateException { boolean scrollable = selection!=null && --- 372,378 ---- /** ! * Obtain a <tt>PreparedStatement</tt> and bind JDBC-style <tt>?</tt> and named parameters */ ! protected final PreparedStatement prepareQueryStatement(String sql, Object[] values, Type[] types, Map namedParams, RowSelection selection, boolean scroll, SessionImplementor session) throws SQLException, HibernateException { boolean scrollable = selection!=null && *************** *** 392,395 **** --- 392,397 ---- } + if (namedParams!=null) bindNamedParameters(st, namedParams, values.length, session); + } catch (SQLException sqle) { *************** *** 416,425 **** /** ! * Bind named parameters to the <tt>PreparedStatement</tt>, call <tt>setMaxRows</tt> and then execute it, ! * returning an SQL <tt>ResultSet</tt> */ ! private final ResultSet getResultSet(PreparedStatement st, Map namedParams, RowSelection selection, SessionImplementor session) throws SQLException, HibernateException { try { - bindNamedParameters(st, namedParams, session); setMaxRows(st, selection); ResultSet rs = st.executeQuery(); --- 418,426 ---- /** ! * Fetch a <tt>PreparedStatement</tt>, call <tt>setMaxRows</tt> and then execute it, ! * advance to the first result and return an SQL <tt>ResultSet</tt> */ ! private final ResultSet getResultSet(PreparedStatement st, RowSelection selection, SessionImplementor session) throws SQLException, HibernateException { try { setMaxRows(st, selection); ResultSet rs = st.executeQuery(); *************** *** 432,439 **** throw sqle; } - catch (HibernateException he) { - closePreparedStatement(st, selection, session); - throw he; - } } --- 433,436 ---- *************** *** 454,458 **** * superclass and should be implemented by subclasses (queries) which allow named parameters. */ ! protected void bindNamedParameters(PreparedStatement st, Map namedParams, SessionImplementor session) throws SQLException, HibernateException {} /** --- 451,455 ---- * superclass and should be implemented by subclasses (queries) which allow named parameters. */ ! protected void bindNamedParameters(PreparedStatement st, Map namedParams, int start, SessionImplementor session) throws SQLException, HibernateException {} /** |