/** * Extract primary key attribute values from the domainObject. */ @Override public Object extractPrimaryKeyFromObject(Object domainObject, AbstractSession session) { return extractPrimaryKeyFromObject(domainObject, session, false); }
/** * Extract primary key attribute values from the domainObject. */ @Override public Object extractPrimaryKeyFromObject(Object domainObject, AbstractSession session) { return extractPrimaryKeyFromObject(domainObject, session, false); }
/** * INTERNAL: * Creates the Array of simple types used to recreate this map. */ public Object createSerializableMapKeyInfo(Object key, AbstractSession session){ return referenceDescriptor.getObjectBuilder().extractPrimaryKeyFromObject(key, session); }
/** * INTERNAL: * Creates the Array of simple types used to recreate this map. */ public Object createSerializableMapKeyInfo(Object key, AbstractSession session){ return referenceDescriptor.getObjectBuilder().extractPrimaryKeyFromObject(key, session); }
/** * Build the primary key expression from the specified domain object. */ public Expression buildPrimaryKeyExpressionFromObject(Object domainObject, AbstractSession session) { return buildPrimaryKeyExpressionFromKeys(extractPrimaryKeyFromObject(domainObject, session), session); }
/** * Build the primary key expression from the specified domain object. */ public Expression buildPrimaryKeyExpressionFromObject(Object domainObject, AbstractSession session) { return buildPrimaryKeyExpressionFromKeys(extractPrimaryKeyFromObject(domainObject, session), session); }
/** * Build the primary key expression from the specified domain object. */ public Expression buildPrimaryKeyExpressionFromObject(Object domainObject, AbstractSession session) { return buildPrimaryKeyExpressionFromKeys(extractPrimaryKeyFromObject(domainObject, session), session); }
/** * INTERNAL: * For use within the merge process this method will get an object from the shared * cache using a readlock. If a readlock is unavailable then the merge manager will be * transitioned to deferred locks and a deferred lock will be used. */ @Override protected CacheKey getCacheKeyFromTargetSessionForMerge(Object implementation, ObjectBuilder builder, ClassDescriptor descriptor, MergeManager mergeManager){ Object primaryKey = builder.extractPrimaryKeyFromObject(implementation, this, true); CacheKey cacheKey = getIdentityMapAccessorInstance().getCacheKeyForObject(primaryKey, implementation.getClass(), descriptor, true); return cacheKey; }
/** * INTERNAL: * For use within the merge process this method will get an object from the shared * cache using a readlock. If a readlock is unavailable then the merge manager will be * transitioned to deferred locks and a deferred lock will be used. */ @Override protected CacheKey getCacheKeyFromTargetSessionForMerge(Object implementation, ObjectBuilder builder, ClassDescriptor descriptor, MergeManager mergeManager){ Object primaryKey = builder.extractPrimaryKeyFromObject(implementation, this, true); CacheKey cacheKey = getIdentityMapAccessorInstance().getCacheKeyForObject(primaryKey, implementation.getClass(), descriptor, true); return cacheKey; }
/** * INTERNAL: */ protected Object getPrimaryKeyForObject(Object object, AbstractSession session) { return getReferenceDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(object, session); }
/** * INTERNAL: */ protected Object getPrimaryKeyForObject(Object object, AbstractSession session) { return getReferenceDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(object, session); }
/** * INTERNAL: */ protected Vector getPrimaryKeyForObject(Object object, AbstractSession session) { return getReferenceDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(object, session); }
/** * Get the object from the identity map which has the same identity information * as the given object. */ public Object getFromIdentityMap(Object object) { ClassDescriptor descriptor = this.session.getDescriptor(object); Object primaryKey = descriptor.getObjectBuilder().extractPrimaryKeyFromObject(object, this.session); return getFromIdentityMap(primaryKey, object.getClass(), descriptor); }
@Override public Object extractPrimaryKeyFromObject(Object domainObject, AbstractSession session) { if (getDescriptor().hasInheritance() && (domainObject.getClass() != getDescriptor().getJavaClass()) && (!domainObject.getClass().getSuperclass().equals(getDescriptor().getJavaClass()))) { return session.getDescriptor(domainObject.getClass()).getObjectBuilder().extractPrimaryKeyFromObject(domainObject, session); } List<DatabaseField> descriptorPrimaryKeyFields = getDescriptor().getPrimaryKeyFields(); if (null == descriptorPrimaryKeyFields || descriptorPrimaryKeyFields.size() == 0) { return null; } return super.extractPrimaryKeyFromObject(domainObject, session); }
public Vector extractPrimaryKeyFromObject(Object domainObject, AbstractSession session) { if (getDescriptor().hasInheritance() && (domainObject.getClass() != getDescriptor().getJavaClass()) && (!domainObject.getClass().getSuperclass().equals(getDescriptor().getJavaClass()))) { return session.getDescriptor(domainObject.getClass()).getObjectBuilder().extractPrimaryKeyFromObject(domainObject, session); } if (getDescriptor().getPrimaryKeyFields().size() == 0) { return null; } return super.extractPrimaryKeyFromObject(domainObject, session); }
/** * INTERNAL: * Extract the reference pk for rvh usage in remote model. */ public Vector extractPrimaryKeysFromRealReferenceObject(Object object, AbstractSession session) { if (object == null) { return new Vector(1); } else { Object implementation = getReferenceDescriptor().getObjectBuilder().unwrapObject(object, session); return getReferenceDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(implementation, session); } }
/** * Get the object from the identity map which has the same identity information * as the given object. */ public Object getFromIdentityMap(Object object) { ClassDescriptor descriptor = getSession().getDescriptor(object); Vector primaryKey = descriptor.getObjectBuilder().extractPrimaryKeyFromObject(object, getSession()); return getFromIdentityMap(primaryKey, object.getClass(), descriptor); }
public void iterate(Object object) { if (!containsObjectInIdentityMap(IdentityMapAccessor.this.session.getDescriptor(object.getClass()).getObjectBuilder().extractPrimaryKeyFromObject(object, IdentityMapAccessor.this.getSession()), object.getClass())) { IdentityMapAccessor.this.session.log(SessionLog.FINEST, SessionLog.CACHE, "stack_of_visited_objects_that_refer_to_the_corrupt_object", getVisitedStack()); IdentityMapAccessor.this.session.log(SessionLog.FINER, SessionLog.CACHE, "corrupt_object_referenced_through_mapping", getCurrentMapping()); IdentityMapAccessor.this.session.log(SessionLog.FINER, SessionLog.CACHE, "corrupt_object", object); } } };
public void iterate(Object object) { if (!containsObjectInIdentityMap(IdentityMapAccessor.this.session.getDescriptor(object.getClass()).getObjectBuilder().extractPrimaryKeyFromObject(object, IdentityMapAccessor.this.getSession()), object.getClass())) { IdentityMapAccessor.this.session.log(SessionLog.FINEST, SessionLog.CACHE, "stack_of_visited_objects_that_refer_to_the_corrupt_object", getVisitedStack()); IdentityMapAccessor.this.session.log(SessionLog.FINER, SessionLog.CACHE, "corrupt_object_referenced_through_mapping", getCurrentMapping()); IdentityMapAccessor.this.session.log(SessionLog.FINER, SessionLog.CACHE, "corrupt_object", object); } } };
/** * INTERNAL: * Extract the reference pk for rvh usage in remote model. */ public Object extractPrimaryKeysFromRealReferenceObject(Object object, AbstractSession session) { if (object == null) { return null; } else { Object implementation = getReferenceDescriptor().getObjectBuilder().unwrapObject(object, session); return getReferenceDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(implementation, session); } }