/** * INTERNAL: * Returns true if the key mapping is an AggregateObjectMapping. * Aggregates need events propagated to them because they are not explicitly * deleted, updated or inserted */ public boolean propagatesEventsToCollection() { return ((DatabaseMapping)keyMapping).isAggregateObjectMapping(); }
/** * INTERNAL: * Returns true if the key mapping is an AggregateObjectMapping. * Aggregates need events propagated to them because they are not explicitly * deleted, updated or inserted */ public boolean propagatesEventsToCollection() { return ((DatabaseMapping)keyMapping).isAggregateObjectMapping(); }
/** * INTERNAL: * Returns true if the key mapping is an AggregateObjectMapping. * Aggregates need events propagated to them because they are not explicitly * deleted, updated or inserted */ public boolean propagatesEventsToCollection(){ return ((DatabaseMapping)keyMapping).isAggregateObjectMapping(); }
/** Returns true if the specified type denotes an embedded attribute. */ public boolean isEmbeddedAttribute(Object ownerClass, String attribute) { DatabaseMapping mapping = resolveAttributeMapping(ownerClass, attribute); return (mapping != null) && mapping.isAggregateObjectMapping(); }
/** Returns true if the specified type denotes an embedded attribute. */ public boolean isEmbeddedAttribute(Object ownerClass, String attribute) { DatabaseMapping mapping = resolveAttributeMapping(ownerClass, attribute); return (mapping != null) && mapping.isAggregateObjectMapping(); }
/** * Iterate through a list of expressions searching for the given attribute name. * Return true if it is found, false otherwise. Only use if the query was preprepared so that join expressions * were processed. */ protected boolean isMappingInJoinedExpressionList(DatabaseMapping attributeMapping, List joinedExpressionList) { for (Iterator joinEnum = joinedExpressionList.iterator(); joinEnum.hasNext();) { List aggregateMappings = new ArrayList(); ObjectExpression expression = ((ObjectExpression)joinEnum.next()).getFirstNonAggregateExpressionAfterExpressionBuilder(aggregateMappings); if (attributeMapping.isAggregateObjectMapping() && aggregateMappings.contains(attributeMapping)) { return true; } else if (attributeMapping.equals(expression.getMapping())) {//expression may not have been processed yet return true; } } return false; }
/** * Return the base mapping for the given DatabaseField. */ public DatabaseMapping getBaseMappingForField(DatabaseField databaseField) { DatabaseMapping mapping = getMappingForField(databaseField); // Drill down through the mappings until we get the direct mapping to the databaseField. while (mapping.isAggregateObjectMapping()) { mapping = ((AggregateObjectMapping)mapping).getReferenceDescriptor().getObjectBuilder().getMappingForField(databaseField); } return mapping; }
/** * Return the base mapping for the given DatabaseField. */ public DatabaseMapping getBaseMappingForField(DatabaseField databaseField) { DatabaseMapping mapping = getMappingForField(databaseField); // Drill down through the mappings until we get the direct mapping to the databaseField. while ((mapping != null) && mapping.isAggregateObjectMapping()) { mapping = ((AggregateObjectMapping)mapping).getReferenceDescriptor().getObjectBuilder().getMappingForField(databaseField); } return mapping; }
/** * Return the base mapping for the given DatabaseField. */ public DatabaseMapping getBaseMappingForField(DatabaseField databaseField) { DatabaseMapping mapping = getMappingForField(databaseField); // Drill down through the mappings until we get the direct mapping to the databaseField. while ((mapping != null) && mapping.isAggregateObjectMapping()) { mapping = ((AggregateObjectMapping)mapping).getReferenceDescriptor().getObjectBuilder().getMappingForField(databaseField); } return mapping; }
/** * Return the base value that is mapped to for given field. */ public Object getParentObjectForField(DatabaseField databaseField, Object domainObject) { Object valueIntoObject = domainObject; DatabaseMapping mapping = getMappingForField(databaseField); // Drill down through the aggregate mappings to get to the direct to field mapping. while (mapping.isAggregateObjectMapping()) { valueIntoObject = mapping.getAttributeValueFromObject(valueIntoObject); mapping = ((AggregateMapping)mapping).getReferenceDescriptor().getObjectBuilder().getMappingForField(databaseField); } return valueIntoObject; }
/** * Return the base value that is mapped to for given field. */ public Object getParentObjectForField(DatabaseField databaseField, Object domainObject) { Object valueIntoObject = domainObject; DatabaseMapping mapping = getMappingForField(databaseField); // Drill down through the aggregate mappings to get to the direct to field mapping. while (mapping.isAggregateObjectMapping()) { valueIntoObject = mapping.getAttributeValueFromObject(valueIntoObject); mapping = ((AggregateMapping)mapping).getReferenceDescriptor().getObjectBuilder().getMappingForField(databaseField); } return valueIntoObject; }
/** * Return the base value that is mapped to for given field. */ public Object getParentObjectForField(DatabaseField databaseField, Object domainObject) { Object valueIntoObject = domainObject; DatabaseMapping mapping = getMappingForField(databaseField); // Drill down through the aggregate mappings to get to the direct to field mapping. while (mapping.isAggregateObjectMapping()) { valueIntoObject = mapping.getAttributeValueFromObject(valueIntoObject); mapping = ((AggregateMapping)mapping).getReferenceDescriptor().getObjectBuilder().getMappingForField(databaseField); } return valueIntoObject; }
/** * Return the base value that is mapped to for given field. */ public Object getBaseValueForField(DatabaseField databaseField, Object domainObject) { Object valueIntoObject = domainObject; DatabaseMapping mapping = getMappingForField(databaseField); // Drill down through the aggregate mappings to get to the direct to field mapping. while (mapping.isAggregateObjectMapping()) { valueIntoObject = mapping.getAttributeValueFromObject(valueIntoObject); mapping = ((AggregateMapping)mapping).getReferenceDescriptor().getObjectBuilder().getMappingForField(databaseField); } return mapping.getAttributeValueFromObject(valueIntoObject); }
/** * INTERNAL: * This method is used to store the FK fields that can be cached that correspond to noncacheable mappings * the FK field values will be used to re-issue the query when cloning the shared cache entity */ @Override public void collectQueryParameters(Set<DatabaseField> record){ for (DatabaseMapping mapping : getReferenceDescriptor().getMappings()){ if ((mapping.isForeignReferenceMapping() && !mapping.isCacheable()) || (mapping.isAggregateObjectMapping() && mapping.getReferenceDescriptor().hasNoncacheableMappings())){ ((ForeignReferenceMapping) mapping).collectQueryParameters(record); } } }
/** * Return the base value that is mapped to for given field. */ public Object getBaseValueForField(DatabaseField databaseField, Object domainObject) { Object valueIntoObject = domainObject; DatabaseMapping mapping = getMappingForField(databaseField); // Drill down through the aggregate mappings to get to the direct to field mapping. while (mapping.isAggregateObjectMapping()) { valueIntoObject = mapping.getAttributeValueFromObject(valueIntoObject); mapping = ((AggregateMapping)mapping).getReferenceDescriptor().getObjectBuilder().getMappingForField(databaseField); } // Bug 422610 if (valueIntoObject == null) { return null; } return mapping.getAttributeValueFromObject(valueIntoObject); }
/** * Return the base value that is mapped to for given field. */ public Object getBaseValueForField(DatabaseField databaseField, Object domainObject) { Object valueIntoObject = domainObject; DatabaseMapping mapping = getMappingForField(databaseField); // Drill down through the aggregate mappings to get to the direct to field mapping. while (mapping.isAggregateObjectMapping()) { valueIntoObject = mapping.getAttributeValueFromObject(valueIntoObject); mapping = ((AggregateMapping)mapping).getReferenceDescriptor().getObjectBuilder().getMappingForField(databaseField); } // Bug 422610 if (valueIntoObject == null) { return null; } return mapping.getAttributeValueFromObject(valueIntoObject); }
/** * INTERNAL: * This method is used to store the FK fields that can be cached that correspond to noncacheable mappings * the FK field values will be used to re-issue the query when cloning the shared cache entity */ @Override public void collectQueryParameters(Set<DatabaseField> record){ for (DatabaseMapping mapping : getReferenceDescriptor().getMappings()){ if ((mapping.isForeignReferenceMapping() && !mapping.isCacheable()) || (mapping.isAggregateObjectMapping() && mapping.getReferenceDescriptor().hasNoncacheableMappings())){ ((ForeignReferenceMapping) mapping).collectQueryParameters(record); } } }
protected static boolean verifyFieldAndMapping(AbstractSession session, DatabaseField field, ClassDescriptor descriptor, DatabaseMapping mapping) { verifyField(session, field, descriptor); while (mapping.isAggregateObjectMapping()) { ClassDescriptor referenceDescriptor = ((AggregateObjectMapping)mapping).getReferenceDescriptor(); mapping = referenceDescriptor.getObjectBuilder().getMappingForField(field); verifyFieldAndMapping(session, field, referenceDescriptor, mapping); } if (!mapping.isDirectToFieldMapping() && !mapping.isTransformationMapping()) { String mappingTypeName = Helper.getShortClassName(mapping); session.getIntegrityChecker().handleError(DescriptorException.returningPolicyMappingNotSupported(field.getName(), mappingTypeName, mapping)); return false; } else { return true; } }
protected static boolean verifyFieldAndMapping(AbstractSession session, DatabaseField field, ClassDescriptor descriptor, DatabaseMapping mapping) { verifyField(session, field, descriptor); while (mapping.isAggregateObjectMapping()) { ClassDescriptor referenceDescriptor = ((AggregateObjectMapping)mapping).getReferenceDescriptor(); mapping = referenceDescriptor.getObjectBuilder().getMappingForField(field); verifyFieldAndMapping(session, field, referenceDescriptor, mapping); } if (!mapping.isDirectToFieldMapping() && !mapping.isTransformationMapping()) { String mappingTypeName = Helper.getShortClassName(mapping); session.getIntegrityChecker().handleError(DescriptorException.returningPolicyMappingNotSupported(field.getName(), mappingTypeName, mapping)); return false; } else { return true; } }
protected static boolean verifyFieldAndMapping(AbstractSession session, DatabaseField field, ClassDescriptor descriptor, DatabaseMapping mapping) { verifyField(session, field, descriptor); while (mapping.isAggregateObjectMapping()) { ClassDescriptor referenceDescriptor = ((AggregateObjectMapping)mapping).getReferenceDescriptor(); mapping = referenceDescriptor.getObjectBuilder().getMappingForField(field); verifyFieldAndMapping(session, field, referenceDescriptor, mapping); } if (!mapping.isDirectToFieldMapping() && !mapping.isTransformationMapping()) { String mappingTypeName = Helper.getShortClassName(mapping); session.getIntegrityChecker().handleError(DescriptorException.returningPolicyMappingNotSupported(field.getName(), mappingTypeName, mapping)); return false; } else { return true; } }