/** * INTERNAL: * Helper method that records clone with uow if query is pessimistic locking. */ public void recordCloneForPessimisticLocking(Object clone, UnitOfWorkImpl uow) { if ((isLockQuery()) && lockingClause.isReferenceClassLocked()) { uow.addPessimisticLockedClone(clone); } }
/** * INTERNAL: * Answers if we are executing through a UnitOfWork and registering results. * This is only ever false if using the conforming without registering * feature. */ public boolean isRegisteringResults() { return ((shouldRegisterResultsInUnitOfWork() && this.descriptor.shouldRegisterResultsInUnitOfWork()) || isLockQuery()); }
/** * INTERNAL: * Indicates whether the source query's pessimistic lock scope scope should be extended in the target query. */ protected boolean isExtendingPessimisticLockScope(ObjectBuildingQuery sourceQuery) { // TODO: What if sourceQuery is NOT ObjectLevelReadQuery? Should we somehow handle this? // Or alternatively define ObjectBuildingQuery.shouldExtendPessimisticLockScope() to always return false? return sourceQuery.isLockQuery() && sourceQuery.isObjectLevelReadQuery() && ((ObjectLevelReadQuery)sourceQuery).shouldExtendPessimisticLockScope(); }
/** * INTERNAL: * Indicates whether the source query's pessimistic lock scope scope should be extended in the target query. */ protected boolean isExtendingPessimisticLockScope(ObjectBuildingQuery sourceQuery) { // TODO: What if sourceQuery is NOT ObjectLevelReadQuery? Should we somehow handle this? // Or alternatively define ObjectBuildingQuery.shouldExtendPessimisticLockScope() to always return false? return sourceQuery.isLockQuery() && sourceQuery.isObjectLevelReadQuery() && ((ObjectLevelReadQuery)sourceQuery).shouldExtendPessimisticLockScope(); }
/** * INTERNAL: * Answers if we are executing through a UnitOfWork and registering results. * This is only ever false if using the conforming without registering * feature. */ public boolean isRegisteringResults() { return ((shouldRegisterResultsInUnitOfWork() && this.descriptor.shouldRegisterResultsInUnitOfWork()) || isLockQuery()); }
/** * INTERNAL: * Answers if we are executing through a UnitOfWork and registering results. * This is only ever false if using the conforming without registering * feature. */ protected boolean isRegisteringResults() { return ((shouldRegisterResultsInUnitOfWork() && this.descriptor.shouldRegisterResultsInUnitOfWork()) || isLockQuery()); }
/** * INTERNAL: * Helper method that records clone with uow if query is pessimistic locking. */ public void recordCloneForPessimisticLocking(Object clone, UnitOfWorkImpl uow) { if ((isLockQuery()) && lockingClause.isReferenceClassLocked()) { uow.addPessimisticLockedClone(clone); } }
/** * INTERNAL: * Indicates whether the source query's pessimistic lock scope scope should be extended in the target query. */ protected boolean isExtendingPessimisticLockScope(ObjectBuildingQuery sourceQuery) { // TODO: What if sourceQuery is NOT ObjectLevelReadQuery? Should we somehow handle this? // Or alternatively define ObjectBuildingQuery.shouldExtendPessimisticLockScope() to always return false? return sourceQuery.isLockQuery() && sourceQuery.isObjectLevelReadQuery() && ((ObjectLevelReadQuery)sourceQuery).shouldExtendPessimisticLockScope(); }
/** * INTERNAL: * Helper method that records clone with uow if query is pessimistic locking. */ public void recordCloneForPessimisticLocking(Object clone, UnitOfWorkImpl uow) { if ((isLockQuery()) && lockingClause.isReferenceClassLocked()) { uow.addPessimisticLockedClone(clone); } }
if (baseQuery.isLockQuery()) { if (((ObjectLevelReadQuery)baseQuery).getLockingClause().isForUpdateOfClause()) { ForUpdateOfClause clause = (ForUpdateOfClause)((ObjectLevelReadQuery)baseQuery).getLockingClause().clone();
boolean isARefresh = query.shouldRefreshIdentityMapResult() || (query.isLockQuery() && (!wasAClone || !query.isClonePessimisticLocked(workingClone, unitOfWork)));
boolean isARefresh = query.shouldRefreshIdentityMapResult() || (query.isLockQuery() && (!wasAClone || !query.isClonePessimisticLocked(workingClone, unitOfWork))); boolean isUnionFetchGroups = false;
boolean isARefresh = query.shouldRefreshIdentityMapResult() || (query.isLockQuery() && (!wasAClone || !query.isClonePessimisticLocked(workingClone, unitOfWork)));
if (baseQuery.isLockQuery()) { if (((ObjectLevelReadQuery)baseQuery).getLockingClause().isForUpdateOfClause()) { ForUpdateOfClause clause = (ForUpdateOfClause)((ObjectLevelReadQuery)baseQuery).getLockingClause().clone();
if (baseQuery.isLockQuery()) { if (((ObjectLevelReadQuery)baseQuery).getLockingClause().isForUpdateOfClause()) { ForUpdateOfClause clause = (ForUpdateOfClause)((ObjectLevelReadQuery)baseQuery).getLockingClause().clone();