Class InterfacePolicy
java.lang.Object
org.eclipse.persistence.descriptors.InterfacePolicy
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
TablePerClassPolicy
Purpose: Allows for a descriptor's implemented interfaces to be configured.
Generally Interface Descriptors are used for 1 of 2 reasons:
a. Interface descriptors can be used to query across a set of classes that do not share a table.
b. As a target of a variable one to one mapping.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<ClassDescriptor>
protected ClassDescriptor
protected Class
protected String
protected List<ClassDescriptor>
-
Constructor Summary
ConstructorDescriptionINTERNAL: Create a new policy.InterfacePolicy
(ClassDescriptor descriptor) INTERNAL: Create a new policy. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChildDescriptor
(ClassDescriptor childDescriptor) INTERNAL: Add child descriptor to the parent descriptor.void
addParentDescriptor
(ClassDescriptor parentDescriptor) INTERNAL: Add parent descriptor.void
addParentInterface
(Class parentInterface) PUBLIC: Add the parent Interface class.void
addParentInterfaceName
(String parentInterfaceName) void
convertClassNamesToClasses
(ClassLoader classLoader) INTERNAL: Convert all the class-name-based settings in this InheritancePolicy to actual class-based settings.INTERNAL: Return all the child descriptors.protected ClassDescriptor
INTERNAL: Returns the implementor descriptor class.INTERNAL: Returns the implementor descriptor class name.INTERNAL: Return all the parent descriptors.INTERNAL: Return the list of parent interfaces.boolean
hasChild()
INTERNAL: Return if there are any child descriptors.void
initialize
(org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Set the vector to store parent interfaces.boolean
INTERNAL: Check if it is a child descriptor.boolean
INTERNAL:protected ObjectLevelReadQuery
prepareQuery
(ObjectLevelReadQuery query) INTERNAL: Select all objects for a concrete descriptor.protected Object
selectAllObjects
(ReadAllQuery query) INTERNAL: Select all objects for a concrete descriptor.INTERNAL: Select all objects for an interface descriptor.protected Object
selectOneObject
(ReadObjectQuery query) INTERNAL: Select one object of any concrete subclass.INTERNAL: Select one object of any concrete subclass.void
setDescriptor
(ClassDescriptor descriptor) INTERNAL: Set the descriptor.void
setImplementorDescriptor
(Class implementorDescriptor) INTERNAL: Sets the implementor descriptor class.void
setImplementorDescriptorClassName
(String implementorDescriptorClassName) INTERNAL: Sets the implementor descriptor class name.void
setParentInterfaceNames
(List<String> parentInterfaceNames) void
setParentInterfaces
(List<Class> parentInterfaces) Set the Vector to store parent interfaces.boolean
INTERNAL: Returns true if this descriptor should be ignored and the implementing descriptor should be used instead.
-
Field Details
-
parentInterfaces
-
parentInterfaceNames
-
parentDescriptors
-
childDescriptors
-
descriptor
-
implementorDescriptor
-
implementorDescriptorClassName
-
-
Constructor Details
-
InterfacePolicy
public InterfacePolicy()INTERNAL: Create a new policy. Only descriptor involved in interface should have a policy. -
InterfacePolicy
INTERNAL: Create a new policy. Only descriptor involved in interface should have a policy.
-
-
Method Details
-
addChildDescriptor
INTERNAL: Add child descriptor to the parent descriptor. -
addParentDescriptor
INTERNAL: Add parent descriptor. -
addParentInterface
PUBLIC: Add the parent Interface class. This method should be called once for each parent Interface of the Descriptor. -
addParentInterfaceName
-
hasChild
public boolean hasChild()INTERNAL: Return if there are any child descriptors. -
getChildDescriptors
INTERNAL: Return all the child descriptors. -
getDescriptor
-
getImplementorDescriptor
INTERNAL: Returns the implementor descriptor class. -
getImplementorDescriptorClassName
INTERNAL: Returns the implementor descriptor class name. -
getParentDescriptors
INTERNAL: Return all the parent descriptors. -
getParentInterfaces
INTERNAL: Return the list of parent interfaces. -
getParentInterfaceNames
-
convertClassNamesToClasses
INTERNAL: Convert all the class-name-based settings in this InheritancePolicy to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes. It will also convert referenced classes to the versions of the classes from the classLoader. -
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Set the vector to store parent interfaces. -
isInterfaceChildDescriptor
public boolean isInterfaceChildDescriptor()INTERNAL: Check if it is a child descriptor. -
isTablePerClassPolicy
public boolean isTablePerClassPolicy()INTERNAL: -
selectAllObjects
INTERNAL: Select all objects for a concrete descriptor. -
prepareQuery
INTERNAL: Select all objects for a concrete descriptor. -
selectAllObjectsUsingMultipleTableSubclassRead
public Object selectAllObjectsUsingMultipleTableSubclassRead(ReadAllQuery query) throws DatabaseException INTERNAL: Select all objects for an interface descriptor. This is accomplished by selecting for all of the concrete classes and then merging the objects.- Throws:
DatabaseException
-
selectOneObject
INTERNAL: Select one object of any concrete subclass.- Throws:
DescriptorException
-
selectOneObjectUsingMultipleTableSubclassRead
public Object selectOneObjectUsingMultipleTableSubclassRead(ReadObjectQuery query) throws DatabaseException, QueryException INTERNAL: Select one object of any concrete subclass.- Throws:
DatabaseException
QueryException
-
setDescriptor
INTERNAL: Set the descriptor. -
setImplementorDescriptor
INTERNAL: Sets the implementor descriptor class. -
setImplementorDescriptorClassName
INTERNAL: Sets the implementor descriptor class name. -
setParentInterfaces
Set the Vector to store parent interfaces. -
setParentInterfaceNames
-
usesImplementorDescriptor
public boolean usesImplementorDescriptor()INTERNAL: Returns true if this descriptor should be ignored and the implementing descriptor should be used instead.
-