/** * INTERNAL: * This is used to preserve object identity during a refreshObject() * query. Return the object corresponding to the specified database row. * The default is to simply return the attribute value. */ protected Object getMatchingAttributeValueFromObject(AbstractRecord row, Object targetObject, AbstractSession session, ClassDescriptor descriptor) { return getAttributeValueFromObject(targetObject); }
/** * INTERNAL: * This is used to preserve object identity during a refreshObject() * query. Return the object corresponding to the specified database row. * The default is to simply return the attribute value. */ protected Object getMatchingAttributeValueFromObject(AbstractRecord row, Object targetObject, AbstractSession session, ClassDescriptor descriptor) { return getAttributeValueFromObject(targetObject); }
/** * INTERNAL: * This is used to preserve object identity during a refreshObject() * query. Return the object corresponding to the specified database row. * The default is to simply return the attribute value. */ protected Object getMatchingAttributeValueFromObject(AbstractRecord row, Object targetObject, AbstractSession session, ClassDescriptor descriptor) { return getAttributeValueFromObject(targetObject); }
/** * INTERNAL: * This is used to match up objects during an update in a UOW. * Return the object corresponding to the specified attribute value. * The default is to simply return the backup attribute value. */ protected Object getMatchingBackupAttributeValue(WriteObjectQuery query, Object attributeValue) { return getAttributeValueFromObject(query.getBackupClone()); }
/** * INTERNAL: * This is used to match up objects during an update in a UOW. * Return the object corresponding to the specified attribute value. * The default is to simply return the backup attribute value. */ protected Object getMatchingBackupAttributeValue(WriteObjectQuery query, Object attributeValue) { return getAttributeValueFromObject(query.getBackupClone()); }
/** * INTERNAL: * Get the attribute value from the object and add the appropriate * values to the specified database row. */ @Override public void writeFromObjectIntoRow(Object object, AbstractRecord databaseRow, AbstractSession session, WriteType writeType) throws DescriptorException { if (isReadOnly()) { return; } writeToRowFromAggregate(databaseRow, object, getAttributeValueFromObject(object), session, writeType); }
/** * INTERNAL: * Get the attribute value from the object and add the appropriate * values to the specified database row. */ public void writeFromObjectIntoRow(Object object, AbstractRecord databaseRow, AbstractSession session) throws DescriptorException { if (isReadOnly()) { return; } writeToRowFromAggregate(databaseRow, object, getAttributeValueFromObject(object), session); }
/** * INTERNAL: * Get the attribute value from the object and add the appropriate * values to the specified database row. */ @Override public void writeFromObjectIntoRow(Object object, AbstractRecord databaseRow, AbstractSession session, WriteType writeType) throws DescriptorException { if (isReadOnly()) { return; } writeToRowFromAggregate(databaseRow, object, getAttributeValueFromObject(object), session, writeType); }
/** * INTERNAL: * This row is built for shallow insert which happens in case of bidirectional inserts. */ @Override public void writeFromObjectIntoRowForShallowInsert(Object object, AbstractRecord row, AbstractSession session) { if (isReadOnly()) { return; } writeToRowFromAggregateForShallowInsert(row, object, getAttributeValueFromObject(object), session); }
/** * INTERNAL: * This row is built for shallow insert which happens in case of bidirectional inserts. */ @Override public void writeFromObjectIntoRowForShallowInsert(Object object, AbstractRecord row, AbstractSession session) { if (isReadOnly()) { return; } writeToRowFromAggregateForShallowInsert(row, object, getAttributeValueFromObject(object), session); }
/** * INTERNAL: * Get the attribute value from the object and add the changed * values to the specified database row. */ @Override public void writeFromObjectIntoRowForUpdate(WriteObjectQuery query, AbstractRecord databaseRow) throws DescriptorException { if (isReadOnly()) { return; } writeToRowFromAggregateForUpdate(databaseRow, query, getAttributeValueFromObject(query.getObject())); }
/** * INTERNAL: * Get the attribute value from the object and add the changed * values to the specified database row. */ @Override public void writeFromObjectIntoRowForUpdate(WriteObjectQuery query, AbstractRecord databaseRow) throws DescriptorException { if (isReadOnly()) { return; } writeToRowFromAggregateForUpdate(databaseRow, query, getAttributeValueFromObject(query.getObject())); }
/** * INTERNAL: * Get the attribute value from the object and add the changed * values to the specified database row. */ public void writeFromObjectIntoRowForUpdate(WriteObjectQuery query, AbstractRecord databaseRow) throws DescriptorException { if (isReadOnly()) { return; } writeToRowFromAggregateForUpdate(databaseRow, query, getAttributeValueFromObject(query.getObject())); }
/** * INTERNAL: * Set the change listener in the aggregate. */ @Override public void setChangeListener(Object clone, PropertyChangeListener listener, UnitOfWorkImpl uow) { Object attributeValue = getAttributeValueFromObject(clone); if (attributeValue != null) { ClassDescriptor descriptor = getReferenceDescriptor(attributeValue, uow); descriptor.getObjectChangePolicy().setAggregateChangeListener(clone, attributeValue, uow, descriptor, getAttributeName()); } }
/** * INTERNAL: * Set the change listener in the aggregate. */ @Override public void setChangeListener(Object clone, PropertyChangeListener listener, UnitOfWorkImpl uow) { Object attributeValue = getAttributeValueFromObject(clone); if (attributeValue != null) { ClassDescriptor descriptor = getReferenceDescriptor(attributeValue, uow); descriptor.getObjectChangePolicy().setAggregateChangeListener(clone, attributeValue, uow, descriptor, getAttributeName()); } }
/** * INTERNAL: * Set the change listener in the aggregate. */ public void setChangeListener(Object clone, PropertyChangeListener listener, UnitOfWorkImpl uow) { Object attributeValue = getAttributeValueFromObject(clone); if (attributeValue != null) { ClassDescriptor descriptor = getReferenceDescriptor(attributeValue, uow); descriptor.getObjectChangePolicy().setAggregateChangeListener(clone, attributeValue, uow, descriptor, getAttributeName()); } }
/** * INTERNAL: * This row is built for update after shallow insert which happens in case of bidirectional inserts. * It contains the foreign keys with non null values that were set to null for shallow insert. */ @Override public void writeFromObjectIntoRowForUpdateAfterShallowInsert(Object object, AbstractRecord row, AbstractSession session, DatabaseTable table) { if (isReadOnly() || !getFields().get(0).getTable().equals(table) || isPrimaryKeyMapping()) { return; } writeToRowFromAggregateForUpdateAfterShallowInsert(row, object, getAttributeValueFromObject(object), session, table); }
/** * INTERNAL: * This row is built for update before shallow delete which happens in case of bidirectional inserts. * It contains the same fields as the row built by writeFromObjectIntoRowForUpdateAfterShallowInsert, but all the values are null. */ @Override public void writeFromObjectIntoRowForUpdateBeforeShallowDelete(Object object, AbstractRecord row, AbstractSession session, DatabaseTable table) { if (isReadOnly() || !getFields().get(0).getTable().equals(table) || isPrimaryKeyMapping()) { return; } writeToRowFromAggregateForUpdateBeforeShallowDelete(row, object, getAttributeValueFromObject(object), session, table); }
/** * INTERNAL: * This row is built for update after shallow insert which happens in case of bidirectional inserts. * It contains the foreign keys with non null values that were set to null for shallow insert. */ @Override public void writeFromObjectIntoRowForUpdateAfterShallowInsert(Object object, AbstractRecord row, AbstractSession session, DatabaseTable table) { if (isReadOnly() || !getFields().get(0).getTable().equals(table) || isPrimaryKeyMapping()) { return; } writeToRowFromAggregateForUpdateAfterShallowInsert(row, object, getAttributeValueFromObject(object), session, table); }
/** * INTERNAL: * This row is built for update before shallow delete which happens in case of bidirectional inserts. * It contains the same fields as the row built by writeFromObjectIntoRowForUpdateAfterShallowInsert, but all the values are null. */ @Override public void writeFromObjectIntoRowForUpdateBeforeShallowDelete(Object object, AbstractRecord row, AbstractSession session, DatabaseTable table) { if (isReadOnly() || !getFields().get(0).getTable().equals(table) || isPrimaryKeyMapping()) { return; } writeToRowFromAggregateForUpdateBeforeShallowDelete(row, object, getAttributeValueFromObject(object), session, table); }