/** * INTERNAL: * Print the mapping attribute name, this is used in error messages. */ public String toString() { return getClass().getName() + "[" + getAttributeName() + "]"; }
public ValuesAccessor(DatabaseMapping mapping) { super(); this.mapping = mapping; setAttributeName(mapping.getAttributeName()); }
public List<String> getPropertyNames() { List<String> propertyNames = new ArrayList<String>(); if (type != null && type.getDescriptor() != null) { for (DatabaseMapping dm : type.getDescriptor().getMappings()) { propertyNames.add(dm.getAttributeName()); } } return propertyNames; }
/** * Return whether the given attribute is joined as a result of a join on a mapping */ protected boolean isAttributeMappingJoined(DatabaseMapping attributeMapping) { return isAttributeNameInJoinedExpressionList(attributeMapping.getAttributeName(), getJoinedMappingExpressions()); }
public static QueryException unsupportedMappingQueryByExample(String className, DatabaseMapping databaseMapping) { Object[] args = {className, databaseMapping.getClass().getName(), databaseMapping.getAttributeName()}; QueryException queryException = new QueryException(ExceptionMessageGenerator.buildMessage(QueryException.class, UNSUPPORTED_MAPPING_FOR_QUERYBYEXAMPLE, args)); queryException.setErrorCode(UNSUPPORTED_MAPPING_FOR_QUERYBYEXAMPLE); return queryException; } }
public static QueryException unsupportedMappingQueryByExample(String className, DatabaseMapping databaseMapping) { Object[] args = {className, databaseMapping.getClass().getName(), databaseMapping.getAttributeName()}; QueryException queryException = new QueryException(ExceptionMessageGenerator.buildMessage(QueryException.class, UNSUPPORTED_MAPPING_FOR_QUERYBYEXAMPLE, args)); queryException.setErrorCode(UNSUPPORTED_MAPPING_FOR_QUERYBYEXAMPLE); return queryException; } }
public boolean contains(String propertyName) { boolean contains = false; if (type != null && type.getDescriptor() != null) { for (DatabaseMapping dm : type.getDescriptor().getMappings()) { if (dm.getAttributeName().equals(propertyName)) { contains = true; break; } } } return contains; }
public static DescriptorException returnAndMappingWithTransparentIndirectionMismatch(DatabaseMapping mapping, Class parameterType, String validTypeName) { Object[] args = { mapping.getAttributeName(), parameterType, validTypeName }; DescriptorException exception = new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class, RETURN_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH, args), mapping); exception.setErrorCode(RETURN_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH); return exception; }
public static XMLMarshalException noDescriptorFound(DatabaseMapping mapping) { Object[] args = { mapping.getAttributeName() }; XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, NO_DESCRIPTOR_FOUND, args)); exception.setErrorCode(NO_DESCRIPTOR_FOUND); return exception; }
public static DescriptorException attributeAndMappingWithoutIndirectionMismatch(DatabaseMapping mapping) { Object[] args = { mapping.getAttributeName() }; DescriptorException exception = new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class, ATTRIBUTE_AND_MAPPING_WITHOUT_INDIRECTION_MISMATCH, args), mapping); exception.setErrorCode(ATTRIBUTE_AND_MAPPING_WITHOUT_INDIRECTION_MISMATCH); return exception; }
public static DescriptorException parameterAndMappingWithIndirectionMismatch(DatabaseMapping mapping) { Object[] args = { mapping.getAttributeName() }; DescriptorException exception = new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class, PARAMETER_AND_MAPPING_WITH_INDIRECTION_MISMATCH, args), mapping); exception.setErrorCode(PARAMETER_AND_MAPPING_WITH_INDIRECTION_MISMATCH); return exception; }
public static DescriptorException valueHolderInstantiationMismatch(Object attributeValue, DatabaseMapping mapping) { Object[] args = { mapping.getAttributeName(), attributeValue }; DescriptorException exception = new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class, VALUE_HOLDER_INSTANTIATION_MISMATCH, args), mapping); exception.setErrorCode(VALUE_HOLDER_INSTANTIATION_MISMATCH); return exception; }
public static DescriptorException returnAndMappingWithIndirectionMismatch(DatabaseMapping mapping) { Object[] args = { mapping.getAttributeName() }; DescriptorException exception = new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class, RETURN_AND_MAPPING_WITH_INDIRECTION_MISMATCH, args), mapping); exception.setErrorCode(RETURN_AND_MAPPING_WITH_INDIRECTION_MISMATCH); return exception; }
public static DescriptorException attributeAndMappingWithTransparentIndirectionMismatch(DatabaseMapping mapping, Class parameterType, String validTypeName) { Object[] args = { mapping.getAttributeName(), parameterType, validTypeName }; DescriptorException exception = new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class, ATTRIBUTE_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH, args), mapping); exception.setErrorCode(ATTRIBUTE_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH); return exception; }
public static DescriptorException parameterAndMappingWithTransparentIndirectionMismatch(DatabaseMapping mapping, Class parameterType, String validTypeName) { Object[] args = { mapping.getAttributeName(), parameterType, validTypeName }; DescriptorException exception = new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class, PARAMETER_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH, args), mapping); exception.setErrorCode(PARAMETER_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH); return exception; }
public static DescriptorException unsupportedTypeForBidirectionalRelationshipMaintenance(DatabaseMapping mapping, org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy) { Object[] args = { mapping.getAttributeName(), containerPolicy }; DescriptorException exception = new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class, UNSUPPORTED_TYPE_FOR_BIDIRECTIONAL_RELATIONSHIP_MAINTENANCE, args), mapping); exception.setErrorCode(UNSUPPORTED_TYPE_FOR_BIDIRECTIONAL_RELATIONSHIP_MAINTENANCE); return exception; }
public static DescriptorException invalidMappingType(DatabaseMapping mapping) { Object[] args = { mapping.getAttributeName() }; DescriptorException descriptorException = new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class, INVALID_MAPPING_TYPE, args), mapping); descriptorException.setErrorCode(INVALID_MAPPING_TYPE); return descriptorException; }
public static DescriptorException parameterAndMappingWithTransparentIndirectionMismatch(DatabaseMapping mapping, Class parameterType, String validTypeName) { Object[] args = { mapping.getAttributeName(), parameterType, validTypeName }; DescriptorException exception = new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class, PARAMETER_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH, args), mapping); exception.setErrorCode(PARAMETER_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH); return exception; }
public static DescriptorException unsupportedTypeForBidirectionalRelationshipMaintenance(DatabaseMapping mapping, org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy) { Object[] args = { mapping.getAttributeName(), containerPolicy }; DescriptorException exception = new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class, UNSUPPORTED_TYPE_FOR_BIDIRECTIONAL_RELATIONSHIP_MAINTENANCE, args), mapping); exception.setErrorCode(UNSUPPORTED_TYPE_FOR_BIDIRECTIONAL_RELATIONSHIP_MAINTENANCE); return exception; }
public static DescriptorException valueHolderInstantiationMismatch(Object attributeValue, DatabaseMapping mapping) { Object[] args = { mapping.getAttributeName(), attributeValue }; DescriptorException exception = new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class, VALUE_HOLDER_INSTANTIATION_MISMATCH, args), mapping); exception.setErrorCode(VALUE_HOLDER_INSTANTIATION_MISMATCH); return exception; }