Class DynamicException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.eclipse.persistence.exceptions.EclipseLinkException
-
- org.eclipse.persistence.exceptions.DynamicException
-
- All Implemented Interfaces:
java.io.Serializable
public class DynamicException extends EclipseLinkException
Custom exception type that provides information about failure cases encountered when using a GenericEntity with TopLink. Any failures that are not specific to GenericEntity use will still involve the standard TopLink exceptions.- See Also:
- Serialized Form
- Author:
- dclarke, mnorman
- Since:
- EclipseLink 1.2
-
-
Field Summary
Fields Modifier and Type Field Description static int
DYNAMIC_ENTITY_HAS_NULL_TYPE
static int
DYNAMIC_ENTITY_NOT_FOUND
static int
ILLEGAL_DYNAMIC_CLASSWRITER
static int
ILLEGAL_PARENT_CLASSNAME
static int
INCOMPATIBLE_DYNAMIC_CLASSWRITERS
static int
INVALID_PROPERTY_GET_WRONG_TYPE
static int
INVALID_PROPERTY_INDEX
static int
INVALID_PROPERTY_NAME
static int
INVALID_PROPERTY_SET_WRONG_TYPE
-
Fields inherited from class org.eclipse.persistence.exceptions.EclipseLinkException
CR, errorCode, hasBeenLogged, indentationString, internalException, session, shouldPrintInternalException
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DynamicException(java.lang.String message)
protected
DynamicException(java.lang.String message, java.lang.Throwable throwable)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DynamicException
entityHasNullType(DynamicEntity entity)
TheDynamicEntity
has a null type indicating an illegal state of the entity.static DynamicException
entityNotFoundException(java.lang.String message)
ADynamicEntity
could not be foundstatic DynamicException
illegalDynamicClassWriter(DynamicClassLoader loader, java.lang.String parentClassName)
ADynamicClassWriter
was attempted to be instantiated with a null loader or invalid parentClassName.static DynamicException
illegalParentClassName(java.lang.String parentClassName)
A null or empty string was provided as the parent class for a dynamic class being registered for creation.static DynamicException
incompatibleDuplicateWriters(java.lang.String className, EclipseLinkClassWriter existingWriter, EclipseLinkClassWriter writer)
A call toDynamicClassLoader.addClass(String, org.eclipse.persistence.dynamic.EclipseLinkClassWriter)
orDynamicClassLoader.createDynamicClass(String, DynamicClassWriter)
was invoked with a className that already had aDynamicClassWriter
that is not compatible with the provided writer.static DynamicException
invalidGetPropertyType(DatabaseMapping mapping, java.lang.ClassCastException cce)
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.static DynamicException
invalidPropertyIndex(DynamicType type, int propertyIndex)
Exception throw when attempting to access a dynamic property by index which does not have an associated mapping.static DynamicException
invalidPropertyName(DynamicType type, java.lang.String propertyName)
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.static DynamicException
invalidSetPropertyType(DatabaseMapping mapping, java.lang.Object value)
Invalid value attempted to be set into aDynamicEntity
's property.-
Methods inherited from class org.eclipse.persistence.exceptions.EclipseLinkException
cr, getErrorCode, getIndentationString, getInternalException, getMessage, getSession, getUnformattedMessage, hasBeenLogged, printStackTrace, printStackTrace, printStackTrace, setErrorCode, setHasBeenLogged, setIndentationString, setInternalException, setSession, setShouldPrintInternalException, shouldPrintInternalException, toString
-
-
-
-
Field Detail
-
INVALID_PROPERTY_NAME
public static final int INVALID_PROPERTY_NAME
- See Also:
- Constant Field Values
-
INVALID_PROPERTY_GET_WRONG_TYPE
public static final int INVALID_PROPERTY_GET_WRONG_TYPE
- See Also:
- Constant Field Values
-
INVALID_PROPERTY_SET_WRONG_TYPE
public static final int INVALID_PROPERTY_SET_WRONG_TYPE
- See Also:
- Constant Field Values
-
INVALID_PROPERTY_INDEX
public static final int INVALID_PROPERTY_INDEX
- See Also:
- Constant Field Values
-
ILLEGAL_DYNAMIC_CLASSWRITER
public static final int ILLEGAL_DYNAMIC_CLASSWRITER
- See Also:
- Constant Field Values
-
DYNAMIC_ENTITY_NOT_FOUND
public static final int DYNAMIC_ENTITY_NOT_FOUND
- See Also:
- Constant Field Values
-
DYNAMIC_ENTITY_HAS_NULL_TYPE
public static final int DYNAMIC_ENTITY_HAS_NULL_TYPE
- See Also:
- Constant Field Values
-
ILLEGAL_PARENT_CLASSNAME
public static final int ILLEGAL_PARENT_CLASSNAME
- See Also:
- Constant Field Values
-
INCOMPATIBLE_DYNAMIC_CLASSWRITERS
public static final int INCOMPATIBLE_DYNAMIC_CLASSWRITERS
- See Also:
- Constant Field Values
-
-
Method Detail
-
invalidPropertyName
public static DynamicException invalidPropertyName(DynamicType type, java.lang.String propertyName)
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 Also:
DynamicEntity.get(String)
-
invalidGetPropertyType
public static DynamicException invalidGetPropertyType(DatabaseMapping mapping, java.lang.ClassCastException cce)
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 Also:
DynamicEntity.get(String)
-
invalidSetPropertyType
public static DynamicException invalidSetPropertyType(DatabaseMapping mapping, java.lang.Object value)
Invalid value attempted to be set into aDynamicEntity
's property. This could be caused by:- Putting null into an property which is classified as primitive or a collection
- Putting a value into a property that cannot be assigned to the configured classification
- Parameters:
mapping
-value
-- Returns:
-
invalidPropertyIndex
public static DynamicException invalidPropertyIndex(DynamicType type, int propertyIndex)
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 thenDynamicType.getNumberOfProperties()
.- See Also:
DynamicTypeImpl.getMapping(String)
-
illegalDynamicClassWriter
public static DynamicException illegalDynamicClassWriter(DynamicClassLoader loader, java.lang.String parentClassName)
ADynamicClassWriter
was attempted to be instantiated with a null loader or invalid parentClassName. The parentClassName must not be null or an empty string.
-
entityNotFoundException
public static DynamicException entityNotFoundException(java.lang.String message)
ADynamicEntity
could not be found
-
entityHasNullType
public static DynamicException entityHasNullType(DynamicEntity entity)
TheDynamicEntity
has a null type indicating an illegal state of the entity.- See Also:
DynamicEntityImpl.getType()
-
illegalParentClassName
public static DynamicException illegalParentClassName(java.lang.String parentClassName)
A null or empty string was provided as the parent class for a dynamic class being registered for creation.- See Also:
DynamicClassWriter
-
incompatibleDuplicateWriters
public static DynamicException incompatibleDuplicateWriters(java.lang.String className, EclipseLinkClassWriter existingWriter, EclipseLinkClassWriter writer)
A call toDynamicClassLoader.addClass(String, org.eclipse.persistence.dynamic.EclipseLinkClassWriter)
orDynamicClassLoader.createDynamicClass(String, DynamicClassWriter)
was invoked with a className that already had aDynamicClassWriter
that is not compatible with the provided writer.
-
-