Top Description Fields Constructors Methods
org.eclipse.persistence.exceptions

public Class DynamicException

extends EclipseLinkException
Class Inheritance
Imports
org.eclipse.persistence.dynamic.DynamicClassLoader, .DynamicClassWriter, .DynamicEntity, .DynamicType, .EclipseLinkClassWriter, org.eclipse.persistence.internal.dynamic.DynamicEntityImpl, .DynamicTypeImpl, org.eclipse.persistence.mappings.DatabaseMapping

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.
Author
dclarke, mnorman
Since
EclipseLink 1.2

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
Inherited from org.eclipse.persistence.exceptions.EclipseLinkException:
CRerrorCodehasBeenLoggedindentationStringinternalExceptionsessionshouldPrintInternalException

Constructor Summary

AccessConstructor and Description
protected
protected
DynamicException(String message, Throwable throwable)

Method Summary

Modifier and TypeMethod and Description
public static DynamicException
entityHasNullType(DynamicEntity entity)

The DynamicEntity has a null type indicating an illegal state of the entity.

public static DynamicException
entityNotFoundException(String message)

A DynamicEntity could not be found

public static DynamicException
illegalDynamicClassWriter(DynamicClassLoader loader, String parentClassName)

A DynamicClassWriter was attempted to be instantiated with a null loader or invalid parentClassName.

public static DynamicException
illegalParentClassName(String parentClassName)

A null or empty string was provided as the parent class for a dynamic class being registered for creation.

public static DynamicException
public static DynamicException
invalidGetPropertyType(DatabaseMapping mapping, 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.

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.

public static DynamicException
invalidPropertyName(DynamicType type, 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.

public static DynamicException
invalidSetPropertyType(DatabaseMapping mapping, Object value)

Invalid value attempted to be set into a DynamicEntity's property.

Inherited from org.eclipse.persistence.exceptions.EclipseLinkException:
crgetErrorCodegetIndentationStringgetInternalExceptiongetMessagegetSessiongetUnformattedMessagehasBeenLoggedprintStackTraceprintStackTraceprintStackTracesetErrorCodesetHasBeenLoggedsetIndentationStringsetInternalExceptionsetSessionsetShouldPrintInternalExceptionshouldPrintInternalExceptiontoString

Field Detail

DYNAMIC_ENTITY_HAS_NULL_TYPEback to summary
public static final int DYNAMIC_ENTITY_HAS_NULL_TYPE
DYNAMIC_ENTITY_NOT_FOUNDback to summary
public static final int DYNAMIC_ENTITY_NOT_FOUND
ILLEGAL_DYNAMIC_CLASSWRITERback to summary
public static final int ILLEGAL_DYNAMIC_CLASSWRITER
ILLEGAL_PARENT_CLASSNAMEback to summary
public static final int ILLEGAL_PARENT_CLASSNAME
INCOMPATIBLE_DYNAMIC_CLASSWRITERSback to summary
public static final int INCOMPATIBLE_DYNAMIC_CLASSWRITERS
INVALID_PROPERTY_GET_WRONG_TYPEback to summary
public static final int INVALID_PROPERTY_GET_WRONG_TYPE
INVALID_PROPERTY_INDEXback to summary
public static final int INVALID_PROPERTY_INDEX
INVALID_PROPERTY_NAMEback to summary
public static final int INVALID_PROPERTY_NAME
INVALID_PROPERTY_SET_WRONG_TYPEback to summary
public static final int INVALID_PROPERTY_SET_WRONG_TYPE

Constructor Detail

DynamicExceptionback to summary
protected DynamicException(String message)
DynamicExceptionback to summary
protected DynamicException(String message, Throwable throwable)

Method Detail

entityHasNullTypeback to summary
public static DynamicException entityHasNullType(DynamicEntity entity)

The DynamicEntity has a null type indicating an illegal state of the entity.

See Also
DynamicEntityImpl#getType()
entityNotFoundExceptionback to summary
public static DynamicException entityNotFoundException(String message)

A DynamicEntity could not be found

illegalDynamicClassWriterback to summary
public static DynamicException illegalDynamicClassWriter(DynamicClassLoader loader, String parentClassName)

A DynamicClassWriter was attempted to be instantiated with a null loader or invalid parentClassName. The parentClassName must not be null or an empty string.

illegalParentClassNameback to summary
public static DynamicException illegalParentClassName(String parentClassName)

A null or empty string was provided as the parent class for a dynamic class being registered for creation.

See Also
DynamicClassWriter
incompatibleDuplicateWritersback to summary
public static DynamicException incompatibleDuplicateWriters(String className, EclipseLinkClassWriter existingWriter, EclipseLinkClassWriter writer)

A call to DynamicClassLoader#addClass(String, org.eclipse.persistence.dynamic.EclipseLinkClassWriter) or DynamicClassLoader#createDynamicClass(String, DynamicClassWriter) was invoked with a className that already had a DynamicClassWriter that is not compatible with the provided writer.

invalidGetPropertyTypeback to summary
public static DynamicException invalidGetPropertyType(DatabaseMapping mapping, 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)
invalidPropertyIndexback to summary
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 then DynamicType#getNumberOfProperties().

See Also
DynamicTypeImpl#getMapping(String)
invalidPropertyNameback to summary
public static DynamicException invalidPropertyName(DynamicType type, 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)
invalidSetPropertyTypeback to summary
public static DynamicException invalidSetPropertyType(DatabaseMapping mapping, Object value)

Invalid value attempted to be set into a DynamicEntity'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