/** * INTERNAL: * In case Query By Example is used, this method generates an expression from a attribute value pair. Since * this is an Aggregate mapping, a recursive call is made to the buildExpressionFromExample method of * ObjectBuilder. */ public Expression buildExpression(Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, Map processedObjects, AbstractSession session) { String attributeName = this.getAttributeName(); Object attributeValue = this.getRealAttributeValueFromObject(queryObject, session); if (!policy.shouldIncludeInQuery(queryObject.getClass(), attributeName, attributeValue)) { //the attribute name and value pair is not to be included in the query. return null; } if (attributeValue == null) { //even though it is null, it is to be always included in the query Expression expression = expressionBuilder.get(attributeName); return policy.completeExpressionForNull(expression); } ObjectBuilder objectBuilder = getReferenceDescriptor().getObjectBuilder(); return objectBuilder.buildExpressionFromExample(attributeValue, policy, expressionBuilder.get(attributeName), processedObjects, session); }
/** * INTERNAL: * In case Query By Example is used, this method generates an expression from a attribute value pair. Since * this is an Aggregate mapping, a recursive call is made to the buildExpressionFromExample method of * ObjectBuilder. */ public Expression buildExpression(Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, Map processedObjects, AbstractSession session) { String attributeName = this.getAttributeName(); Object attributeValue = this.getRealAttributeValueFromObject(queryObject, session); if (!policy.shouldIncludeInQuery(queryObject.getClass(), attributeName, attributeValue)) { //the attribute name and value pair is not to be included in the query. return null; } if (attributeValue == null) { //even though it is null, it is to be always included in the query Expression expression = expressionBuilder.get(attributeName); return policy.completeExpressionForNull(expression); } ObjectBuilder objectBuilder = getReferenceDescriptor().getObjectBuilder(); return objectBuilder.buildExpressionFromExample(attributeValue, policy, expressionBuilder.get(attributeName), processedObjects, session); }
/** * INTERNAL: * In case Query By Example is used, this method generates an expression from a attribute value pair. Since * this is an Aggregate mapping, a recursive call is made to the buildExpressionFromExample method of * ObjectBuilder. */ public Expression buildExpression(Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, Map processedObjects, AbstractSession session) { String attributeName = this.getAttributeName(); Object attributeValue = this.getRealAttributeValueFromObject(queryObject, session); if (!policy.shouldIncludeInQuery(queryObject.getClass(), attributeName, attributeValue)) { //the attribute name and value pair is not to be included in the query. return null; } if (attributeValue == null) { //even though it is null, it is to be always included in the query Expression expression = expressionBuilder.get(attributeName); return policy.completeExpressionForNull(expression); } ObjectBuilder objectBuilder = getReferenceDescriptor().getObjectBuilder(); return objectBuilder.buildExpressionFromExample(attributeValue, policy, expressionBuilder.get(attributeName), processedObjects, session); }
this.descriptor.getObjectChangePolicy().raiseInternalPropertyChangeEvent(target, getAttributeName(), getAttributeValueFromObject(target), targetAttributeValue);
changeRecord.setAttribute(getAttributeName()); changeRecord.setMapping(this);
changeRecord.setAttribute(getAttributeName()); changeRecord.setMapping(this); changeRecord.setOldValue(backupAttribute);
changeRecord.setAttribute(getAttributeName()); changeRecord.setMapping(this); changeRecord.setOldValue(backupAttribute);
this.descriptor.getObjectChangePolicy().raiseInternalPropertyChangeEvent(target, getAttributeName(), getAttributeValueFromObject(target), targetAttributeValue);
this.descriptor.getObjectChangePolicy().raiseInternalPropertyChangeEvent(target, getAttributeName(), getAttributeValueFromObject(target), targetAttributeValue);
AggregateChangeRecord changeRecord = (AggregateChangeRecord)objectChangeSet.getChangesForAttributeNamed(this.getAttributeName()); if (changeRecord == null){ changeRecord = new AggregateChangeRecord(objectChangeSet); changeRecord.setAttribute(this.getAttributeName()); changeRecord.setMapping(this); objectChangeSet.addChange(changeRecord); newListener = new AggregateAttributeChangeListener(referenceDescriptor, uow, ((AttributeChangeListener)((ChangeTracker)sourceClone)._persistence_getPropertyChangeListener()), this.getAttributeName(), newValue); ((ChangeTracker)newValue)._persistence_setPropertyChangeListener(newListener);
AggregateChangeRecord changeRecord = (AggregateChangeRecord)objectChangeSet.getChangesForAttributeNamed(this.getAttributeName()); if (changeRecord == null){ changeRecord = new AggregateChangeRecord(objectChangeSet); changeRecord.setAttribute(this.getAttributeName()); changeRecord.setMapping(this); objectChangeSet.addChange(changeRecord); newListener = new AggregateAttributeChangeListener(referenceDescriptor, uow, ((AttributeChangeListener)((ChangeTracker)sourceClone)._persistence_getPropertyChangeListener()), this.getAttributeName(), newValue); ((ChangeTracker)newValue)._persistence_setPropertyChangeListener(newListener);
AggregateChangeRecord changeRecord = (AggregateChangeRecord)objectChangeSet.getChangesForAttributeNamed(this.getAttributeName()); if (changeRecord == null){ changeRecord = new AggregateChangeRecord(objectChangeSet); changeRecord.setAttribute(this.getAttributeName()); changeRecord.setMapping(this); objectChangeSet.addChange(changeRecord); newListener = new AggregateAttributeChangeListener(referenceDescriptor, uow, ((AttributeChangeListener)((ChangeTracker)sourceClone)._persistence_getPropertyChangeListener()), this.getAttributeName(), newValue); ((ChangeTracker)newValue)._persistence_setPropertyChangeListener(newListener);