From: <one...@us...> - 2002-11-23 01:16:23
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv7161/hibernate/loader Modified Files: Loader.java Log Message: more efficient impl of scalars-in-find() ... still hacky, though Index: Loader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/Loader.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Loader.java 22 Nov 2002 07:03:07 -0000 1.29 --- Loader.java 23 Nov 2002 01:16:20 -0000 1.30 *************** *** 71,78 **** return true; } ! protected Type[] getReturnTypes() { return null; } /** --- 71,86 ---- return true; } ! /** ! * The column types of a find() query ! */ protected Type[] getReturnTypes() { return null; } + /** + * A hack to allow scalar values in a find() query + */ + protected boolean hasScalarValues() { + return false; + } /** *************** *** 116,121 **** String[][] names = null; ! final Type[] returnTypes = getReturnTypes(); ! if ( returnTypes!=null ) { names = QueryTranslator.generateColumnNames( returnTypes, session.getFactory() ); } --- 124,131 ---- String[][] names = null; ! Type[] returnTypes = null; ! final boolean scalars = hasScalarValues(); ! if (scalars) { ! returnTypes = getReturnTypes(); names = QueryTranslator.generateColumnNames( returnTypes, session.getFactory() ); } *************** *** 161,168 **** } ! if (returnTypes==null) { ! results.add( ( cols==1 ) ? row[0] : row ); - } else { --- 171,177 ---- } ! if (!scalars) { ! //hacky!! results.add( ( cols==1 ) ? row[0] : row ); } else { |