public static String[] join(String[] x, String[] y, boolean[] use) { String[] result = new String[x.length + countTrue( use )]; System.arraycopy( x, 0, result, 0, x.length ); int k = x.length; for ( int i = 0; i < y.length; i++ ) { if ( use[i] ) { result[k++] = y[i]; } } return result; }
private CacheableResultTransformer(boolean[] includeInTuple, boolean[] includeInTransform) { if ( includeInTuple == null ) { throw new IllegalArgumentException( "includeInTuple cannot be null" ); } this.includeInTuple = includeInTuple; tupleLength = ArrayHelper.countTrue( includeInTuple ); tupleSubsetLength = ( includeInTransform == null ? tupleLength : ArrayHelper.countTrue( includeInTransform ) ); if ( tupleSubsetLength == tupleLength ) { includeInTransformIndex = null; } else { includeInTransformIndex = new int[tupleSubsetLength]; for ( int i = 0, j = 0 ; i < includeInTransform.length ; i++ ) { if ( includeInTransform[ i ] ) { includeInTransformIndex[ j ] = i; j++; } } } }
/** * Write the element to a JDBC <tt>PreparedStatement</tt> */ protected int writeElement(PreparedStatement st, Object elt, int i, SharedSessionContractImplementor session) throws HibernateException, SQLException { getElementType().nullSafeSet( st, elt, i, elementColumnIsSettable, session ); return i + ArrayHelper.countTrue( elementColumnIsSettable ); }
throw new IllegalArgumentException( "transformer cannot be null" ); int tupleLength = ArrayHelper.countTrue( includeInTuple ); if ( aliases != null && aliases.length != tupleLength ) { throw new IllegalArgumentException(
/** * Write the index to a JDBC <tt>PreparedStatement</tt> */ protected int writeIndex(PreparedStatement st, Object index, int i, SharedSessionContractImplementor session) throws HibernateException, SQLException { getIndexType().nullSafeSet( st, incrementIndexByBase( index ), i, indexColumnIsSettable, session ); return i + ArrayHelper.countTrue( indexColumnIsSettable ); }
System.arraycopy( settable, loc, subsettable, 0, len ); propertyTypes[i].nullSafeSet( st, subvalues[i], begin, subsettable, session ); begin += ArrayHelper.countTrue( subsettable );
&& !lobProperties.contains( i ) ) { getPropertyTypes()[i].nullSafeSet( ps, fields[i], index, includeColumns[i], session ); index += ArrayHelper.countTrue( includeColumns[i] ); //TODO: this is kinda slow... if ( includeProperty[i] && isPropertyOfTable( i, j ) ) { getPropertyTypes()[i].nullSafeSet( ps, fields[i], index, includeColumns[i], session ); index += ArrayHelper.countTrue( includeColumns[i] ); //TODO: this is kinda slow...
public CriteriaLoader( final OuterJoinLoadable persister, final SessionFactoryImplementor factory, final CriteriaImpl criteria, final String rootEntityName, final LoadQueryInfluencers loadQueryInfluencers) throws HibernateException { super( factory, loadQueryInfluencers ); translator = new CriteriaQueryTranslator( factory, criteria, rootEntityName, CriteriaQueryTranslator.ROOT_SQL_ALIAS ); querySpaces = translator.getQuerySpaces(); CriteriaJoinWalker walker = new CriteriaJoinWalker( persister, translator, factory, criteria, rootEntityName, loadQueryInfluencers ); initFromWalker(walker); userAliases = walker.getUserAliases(); resultTypes = walker.getResultTypes(); includeInResultRow = walker.includeInResultRow(); resultRowLength = ArrayHelper.countTrue( includeInResultRow ); postInstantiate(); }
SharedSessionContractImplementor session) { if ( isInverse && hasIndex && !indexContainsFormula && ArrayHelper.countTrue( indexColumnIsSettable ) > 0 ) { try { if ( entries.hasNext() ) {
protected interface InclusionChecker { boolean includeProperty(int propertyNumber); }
public static String[] join(String[] x, String[] y, boolean[] use) { String[] result = new String[ x.length + countTrue(use) ]; System.arraycopy( x, 0, result, 0, x.length ); int k = x.length; for ( int i=0; i<y.length; i++ ) { if ( use[i] ) { result[k++] = y[i]; } } return result; }
public static String[] join(String[] x, String[] y, boolean[] use) { String[] result = new String[ x.length + countTrue(use) ]; System.arraycopy( x, 0, result, 0, x.length ); int k = x.length; for ( int i=0; i<y.length; i++ ) { if ( use[i] ) { result[k++] = y[i]; } } return result; }
public static String[] join(String[] x, String[] y, boolean[] use) { String[] result = new String[x.length + countTrue( use )]; System.arraycopy( x, 0, result, 0, x.length ); int k = x.length; for ( int i = 0; i < y.length; i++ ) { if ( use[i] ) { result[k++] = y[i]; } } return result; }
/** * Write the element to a JDBC <tt>PreparedStatement</tt> */ protected int writeElement(PreparedStatement st, Object elt, int i, SessionImplementor session) throws HibernateException, SQLException { getElementType().nullSafeSet( st, elt, i, elementColumnIsSettable, session ); return i + ArrayHelper.countTrue( elementColumnIsSettable ); }
/** * Write the element to a JDBC <tt>PreparedStatement</tt> */ protected int writeElement(PreparedStatement st, Object elt, int i, SessionImplementor session) throws HibernateException, SQLException { getElementType().nullSafeSet( st, elt, i, elementColumnIsSettable, session ); return i + ArrayHelper.countTrue( elementColumnIsSettable ); }
/** * Write the index to a JDBC <tt>PreparedStatement</tt> */ protected int writeIndex(PreparedStatement st, Object index, int i, SessionImplementor session) throws HibernateException, SQLException { getIndexType().nullSafeSet( st, incrementIndexByBase( index ), i, indexColumnIsSettable, session ); return i + ArrayHelper.countTrue( indexColumnIsSettable ); }
/** * Write the index to a JDBC <tt>PreparedStatement</tt> */ protected int writeIndex(PreparedStatement st, Object index, int i, SessionImplementor session) throws HibernateException, SQLException { getIndexType().nullSafeSet( st, incrementIndexByBase( index ), i, indexColumnIsSettable, session ); return i + ArrayHelper.countTrue( indexColumnIsSettable ); }
protected static interface InclusionChecker { public boolean includeProperty(int propertyNumber); }
protected static interface InclusionChecker { public boolean includeProperty(int propertyNumber); }