/** * INTERNAL: * Compare the attributes belonging to this mapping for the objects. */ @Override public boolean compareObjects(Object firstObject, Object secondObject, AbstractSession session) { Object firstValue = getAttributeValueFromObject(firstObject); Object secondValue = getAttributeValueFromObject(secondObject); return compareObjectValues(firstValue, secondValue, session); }
/** * INTERNAL: * Compare the attributes belonging to this mapping for the objects. */ public boolean compareObjects(Object firstObject, Object secondObject, AbstractSession session) { Object firstValue = getAttributeValueFromObject(firstObject); Object secondValue = getAttributeValueFromObject(secondObject); return compareObjectValues(firstValue, secondValue, session); }
/** * INTERNAL: * Compare the attributes belonging to this mapping for the objects. */ @Override public boolean compareObjects(Object firstObject, Object secondObject, AbstractSession session) { Object firstValue = getAttributeValueFromObject(firstObject); Object secondValue = getAttributeValueFromObject(secondObject); return compareObjectValues(firstValue, secondValue, session); }
/** * INTERNAL: * Directly build a change record without comparison */ public ChangeRecord buildChangeRecord(Object clone, ObjectChangeSet owner, AbstractSession session) { return internalBuildChangeRecord(getAttributeValueFromObject(clone), owner); }
/** * INTERNAL: * Get the value from the object for this mapping. */ @Override public Object valueFromObject(Object object, DatabaseField field, AbstractSession session) throws DescriptorException { return getFieldValue(getAttributeValueFromObject(object), session); }
/** * INTERNAL: * Directly build a change record without comparison */ @Override public ChangeRecord buildChangeRecord(Object clone, ObjectChangeSet owner, AbstractSession session) { return internalBuildChangeRecord(getAttributeValueFromObject(clone), null, owner); }
/** * INTERNAL: * Get the value from the object for this mapping. */ @Override public Object valueFromObject(Object object, DatabaseField field, AbstractSession session) throws DescriptorException { return getFieldValue(getAttributeValueFromObject(object), session); }
/** * INTERNAL: * Get the value from the object for this mapping. */ public Object valueFromObject(Object object, DatabaseField field, AbstractSession session) throws DescriptorException { return getFieldValue(getAttributeValueFromObject(object), session); }
/** * INTERNAL: * Directly build a change record without comparison */ @Override public ChangeRecord buildChangeRecord(Object clone, ObjectChangeSet owner, AbstractSession session) { return internalBuildChangeRecord(getAttributeValueFromObject(clone), null, owner); }
public boolean marshal(XPathFragment xPathFragment, MarshalRecord marshalRecord, Object object, AbstractSession session, NamespaceResolver namespaceResolver, MarshalContext marshalContext) { Object objectValue = directMapping.getAttributeValueFromObject(object); return this.marshalSingleValue(xPathFragment, marshalRecord, object, objectValue, session, namespaceResolver, marshalContext); }
/** * INTERNAL: * Compare the clone and backup clone values and return a change record if the value changed. */ @Override public ChangeRecord compareForChange(Object clone, Object backUp, ObjectChangeSet owner, AbstractSession session) { // same code as write from object into row for update if (owner.isNew()) { return internalBuildChangeRecord(getAttributeValueFromObject(clone), null, owner); } else if (!compareObjects(backUp, clone, session)) { Object oldValue = null; if (backUp != null && clone != backUp) { oldValue = getAttributeValueFromObject(backUp); } return internalBuildChangeRecord(getAttributeValueFromObject(clone), oldValue, owner); } return null; }
/** * INTERNAL: * Compare the clone and backup clone values and return a change record if the value changed. */ @Override public ChangeRecord compareForChange(Object clone, Object backUp, ObjectChangeSet owner, AbstractSession session) { // same code as write from object into row for update if (owner.isNew()) { return internalBuildChangeRecord(getAttributeValueFromObject(clone), null, owner); } else if (!compareObjects(backUp, clone, session)) { Object oldValue = null; if (backUp != null && clone != backUp) { oldValue = getAttributeValueFromObject(backUp); } return internalBuildChangeRecord(getAttributeValueFromObject(clone), oldValue, owner); } return null; }
/** * INTERNAL: * Clone the attribute from the original and assign it to the clone. * If mutability is configured to be true, clone the attribute if it is an instance of * byte[], java.util.Calendar or java.util.Date (or their subclasses). */ public void buildCloneValue(Object original, Object clone, AbstractSession session) { Object attributeValue = getAttributeValueFromObject(original); attributeValue = buildCloneValue(attributeValue, session); setAttributeValueInObject(clone, attributeValue); }
/** * INTERNAL: * Retrieves the lock value from the object. */ protected Object lockValueFromObject(Object domainObject) { // PERF: If mapping with a direct mapping get from cached mapping. if (this.lockMapping != null) { return this.lockMapping.getAttributeValueFromObject(domainObject); } else { return this.descriptor.getObjectBuilder().getBaseValueForField(this.writeLockField, domainObject); } }
/** * INTERNAL: * Clone the attribute from the original and assign it to the clone. * If mutability is configured to be true, clone the attribute if it is an instance of * byte[], java.util.Calendar or java.util.Date (or their subclasses). */ public void buildCloneValue(Object original, Object clone, AbstractSession session) { Object attributeValue = getAttributeValueFromObject(original); attributeValue = buildCloneValue(attributeValue, session); setAttributeValueInObject(clone, attributeValue); }
/** * INTERNAL: * Retrieves the lock value from the object. */ protected Object lockValueFromObject(Object domainObject) { // PERF: If mapping with a direct mapping get from cached mapping. if (this.lockMapping != null) { return this.lockMapping.getAttributeValueFromObject(domainObject); } else { return this.descriptor.getObjectBuilder().getBaseValueForField(this.writeLockField, domainObject); } }
/** * INTERNAL: * Retrieves the lock value from the object. */ protected Object lockValueFromObject(Object domainObject) { // PERF: If mapping with a direct mapping get from cached mapping. if (this.lockMapping != null) { return this.lockMapping.getAttributeValueFromObject(domainObject); } else { return this.descriptor.getObjectBuilder().getBaseValueForField(this.writeLockField, domainObject); } }
/** * INTERNAL: * Get a value from the object and set that in the respective field of the row. */ public void writeFromObjectIntoRow(Object object, AbstractRecord row, AbstractSession session) { if (this.isReadOnly) { return; } Object attributeValue = getAttributeValueFromObject(object); Object fieldValue = getFieldValue(attributeValue, session); writeValueIntoRow(row, this.field, fieldValue); }
/** * INTERNAL: * Clone the attribute from the original and assign it to the clone. * If mutability is configured to be true, clone the attribute if it is an instance of * byte[], java.util.Calendar or java.util.Date (or their subclasses). */ public void buildCloneValue(Object original, Object clone, AbstractSession session) { Object attributeValue = getAttributeValueFromObject(original); attributeValue = buildCloneValue(attributeValue, session); setAttributeValueInObject(clone, attributeValue); }
/** * INTERNAL: * Iterate on the appropriate attribute. */ public void iterate(DescriptorIterator iterator) { // PERF: Only iterate when required. if (iterator.shouldIterateOnPrimitives()) { iterator.iteratePrimitiveForMapping(getAttributeValueFromObject(iterator.getVisitedParent()), this); } }