/** * Read and return the next SqlRow. */ public SqlRow createNewRow(String dbTrueValue) throws SQLException { SqlRow sqlRow = new DefaultSqlRow(estimateCapacity, 0.75f, dbTrueValue); int index = 0; for (String propertyName : propertyNames) { index++; Object value = resultSet.getObject(index); sqlRow.set(propertyName, value); } return sqlRow; }
/** * Read the row from the ResultSet and return as a MapBean. */ protected SqlRow readRow(RelationalQueryRequest request, ResultSet rset, String[] propNames, int initialCapacity) throws SQLException { // by default a map will rehash on the 12th entry // it will be pretty common to have 12 or more entries so // to reduce rehashing I am trying to estimate a good // initial capacity for the MapBean to use. SqlRow bean = new DefaultSqlRow(initialCapacity, 0.75f, dbTrueValue); int index = 0; for (int i = 0; i < propNames.length; i++) { index++; Object value = rset.getObject(index); bean.set(propNames[i], value); } return bean; }
/** * Read the row from the ResultSet and return as a MapBean. */ protected SqlRow readRow(RelationalQueryRequest request, ResultSet rset, String[] propNames, int initialCapacity) throws SQLException { // by default a map will rehash on the 12th entry // it will be pretty common to have 12 or more entries so // to reduce rehashing I am trying to estimate a good // initial capacity for the MapBean to use. SqlRow bean = new DefaultSqlRow(initialCapacity, 0.75f, dbTrueValue); int index = 0; for (int i = 0; i < propNames.length; i++) { index++; Object value = rset.getObject(index); bean.set(propNames[i], value); } return bean; }