/** * INTERNAL: * Check if the object conforms to the expression in memory. * This is used for in-memory querying across object relationships. */ public boolean doesObjectConform(Object leftValue, Object rightValue, AbstractSession session) { if ((leftValue == null) && (rightValue == null)) { return performSelector(true); } if ((leftValue == null) || (rightValue == null)) { //both are not null. return performSelector(false); } Class javaClass = leftValue.getClass(); if (javaClass != rightValue.getClass()) { return performSelector(false); } ClassDescriptor descriptor = session.getDescriptor(javaClass); // Currently cannot conform aggregate comparisons in-memory. if (descriptor.isAggregateDescriptor()) { throw QueryException.cannotConformExpression(); } Object leftPrimaryKey = descriptor.getObjectBuilder().extractPrimaryKeyFromObject(leftValue, session); Object rightPrimaryKey = descriptor.getObjectBuilder().extractPrimaryKeyFromObject(rightValue, session); return performSelector(leftPrimaryKey.equals(rightPrimaryKey)); }
/** * INTERNAL: * Check if the object conforms to the expression in memory. * This is used for in-memory querying across object relationships. */ public boolean doesObjectConform(Object leftValue, Object rightValue, AbstractSession session) { if ((leftValue == null) && (rightValue == null)) { return performSelector(true); } if ((leftValue == null) || (rightValue == null)) { //both are not null. return performSelector(false); } Class javaClass = leftValue.getClass(); if (javaClass != rightValue.getClass()) { return performSelector(false); } ClassDescriptor descriptor = session.getDescriptor(javaClass); // Currently cannot conform aggregate comparisons in-memory. if (descriptor.isAggregateDescriptor()) { throw QueryException.cannotConformExpression(); } Object leftPrimaryKey = descriptor.getObjectBuilder().extractPrimaryKeyFromObject(leftValue, session); Object rightPrimaryKey = descriptor.getObjectBuilder().extractPrimaryKeyFromObject(rightValue, session); return performSelector(leftPrimaryKey.equals(rightPrimaryKey)); }
return performSelector(true); return performSelector(false); return performSelector(false); leftCacheKey = new org.eclipse.persistence.internal.identitymaps.CacheKey(leftPrimaryKey); return performSelector(rightCacheKey.equals(leftCacheKey));