/** * A request to get a persistent value from a DynamicEntity was made * providing a propertyName that does not correspond to any mappings in the * underlying descriptor. * * @see DynamicEntityImpl#get(String) * */ public static DynamicException invalidPropertyName(DynamicType type, String propertyName) { DynamicException de = new DynamicException("Invalid DynamicEntity[" + type + "] property name: " + propertyName); de.setErrorCode(INVALID_PROPERTY_NAME); return de; }
/** * Exception throw when attempting to access a dynamic property by index * which does not have an associated mapping. Make sure the index used is * less then {@link DynamicType#getNumberOfProperties()}. * * @see DynamicTypeImpl#getMapping(String) */ public static DynamicException invalidPropertyIndex(DynamicType type, int propertyIndex) { DynamicException de = new DynamicException("Invalid DynamicEntity[" + type + "] property index: " + propertyIndex); de.setErrorCode(INVALID_PROPERTY_INDEX); return de; }
/** * A {@link DynamicClassWriter} was attempted to be instantiated with a null * loader or invalid parentClassName. The parentClassName must not be null * or an empty string. */ public static DynamicException illegalDynamicClassWriter(DynamicClassLoader loader, String parentClassName) { DynamicException de = new DynamicException("Illegal DynamicClassWriter(" + loader + ", " + parentClassName + ")"); de.setErrorCode(ILLEGAL_DYNAMIC_CLASSWRITER); return de; }
/** * A null or empty string was provided as the parent class for a dynamic * class being registered for creation. * * @see DynamicClassWriter */ public static DynamicException illegalParentClassName(String parentClassName) { DynamicException de = new DynamicException("Illegal parent class name for dynamic type: " + parentClassName); de.setErrorCode(ILLEGAL_PARENT_CLASSNAME); return de; }
/** * Exception throw when attempting to access a dynamic property by index * which does not have an associated mapping. Make sure the index used is * less then {@link DynamicType#getNumberOfProperties()}. * * @see DynamicTypeImpl#getMapping(String) */ public static DynamicException invalidPropertyIndex(DynamicType type, int propertyIndex) { DynamicException de = new DynamicException("Invalid DynamicEntity[" + type + "] property index: " + propertyIndex); de.setErrorCode(INVALID_PROPERTY_INDEX); return de; }
/** * A null or empty string was provided as the parent class for a dynamic * class being registered for creation. * * @see DynamicClassWriter(String) */ public static DynamicException illegalParentClassName(String parentClassName) { DynamicException de = new DynamicException("Illegal parent class name for dynamic type: " + parentClassName); de.setErrorCode(ILLEGAL_PARENT_CLASSNAME); return de; }
/** * A request to get a persistent value from a DynamicEntity was made * providing a propertyName that does not correspond to any mappings in the * underlying descriptor. * * @see DynamicEntity#get(String) * */ public static DynamicException invalidPropertyName(DynamicType type, String propertyName) { DynamicException de = new DynamicException("Invalid DynamicEntity[" + type + "] property name: " + propertyName); de.setErrorCode(INVALID_PROPERTY_NAME); return de; }
/** * A null or empty string was provided as the parent class for a dynamic * class being registered for creation. * * @see DynamicClassWriter */ public static DynamicException illegalParentClassName(String parentClassName) { DynamicException de = new DynamicException("Illegal parent class name for dynamic type: " + parentClassName); de.setErrorCode(ILLEGAL_PARENT_CLASSNAME); return de; }
/** * A request to get a persistent value from a DynamicEntity was made * providing a propertyName that does exist but the provided return type * failed when casting. The generic type specified on the get method must be * supported by the underlying value stored in the dynamic entity. * * @see DynamicEntity#get(String) */ public static DynamicException invalidGetPropertyType(DatabaseMapping mapping, ClassCastException cce) { DynamicException de = new DynamicException("DynamicEntity:: Cannot return: " + mapping + ": " + cce.getMessage(), cce); de.setErrorCode(INVALID_PROPERTY_GET_WRONG_TYPE); return de; }
/** * A call to {@link DynamicClassLoader#addClass(String, org.eclipse.persistence.dynamic.EclipseLinkClassWriter)} * or * {@link DynamicClassLoader#createDynamicClass(String, DynamicClassWriter)} * was invoked with a className that already had a * {@link DynamicClassWriter} that is not compatible with the provided * writer. */ public static DynamicException incompatibleDuplicateWriters(String className, EclipseLinkClassWriter existingWriter, EclipseLinkClassWriter writer) { DynamicException de = new DynamicException("Duplicate addClass request with incompatible writer: " + className + " - existing: " + existingWriter + " - new: " + writer); de.setErrorCode(INCOMPATIBLE_DYNAMIC_CLASSWRITERS); return de; } }
/** * A request to get a persistent value from a DynamicEntity was made * providing a propertyName that does exist but the provided return type * failed when casting. The generic type specified on the get method must be * supported by the underlying value stored in the dynamic entity. * * @see DynamicEntityImpl#get(String) */ public static DynamicException invalidGetPropertyType(DatabaseMapping mapping, ClassCastException cce) { DynamicException de = new DynamicException("DynamicEntity:: Cannot return: " + mapping + ": " + cce.getMessage(), cce); de.setErrorCode(INVALID_PROPERTY_GET_WRONG_TYPE); return de; }
/** * A request to get a persistent value from a DynamicEntity was made * providing a propertyName that does exist but the provided return type * failed when casting. The generic type specified on the get method must be * supported by the underlying value stored in the dynamic entity. * * @see DynamicEntity#get(String) */ public static DynamicException invalidGetPropertyType(DatabaseMapping mapping, ClassCastException cce) { DynamicException de = new DynamicException("DynamicEntity:: Cannot return: " + mapping + ": " + cce.getMessage(), cce); de.setErrorCode(INVALID_PROPERTY_GET_WRONG_TYPE); return de; }
/** * A request to get a persistent value from a DynamicEntity was made * providing a propertyName that does not correspond to any mappings in the * underlying descriptor. * * @see DynamicEntity#get(String) * */ public static DynamicException invalidPropertyName(DynamicType type, String propertyName) { DynamicException de = new DynamicException("Invalid DynamicEntity[" + type + "] property name: " + propertyName); de.setErrorCode(INVALID_PROPERTY_NAME); return de; }
/** * A {@link DynamicEntity} could not be found */ public static DynamicException entityNotFoundException(String message) { DynamicException de = new DynamicException("DynamicEntity not found: " + message); de.setErrorCode(DYNAMIC_ENTITY_NOT_FOUND); return de; }
/** * A {@link DynamicClassWriter} was attempted to be instantiated with a null * loader or invalid parentClassName. The parentClassName must not be null * or an empty string. */ public static DynamicException illegalDynamicClassWriter(DynamicClassLoader loader, String parentClassName) { DynamicException de = new DynamicException("Illegal DynamicClassWriter(" + loader + ", " + parentClassName + ")"); de.setErrorCode(ILLEGAL_DYNAMIC_CLASSWRITER); return de; }
/** * A {@link DynamicEntity} could not be found */ public static DynamicException entityNotFoundException(String message) { DynamicException de = new DynamicException("DynamicEntity not found: " + message); de.setErrorCode(DYNAMIC_ENTITY_NOT_FOUND); return de; }
/** * Exception throw when attempting to access a dynamic property by index * which does not have an associated mapping. Make sure the index used is * less then {@link DynamicType#getNumberOfProperties()}. * * @see DynamicTypeImpl#getMapping(int) */ public static DynamicException invalidPropertyIndex(DynamicType type, int propertyIndex) { DynamicException de = new DynamicException("Invalid DynamicEntity[" + type + "] property index: " + propertyIndex); de.setErrorCode(INVALID_PROPERTY_INDEX); return de; }
/** * A {@link DynamicClassWriter} was attempted to be instantiated with a null * loader or invalid parentClassName. The parentClassName must not be null * or an empty string. */ public static DynamicException illegalDynamicClassWriter(DynamicClassLoader loader, String parentClassName) { DynamicException de = new DynamicException("Illegal DynamicClassWriter(" + loader + ", " + parentClassName + ")"); de.setErrorCode(ILLEGAL_DYNAMIC_CLASSWRITER); return de; }
/** * A {@link DynamicEntity} could not be found */ public static DynamicException entityNotFoundException(String message) { DynamicException de = new DynamicException("DynamicEntity not found: " + message); de.setErrorCode(DYNAMIC_ENTITY_NOT_FOUND); return de; }
/** * A call to {@link DynamicClassLoader#addClass(String, org.eclipse.persistence.dynamic.EclipseLinkClassWriter)} * or * {@link DynamicClassLoader#createDynamicClass(String, DynamicClassWriter)} * was invoked with a className that already had a * {@link DynamicClassWriter} that is not compatible with the provided * writer. */ public static DynamicException incompatibleDuplicateWriters(String className, EclipseLinkClassWriter existingWriter, EclipseLinkClassWriter writer) { DynamicException de = new DynamicException("Duplicate addClass request with incompatible writer: " + className + " - existing: " + existingWriter + " - new: " + writer); de.setErrorCode(INCOMPATIBLE_DYNAMIC_CLASSWRITERS); return de; } }