protected Type getKeyType() { return collectionPersister.getKeyType(); }
protected Type getKeyType() { return collectionPersister().getKeyType(); }
@Override public void initialize(Serializable id, SharedSessionContractImplementor session) throws HibernateException { Serializable[] batch = session.getPersistenceContext().getBatchFetchQueue() .getCollectionBatch( collectionPersister(), id, batchSizes[0] ); for ( int i=0; i<batchSizes.length-1; i++) { final int smallBatchSize = batchSizes[i]; if ( batch[smallBatchSize-1]!=null ) { Serializable[] smallBatch = new Serializable[smallBatchSize]; System.arraycopy(batch, 0, smallBatch, 0, smallBatchSize); loaders[i].loadCollectionBatch( session, smallBatch, collectionPersister().getKeyType() ); return; //EARLY EXIT! } } loaders[batchSizes.length-1].loadCollection( session, id, collectionPersister().getKeyType() ); } }
@Override public void initialize(Serializable id, SharedSessionContractImplementor session) throws HibernateException { // first, figure out how many batchable ids we have... final Serializable[] batch = session.getPersistenceContext() .getBatchFetchQueue() .getCollectionBatch( collectionPersister(), id, maxBatchSize ); final int numberOfIds = ArrayHelper.countNonNull( batch ); if ( numberOfIds <= 1 ) { singleKeyLoader.loadCollection( session, id, collectionPersister().getKeyType() ); return; } final Serializable[] idsToLoad = new Serializable[numberOfIds]; System.arraycopy( batch, 0, idsToLoad, 0, numberOfIds ); batchLoader.doBatchedCollectionLoad( session, idsToLoad, collectionPersister().getKeyType() ); } }
@Override public void initialize(Serializable id, SharedSessionContractImplementor session) throws HibernateException { final Serializable[] batch = session.getPersistenceContext() .getBatchFetchQueue() .getCollectionBatch( collectionPersister(), id, batchSizes[0] ); final int numberOfIds = ArrayHelper.countNonNull( batch ); if ( numberOfIds <= 1 ) { loaders[batchSizes.length-1].loadCollection( session, id, collectionPersister().getKeyType() ); return; } // Uses the first batch-size bigger than the number of actual ids in the batch int indexToUse = batchSizes.length-1; for ( int i = 0; i < batchSizes.length-1; i++ ) { if ( batchSizes[i] >= numberOfIds ) { indexToUse = i; } else { break; } } final Serializable[] idsToLoad = new Serializable[ batchSizes[indexToUse] ]; System.arraycopy( batch, 0, idsToLoad, 0, numberOfIds ); for ( int i = numberOfIds; i < batchSizes[indexToUse]; i++ ) { idsToLoad[i] = id; } loaders[indexToUse].loadCollectionBatch( session, idsToLoad, collectionPersister().getKeyType() ); } }
public CollectionElementLoader( QueryableCollection collectionPersister, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) throws MappingException { super( factory, loadQueryInfluencers ); this.keyType = collectionPersister.getKeyType(); this.indexType = collectionPersister.getIndexType(); this.persister = (OuterJoinLoadable) collectionPersister.getElementPersister(); this.entityName = persister.getEntityName(); JoinWalker walker = new EntityJoinWalker( persister, ArrayHelper.join( collectionPersister.getKeyColumnNames(), collectionPersister.toColumns( "index" ) ), 1, LockMode.NONE, factory, loadQueryInfluencers ); initFromWalker( walker ); postInstantiate(); if ( LOG.isDebugEnabled() ) { LOG.debugf( "Static select for entity %s: %s", entityName, getSQLString() ); } }
.getKeyType(); final ParameterNode collectionFilterKeyParameter = (ParameterNode) astFactory.create( PARAM, "?" ); final CollectionFilterKeyParameterSpecification collectionFilterKeyParameterSpec = new CollectionFilterKeyParameterSpecification(
Type collectionFilterKeyType = hqlSqlWalker.getSessionFactoryHelper() .requireQueryableCollection( hqlSqlWalker.getCollectionFilterRole() ) .getKeyType(); CollectionFilterKeyParameterSpecification paramSpec = new CollectionFilterKeyParameterSpecification( hqlSqlWalker.getCollectionFilterRole(),
try { final QueryParameters qp = new QueryParameters(); qp.setPositionalParameterTypes( new Type[]{ collectionPersister.getKeyType() } ); qp.setPositionalParameterValues( ids ); qp.setCollectionKeys( ids );
protected Type getKeyType() { return collectionPersister.getKeyType(); }
protected Type getKeyType() { return collectionPersister.getKeyType(); }
protected Type getKeyType() { return collectionPersister.getKeyType(); }
protected Type getKeyType() { return oneToManyPersister.getKeyType(); }
protected Type getKeyType() { return collectionPersister.getKeyType(); }
keyColumnMapping = new HashMap<>(indexColumnNames.length); keyColumnTypes = new HashMap<>(indexColumnNames.length); if (queryableCollection.getKeyType().isEntityType()) { throw new IllegalArgumentException("Determining the join table key foreign key mappings is not yet supported!"); } else {
public CollectionElementLoader( QueryableCollection collectionPersister, SessionFactoryImplementor factory, Map enabledFilters) throws MappingException { super(factory, enabledFilters); this.keyType = collectionPersister.getKeyType(); this.indexType = collectionPersister.getIndexType(); this.persister = (OuterJoinLoadable) collectionPersister.getElementPersister(); this.entityName = persister.getEntityName(); JoinWalker walker = new EntityJoinWalker( persister, ArrayHelper.join( collectionPersister.getKeyColumnNames(), collectionPersister.getIndexColumnNames() ), 1, LockMode.NONE, factory, enabledFilters ); initFromWalker( walker ); postInstantiate(); log.debug( "Static select for entity " + entityName + ": " + getSQLString() ); }
public CollectionElementLoader( QueryableCollection collectionPersister, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) throws MappingException { super( factory, loadQueryInfluencers ); this.keyType = collectionPersister.getKeyType(); this.indexType = collectionPersister.getIndexType(); this.persister = (OuterJoinLoadable) collectionPersister.getElementPersister(); this.entityName = persister.getEntityName(); JoinWalker walker = new EntityJoinWalker( persister, ArrayHelper.join( collectionPersister.getKeyColumnNames(), collectionPersister.getIndexColumnNames() ), 1, LockMode.NONE, factory, loadQueryInfluencers ); initFromWalker( walker ); postInstantiate(); if ( LOG.isDebugEnabled() ) { LOG.debugf( "Static select for entity %s: %s", entityName, getSQLString() ); } }
public CollectionElementLoader( QueryableCollection collectionPersister, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) throws MappingException { super( factory, loadQueryInfluencers ); this.keyType = collectionPersister.getKeyType(); this.indexType = collectionPersister.getIndexType(); this.persister = (OuterJoinLoadable) collectionPersister.getElementPersister(); this.entityName = persister.getEntityName(); JoinWalker walker = new EntityJoinWalker( persister, ArrayHelper.join( collectionPersister.getKeyColumnNames(), collectionPersister.getIndexColumnNames() ), 1, LockMode.NONE, factory, loadQueryInfluencers ); initFromWalker( walker ); postInstantiate(); if ( LOG.isDebugEnabled() ) { LOG.debugf( "Static select for entity %s: %s", entityName, getSQLString() ); } }
Type collectionFilterKeyType = sessionFactoryHelper.requireQueryableCollection( collectionFilterRole ).getKeyType(); ParameterNode collectionFilterKeyParameter = ( ParameterNode ) astFactory.create( PARAM, "?" ); CollectionFilterKeyParameterSpecification collectionFilterKeyParameterSpec = new CollectionFilterKeyParameterSpecification(
Type collectionFilterKeyType = sessionFactoryHelper.requireQueryableCollection( collectionFilterRole ).getKeyType(); ParameterNode collectionFilterKeyParameter = ( ParameterNode ) astFactory.create( PARAM, "?" ); CollectionFilterKeyParameterSpecification collectionFilterKeyParameterSpec = new CollectionFilterKeyParameterSpecification(