/** * Return whether any process leading to object modification * should also affect its parts. * Used by write, insert, update, and delete. */ protected boolean shouldObjectModifyCascadeToParts(ObjectLevelModifyQuery query) { if (isForeignKeyRelationship()) { return super.shouldObjectModifyCascadeToParts(query); } else { if (this.isReadOnly()) { return false; } if (this.isPrivateOwned()) { return true; } return query.shouldCascadeAllParts(); } }
/** * Return whether any process leading to object modification * should also affect its parts. * Used by write, insert, update, and delete. */ @Override protected boolean shouldObjectModifyCascadeToParts(ObjectLevelModifyQuery query) { if (isForeignKeyRelationship()) { return super.shouldObjectModifyCascadeToParts(query); } else { if (this.isReadOnly()) { return false; } if (this.isPrivateOwned()) { return true; } return query.shouldCascadeAllParts(); } }
/** * Return whether any process leading to object modification * should also affect its parts. * Used by write, insert, update, and delete. */ @Override protected boolean shouldObjectModifyCascadeToParts(ObjectLevelModifyQuery query) { if (isForeignKeyRelationship()) { return super.shouldObjectModifyCascadeToParts(query); } else { if (this.isReadOnly()) { return false; } if (this.isPrivateOwned()) { return true; } return query.shouldCascadeAllParts(); } }
/** * INTERNAL: * Used to verify whether the specified object is deleted or not. */ public boolean verifyDelete(Object object, AbstractSession session) throws DatabaseException { if (this.isPrivateOwned()) { Object objects = this.getRealCollectionAttributeValueFromObject(object, session); ContainerPolicy containerPolicy = getContainerPolicy(); for (Object iter = containerPolicy.iteratorFor(objects); containerPolicy.hasNext(iter);) { if (!session.verifyDelete(containerPolicy.next(iter, session))) { return false; } } } return true; }
/** * INTERNAL: * Compare the non-null elements and return true if they are alike. */ public boolean compareElements(Object element1, Object element2, AbstractSession session) { if (!isForeignKeyRelationship()) { return false; } Object primaryKey1 = getReferenceDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(element1, session); Object primaryKey2 = getReferenceDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(element2, session); if (!primaryKey1.equals(primaryKey2)) { return false; } if (this.isPrivateOwned()) { return session.compareObjects(element1, element2); } else { return true; } }
/** * INTERNAL: * Used to verify whether the specified object is deleted or not. */ @Override public boolean verifyDelete(Object object, AbstractSession session) throws DatabaseException { if (this.isPrivateOwned()) { Object objects = this.getRealCollectionAttributeValueFromObject(object, session); ContainerPolicy containerPolicy = getContainerPolicy(); for (Object iter = containerPolicy.iteratorFor(objects); containerPolicy.hasNext(iter);) { if (!session.verifyDelete(containerPolicy.next(iter, session))) { return false; } } } return true; }
/** * INTERNAL: * Compare the non-null elements and return true if they are alike. */ public boolean compareElements(Object element1, Object element2, AbstractSession session) { if (!isForeignKeyRelationship()) { return false; } Object primaryKey1 = getReferenceDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(element1, session); Object primaryKey2 = getReferenceDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(element2, session); if (!primaryKey1.equals(primaryKey2)) { return false; } if (this.isPrivateOwned()) { return session.compareObjects(element1, element2); } else { return true; } }
/** * INTERNAL: * Used to verify whether the specified object is deleted or not. */ @Override public boolean verifyDelete(Object object, AbstractSession session) throws DatabaseException { if (this.isPrivateOwned()) { Object objects = this.getRealCollectionAttributeValueFromObject(object, session); ContainerPolicy containerPolicy = getContainerPolicy(); for (Object iter = containerPolicy.iteratorFor(objects); containerPolicy.hasNext(iter);) { if (!session.verifyDelete(containerPolicy.next(iter, session))) { return false; } } } return true; }
if (!isForeignKeyRelationship) { if (targetQuery.isObjectLevelReadQuery() && (sourceQuery.shouldCascadeAllParts() || (sourceQuery.shouldCascadePrivateParts() && isPrivateOwned()) || (sourceQuery.shouldCascadeByMapping() && this.cascadeRefresh))) { targetQuery = (ObjectLevelReadQuery)targetQuery.clone(); ((ObjectLevelReadQuery)targetQuery).setShouldRefreshIdentityMapResult(sourceQuery.shouldRefreshIdentityMapResult());
/** * INTERNAL: * Compare the non-null elements and return true if they are alike. */ public boolean compareElements(Object element1, Object element2, AbstractSession session) { if (!isForeignKeyRelationship()) { return false; } Vector primaryKey1 = this.getReferenceDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(element1, session); Vector primaryKey2 = this.getReferenceDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(element2, session); CacheKey cacheKey1 = new CacheKey(primaryKey1); CacheKey cacheKey2 = new CacheKey(primaryKey2); if (!cacheKey1.equals(cacheKey2)) { return false; } if (this.isPrivateOwned()) { return session.compareObjects(element1, element2); } else { return true; } }
if (!this.isForeignKeyRelationship) { if (targetQuery.isObjectLevelReadQuery() && (sourceQuery.shouldCascadeAllParts() || (sourceQuery.shouldCascadePrivateParts() && isPrivateOwned()) || (sourceQuery.shouldCascadeByMapping() && this.cascadeRefresh))) { targetQuery = (ObjectLevelReadQuery)targetQuery.clone(); ((ObjectLevelReadQuery)targetQuery).setShouldRefreshIdentityMapResult(sourceQuery.shouldRefreshIdentityMapResult());
if (!this.isForeignKeyRelationship) { if (targetQuery.isObjectLevelReadQuery() && (sourceQuery.shouldCascadeAllParts() || (sourceQuery.shouldCascadePrivateParts() && isPrivateOwned()) || (sourceQuery.shouldCascadeByMapping() && this.cascadeRefresh))) { targetQuery = (ObjectLevelReadQuery)targetQuery.clone(); ((ObjectLevelReadQuery)targetQuery).setShouldRefreshIdentityMapResult(sourceQuery.shouldRefreshIdentityMapResult());
for (Object iter = cp.iteratorFor(objects); cp.hasNext(iter);) { Object object = cp.next(iter, query.getSession()); if (this.isPrivateOwned()) {
for (Object iter = cp.iteratorFor(objects); cp.hasNext(iter);) { Object object = cp.next(iter, query.getSession()); if (this.isPrivateOwned()) {
for (Object iter = cp.iteratorFor(objects); cp.hasNext(iter);) { Object object = cp.next(iter, query.getSession()); if (this.isPrivateOwned()) {
for (Object iter = cp.iteratorFor(objects); cp.hasNext(iter);) { Object object = cp.next(iter, query.getSession()); if (this.isPrivateOwned()) {
for (Object iter = cp.iteratorFor(objects); cp.hasNext(iter);) { Object object = cp.next(iter, query.getSession()); if (this.isPrivateOwned()) {
for (Object iter = cp.iteratorFor(objects); cp.hasNext(iter);) { Object object = cp.next(iter, query.getSession()); if (this.isPrivateOwned()) {