/** * INTERNAL: * Convenience method for project mapping. */ public void setJoinedAttributeExpressions(List expressions) { if (((expressions != null) && !expressions.isEmpty()) || hasJoining()) { getJoinedAttributeManager().setJoinedAttributeExpressions_(expressions); } }
/** * INTERNAL: * Convenience method for project mapping. */ public void setJoinedAttributeExpressions(List expressions) { if (((expressions != null) && !expressions.isEmpty()) || hasJoining()) { getJoinedAttributeManager().setJoinedAttributeExpressions_(expressions); } }
/** * INTERNAL: * Convience method for project mapping. */ public void setJoinedAttributeExpressions(List expressions) { if (((expressions != null) && !expressions.isEmpty()) || hasJoining()) { getJoinedAttributeManager().setJoinedAttributeExpressions_(expressions); } }
/** * Return an instance of the receivers javaClass. Set the attributes of an instance * from the values stored in the database row. */ public Object buildObject(ObjectLevelReadQuery query, AbstractRecord databaseRow) { // PERF: Avoid lazy init of join manager if no joining. JoinedAttributeManager joinManager = null; if (query.hasJoining()) { joinManager = query.getJoinedAttributeManager(); } return buildObject(query, databaseRow, joinManager); }
/** * PUBLIC: * Return if duplicate rows should be filter when using 1-m joining. */ public boolean shouldFilterDuplicates() { if (hasJoining()) { return getJoinedAttributeManager().shouldFilterDuplicates(); } return true; }
/** * Return an instance of the receivers javaClass. Set the attributes of an instance * from the values stored in the database row. */ public Object buildObject(ObjectLevelReadQuery query, AbstractRecord databaseRow) { // PERF: Avoid lazy init of join manager if no joining. JoinedAttributeManager joinManager = null; if (query.hasJoining()) { joinManager = query.getJoinedAttributeManager(); } return buildObject(query, databaseRow, joinManager); }
/** * Return an instance of the receivers javaClass. Set the attributes of an instance * from the values stored in the database row. */ public Object buildObject(ObjectLevelReadQuery query, AbstractRecord databaseRow) throws DatabaseException, QueryException { // PERF: Avoid lazy init of join manager if no joining. JoinedAttributeManager joinManager = null; if (query.hasJoining()) { joinManager = query.getJoinedAttributeManager(); } return buildObject(query, databaseRow, joinManager); }
/** * PUBLIC: * Return if duplicate rows should be filter when using 1-m joining. */ public boolean shouldFilterDuplicates() { if (hasJoining()) { return getJoinedAttributeManager().shouldFilterDuplicates(); } return true; }
/** * PUBLIC: * Return if duplicate rows should be filter when using 1-m joining. */ public boolean shouldFilterDuplicates() { if (hasJoining()) { return getJoinedAttributeManager().shouldFilterDuplicates(); } return true; }
/** * Prepare the joining indexes if joining. */ protected void prepareJoining(ObjectLevelReadQuery query) { if (query.hasJoining()) { query.getJoinedAttributeManager().computeJoiningMappingIndexes(true, getSession(), 0); } }
/** * Prepare the joining indexes if joining. */ protected void prepareJoining(ObjectLevelReadQuery query) { if (query.hasJoining()) { query.getJoinedAttributeManager().computeJoiningMappingIndexes(true, getSession(), 0); } }
/** * PUBLIC: * Release all objects read in so far. * This should be performed when reading in a large collection of * objects in order to preserve memory. */ public void clear() { // If using 1-m joining need to release 1-m rows as well. if ((this.query != null) && this.query.isObjectLevelReadQuery() && ((ObjectLevelReadQuery)this.query).hasJoining()) { ((ObjectLevelReadQuery)this.query).getJoinedAttributeManager().clearDataResults(); } } }
/** * PUBLIC: * Release all objects read in so far. * This should be performed when reading in a large collection of * objects in order to preserve memory. */ public void clear() { // If using 1-m joining need to release 1-m rows as well. if ((this.query != null) && this.query.isObjectLevelReadQuery() && ((ObjectLevelReadQuery)this.query).hasJoining()) { ((ObjectLevelReadQuery)this.query).getJoinedAttributeManager().clearDataResults(); } } }
/** * Prepare the joining indexes if joining. */ protected void prepareJoining(ObjectLevelReadQuery query) { if (query.hasJoining()) { query.getJoinedAttributeManager().computeJoiningMappingIndexes(true, getSession(), 0); } }
/** * INTERNAL: * If changes are made to the query that affect the derived SQL or Call * parameters the query needs to be prepared again. * <p> * Automatically called internally. * <p> * The early phase of preparation is to check if this is a pessimistic * locking query. */ public void setIsPrePrepared(boolean isPrePrepared) { // Only unprepare if was prepared to begin with, prevent unpreparing during prepare. if (this.isPrePrepared && !isPrePrepared) { setIsPrepared(false); if (hasJoining()) { getJoinedAttributeManager().reset(); } } this.isPrePrepared = isPrePrepared; }
/** * INTERNAL: * Prepare the receiver for execution in a session. */ protected void prepare() throws QueryException { super.prepare(); prepareQuery(); if (hasJoining()) { getJoinedAttributeManager().computeJoiningMappingQueries(session); } }
/** * INTERNAL: * Prepare the receiver for execution in a session. */ @Override protected void prepare() throws QueryException { super.prepare(); prepareQuery(); if (hasJoining()) { this.joinedAttributeManager.computeJoiningMappingQueries(session); } computeBatchReadMappingQueries(); if (getLoadGroup() != null) { if (getLoadGroup().getIsConcurrent() == null) { getLoadGroup().setIsConcurrent(getSession().isConcurrent()); } } }
/** * INTERNAL: * Prepare the receiver for execution in a session. */ @Override protected void prepare() throws QueryException { super.prepare(); prepareQuery(); if (hasJoining()) { this.joinedAttributeManager.computeJoiningMappingQueries(session); } computeBatchReadMappingQueries(); if (getLoadGroup() != null) { if (getLoadGroup().getIsConcurrent() == null) { getLoadGroup().setIsConcurrent(getSession().isConcurrent()); } } }
/** * INTERNAL: * Indicates whether the query can use ResultSet optimization. * The method is called when the query is prepared, * so it should refer only to the attributes that cannot be altered without re-preparing the query. * If the query is a clone and the original has been already prepared * this method will be called to set a (transient and therefore set to null) usesResultSetAccessOptimization attribute. */ public boolean supportsResultSetAccessOptimizationOnPrepare() { DatabaseCall call = getCall(); return ((call != null) && call.getReturnsResultSet()) && // must return ResultSet (!hasJoining() || !this.joinedAttributeManager.isToManyJoin()) && (!this.descriptor.hasInheritance() || !this.descriptor.getInheritancePolicy().hasClassExtractor() && // ClassExtractor requires the whole row (shouldOuterJoinSubclasses() || !this.descriptor.getInheritancePolicy().requiresMultipleTableSubclassRead() || this.descriptor.getInheritancePolicy().hasView())) && // don't know how to handle select class type call - ResultSet optimization breaks it. (this.batchFetchPolicy == null || !this.batchFetchPolicy.isIN()); // batchFetchPolicy.isIN() requires all rows up front - can't support it }
/** * INTERNAL: * Indicates whether the query can use ResultSet optimization. * The method is called when the query is prepared, * so it should refer only to the attributes that cannot be altered without re-preparing the query. * If the query is a clone and the original has been already prepared * this method will be called to set a (transient and therefore set to null) usesResultSetAccessOptimization attribute. */ public boolean supportsResultSetAccessOptimizationOnPrepare() { DatabaseCall call = getCall(); return ((call != null) && call.getReturnsResultSet()) && // must return ResultSet (!hasJoining() || !this.joinedAttributeManager.isToManyJoin()) && (!this.descriptor.hasInheritance() || !this.descriptor.getInheritancePolicy().hasClassExtractor() && // ClassExtractor requires the whole row (shouldOuterJoinSubclasses() || !this.descriptor.getInheritancePolicy().requiresMultipleTableSubclassRead() || this.descriptor.getInheritancePolicy().hasView())) && // don't know how to handle select class type call - ResultSet optimization breaks it. (this.batchFetchPolicy == null || !this.batchFetchPolicy.isIN()); // batchFetchPolicy.isIN() requires all rows up front - can't support it }