public void setAttributeValueInObject(Object object, Object value) throws DescriptorException { if(isWriteOnly()) { return; } super.setAttributeValueInObject(object, value); }
public void setAttributeValueInObject(Object object, Object value) throws DescriptorException { if(isWriteOnly()) { return; } super.setAttributeValueInObject(object, value); }
public void setAttributeValueInObject(Object object, Object value) throws DescriptorException { if(isWriteOnly()) { return; } super.setAttributeValueInObject(object, value); }
/** * INTERNAL: * Builds a shallow original object. Only direct attributes and primary * keys are populated. In this way the minimum original required for * instantiating a working copy clone can be built without placing it in * the shared cache (no concern over cycles). */ public void buildShallowOriginalFromRow(AbstractRecord row, Object original, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, AbstractSession executionSession) { Object fieldValue = row.get(this.getField()); // BUG#2667762 there could be whitespace in the row instead of null if ((fieldValue == null) || (fieldValue instanceof String)) { return; } // pretty sure we can ignore inheritance here: AbstractRecord nestedRow = this.getReferenceDescriptor().buildNestedRowFromFieldValue(fieldValue); ClassDescriptor descriptor = this.getReferenceDescriptor(); if (descriptor.hasInheritance()) { Class nestedElementClass = descriptor.getInheritancePolicy().classFromRow(nestedRow, executionSession); descriptor = this.getReferenceDescriptor(nestedElementClass, executionSession); } ObjectBuilder objectBuilder = descriptor.getObjectBuilder(); // instead of calling buildCompositeObject, which calls either objectBuilder. // buildObject or buildNewInstance and buildAttributesIntoObject, do the // following always. Since shallow original no concern over cycles or caching. Object element = objectBuilder.buildNewInstance(); objectBuilder.buildAttributesIntoShallowObject(element, nestedRow, sourceQuery); setAttributeValueInObject(original, element); }
/** * INTERNAL: * Builds a shallow original object. Only direct attributes and primary * keys are populated. In this way the minimum original required for * instantiating a working copy clone can be built without placing it in * the shared cache (no concern over cycles). */ public void buildShallowOriginalFromRow(AbstractRecord row, Object original, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, AbstractSession executionSession) { Object fieldValue = row.get(this.getField()); // BUG#2667762 there could be whitespace in the row instead of null if ((fieldValue == null) || (fieldValue instanceof String)) { return; } // pretty sure we can ignore inheritance here: AbstractRecord nestedRow = this.getReferenceDescriptor().buildNestedRowFromFieldValue(fieldValue); ClassDescriptor descriptor = this.getReferenceDescriptor(); if (descriptor.hasInheritance()) { Class nestedElementClass = descriptor.getInheritancePolicy().classFromRow(nestedRow, executionSession); descriptor = this.getReferenceDescriptor(nestedElementClass, executionSession); } ObjectBuilder objectBuilder = descriptor.getObjectBuilder(); // instead of calling buildCompositeObject, which calls either objectBuilder. // buildObject or buildNewInstance and buildAttributesIntoObject, do the // following always. Since shallow original no concern over cycles or caching. Object element = objectBuilder.buildNewInstance(); objectBuilder.buildAttributesIntoShallowObject(element, nestedRow, sourceQuery); setAttributeValueInObject(original, element); }
/** * INTERNAL: * Builds a shallow original object. Only direct attributes and primary * keys are populated. In this way the minimum original required for * instantiating a working copy clone can be built without placing it in * the shared cache (no concern over cycles). */ public void buildShallowOriginalFromRow(AbstractRecord row, Object original, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, AbstractSession executionSession) { Object fieldValue = row.get(this.getField()); // BUG#2667762 there could be whitespace in the row instead of null if ((fieldValue == null) || (fieldValue instanceof String)) { return; } // pretty sure we can ignore inheritance here: AbstractRecord nestedRow = this.getReferenceDescriptor().buildNestedRowFromFieldValue(fieldValue); ClassDescriptor descriptor = this.getReferenceDescriptor(); if (descriptor.hasInheritance()) { Class nestedElementClass = descriptor.getInheritancePolicy().classFromRow(nestedRow, executionSession); descriptor = this.getReferenceDescriptor(nestedElementClass, executionSession); } ObjectBuilder objectBuilder = descriptor.getObjectBuilder(); // instead of calling buildCompositeObject, which calls either objectBuilder. // buildObject or buildNewInstance and buildAttributesIntoObject, do the // following always. Since shallow original no concern over cycles or caching. Object element = objectBuilder.buildNewInstance(); objectBuilder.buildAttributesIntoShallowObject(element, nestedRow, sourceQuery); setAttributeValueInObject(original, element); }