/** * INTERNAL: * Build and return a new instance of the specified attribute. * This will be populated by a merge. */ protected Object buildNewMergeInstanceOf(Object sourceAttributeValue, AbstractSession session) { return getObjectBuilder(sourceAttributeValue, session).buildNewInstance(); }
/** * INTERNAL: * Build and return a backup clone of the attribute. */ protected Object buildBackupClonePart(Object attributeValue, UnitOfWorkImpl unitOfWork) { if (attributeValue == null) { return null; } return getObjectBuilder(attributeValue, unitOfWork).buildBackupClone(attributeValue, unitOfWork); }
/** * INTERNAL: * Build and return a backup clone of the attribute. */ protected Object buildBackupClonePart(Object attributeValue, UnitOfWorkImpl unitOfWork) { if (attributeValue == null) { return null; } return getObjectBuilder(attributeValue, unitOfWork).buildBackupClone(attributeValue, unitOfWork); }
/** * INTERNAL: * Build and return a new instance of the specified attribute. * This will be populated by a merge. */ protected Object buildNewMergeInstanceOf(Object sourceAttributeValue, AbstractSession session) { return getObjectBuilder(sourceAttributeValue, session).buildNewInstance(); }
/** * INTERNAL: * Build and return a backup clone of the attribute. */ protected Object buildBackupClonePart(Object attributeValue, UnitOfWorkImpl unitOfWork) { if (attributeValue == null) { return null; } return getObjectBuilder(attributeValue, unitOfWork).buildBackupClone(attributeValue, unitOfWork); }
/** * INTERNAL: * Build and return a new instance of the specified attribute. * This will be populated by a merge. */ protected Object buildNewMergeInstanceOf(Object sourceAttributeValue, AbstractSession session) { return getObjectBuilder(sourceAttributeValue, session).buildNewInstance(); }
/** * INTERNAL: * Compare the attributes. Return true if they are alike. */ protected boolean compareAttributeValues(Object attributeValue1, Object attributeValue2, AbstractSession session) { if ((attributeValue1 == null) && (attributeValue2 == null)) { return true; } if ((attributeValue1 == null) || (attributeValue2 == null)) { return false; } if (attributeValue1.getClass() != attributeValue2.getClass()) { return false; } return getObjectBuilder(attributeValue1, session).compareObjects(attributeValue1, attributeValue2, session); }
/** * INTERNAL: * Compare the attributes. Return true if they are alike. */ protected boolean compareAttributeValues(Object attributeValue1, Object attributeValue2, AbstractSession session) { if ((attributeValue1 == null) && (attributeValue2 == null)) { return true; } if ((attributeValue1 == null) || (attributeValue2 == null)) { return false; } if (attributeValue1.getClass() != attributeValue2.getClass()) { return false; } return getObjectBuilder(attributeValue1, session).compareObjects(attributeValue1, attributeValue2, session); }
/** * INTERNAL: * Compare the attributes. Return true if they are alike. */ protected boolean compareAttributeValues(Object attributeValue1, Object attributeValue2, AbstractSession session) { if ((attributeValue1 == null) && (attributeValue2 == null)) { return true; } if ((attributeValue1 == null) || (attributeValue2 == null)) { return false; } if (attributeValue1.getClass() != attributeValue2.getClass()) { return false; } return getObjectBuilder(attributeValue1, session).compareObjects(attributeValue1, attributeValue2, session); }
/** * Copy of the attribute of the object. * This is NOT used for unit of work but for templatizing an object. */ protected Object buildCopyOfAttributeValue(Object attributeValue, CopyGroup group) { if (attributeValue == null) { return null; } return getObjectBuilder(attributeValue, group.getSession()).copyObject(attributeValue, group); }
/** * Copy of the attribute of the object. * This is NOT used for unit of work but for templatizing an object. */ protected Object buildCopyOfAttributeValue(Object attributeValue, CopyGroup group) { if (attributeValue == null) { return null; } return getObjectBuilder(attributeValue, group.getSession()).copyObject(attributeValue, group); }
/** * Copy of the attribute of the object. * This is NOT used for unit of work but for templatizing an object. */ protected Object buildCopyOfAttributeValue(Object attributeValue, ObjectCopyingPolicy policy) { if (attributeValue == null) { return null; } return getObjectBuilder(attributeValue, policy.getSession()).copyObject(attributeValue, policy); }
/** * INTERNAL: * An object has been serialized from the server to the remote client. * Replace the transient attributes of the remote value holders * with client-side objects. */ protected void fixAttributeValue(Object attributeValue, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, RemoteSession session) { if (attributeValue == null) { return; } getObjectBuilder(attributeValue, query.getSession()).fixObjectReferences(attributeValue, objectDescriptors, processedObjects, query, session); }
/** * INTERNAL: * An object has been serialized from the server to the remote client. * Replace the transient attributes of the remote value holders * with client-side objects. */ protected void fixAttributeValue(Object attributeValue, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, DistributedSession session) { if (attributeValue == null) { return; } getObjectBuilder(attributeValue, query.getSession()).fixObjectReferences(attributeValue, objectDescriptors, processedObjects, query, session); }
/** * Force instantiation of all indirections. */ @Override public void loadAll(Object object, AbstractSession session, IdentityHashSet loaded) { Object value = getAttributeValueFromObject(object); if (value != null) { getObjectBuilder(value, session).loadAll(value, session); } }
/** * INTERNAL: * An object has been serialized from the server to the remote client. * Replace the transient attributes of the remote value holders * with client-side objects. */ protected void fixAttributeValue(Object attributeValue, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, DistributedSession session) { if (attributeValue == null) { return; } getObjectBuilder(attributeValue, query.getSession()).fixObjectReferences(attributeValue, objectDescriptors, processedObjects, query, session); }
/** * Force instantiation of all indirections. */ @Override public void loadAll(Object object, AbstractSession session, IdentityHashSet loaded) { Object value = getAttributeValueFromObject(object); if (value != null) { getObjectBuilder(value, session).loadAll(value, session); } }
/** * Force instantiation of the load group. */ @Override public void load(final Object object, AttributeItem item, final AbstractSession session, final boolean fromFetchGroup) { if (item.getGroup() != null) { Object value = getAttributeValueFromObject(object); if (value != null) { getObjectBuilder(value, session).load(value, item.getGroup(), session, fromFetchGroup); } } }
/** * Force instantiation of the load group. */ @Override public void load(final Object object, AttributeItem item, final AbstractSession session, final boolean fromFetchGroup) { if (item.getGroup() != null) { Object value = getAttributeValueFromObject(object); if (value != null) { getObjectBuilder(value, session).load(value, item.getGroup(), session, fromFetchGroup); } } }
/** * Initialize the aggregate query with the settings from the source query. */ protected void buildAggregateModifyQuery(ObjectLevelModifyQuery sourceQuery, ObjectLevelModifyQuery aggregateQuery, Object sourceAttributeValue) { // If we are map key mapping we can't build a backupAttributeValue // from a back up clone since a map key mapping does not map a field // on the source queries backup clone. if (sourceQuery.getSession().isUnitOfWork() && ! isMapKeyMapping()) { Object backupAttributeValue = getAttributeValueFromBackupClone(sourceQuery.getBackupClone()); if (backupAttributeValue == null) { backupAttributeValue = getObjectBuilder(sourceAttributeValue, sourceQuery.getSession()).buildNewInstance(); } aggregateQuery.setBackupClone(backupAttributeValue); } aggregateQuery.setCascadePolicy(sourceQuery.getCascadePolicy()); aggregateQuery.setObject(sourceAttributeValue); aggregateQuery.setTranslationRow(sourceQuery.getTranslationRow()); aggregateQuery.setSession(sourceQuery.getSession()); aggregateQuery.setProperties(sourceQuery.getProperties()); }