Class InterfacePolicy
- java.lang.Object
-
- org.eclipse.persistence.descriptors.InterfacePolicy
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
TablePerClassPolicy
public class InterfacePolicy extends java.lang.Object implements java.io.Serializable, java.lang.CloneablePurpose: 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:
- Serialized Form
- Since:
- TopLink for Java 2.0
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<ClassDescriptor>childDescriptorsprotected ClassDescriptordescriptorprotected java.lang.ClassimplementorDescriptorprotected java.lang.StringimplementorDescriptorClassNameprotected java.util.List<ClassDescriptor>parentDescriptorsprotected java.util.List<java.lang.String>parentInterfaceNamesprotected java.util.List<java.lang.Class>parentInterfaces
-
Constructor Summary
Constructors Constructor Description InterfacePolicy()INTERNAL: Create a new policy.InterfacePolicy(ClassDescriptor descriptor)INTERNAL: Create a new policy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChildDescriptor(ClassDescriptor childDescriptor)INTERNAL: Add child descriptor to the parent descriptor.voidaddParentDescriptor(ClassDescriptor parentDescriptor)INTERNAL: Add parent descriptor.voidaddParentInterface(java.lang.Class parentInterface)PUBLIC: Add the parent Interface class.voidaddParentInterfaceName(java.lang.String parentInterfaceName)voidconvertClassNamesToClasses(java.lang.ClassLoader classLoader)INTERNAL: Convert all the class-name-based settings in this InheritancePolicy to actual class-based settings.java.util.List<ClassDescriptor>getChildDescriptors()INTERNAL: Return all the child descriptors.protected ClassDescriptorgetDescriptor()java.lang.ClassgetImplementorDescriptor()INTERNAL: Returns the implementor descriptor class.java.lang.StringgetImplementorDescriptorClassName()INTERNAL: Returns the implementor descriptor class name.java.util.List<ClassDescriptor>getParentDescriptors()INTERNAL: Return all the parent descriptors.java.util.List<java.lang.String>getParentInterfaceNames()java.util.List<java.lang.Class>getParentInterfaces()INTERNAL: Return the list of parent interfaces.booleanhasChild()INTERNAL: Return if there are any child descriptors.voidinitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Set the vector to store parent interfaces.booleanisInterfaceChildDescriptor()INTERNAL: Check if it is a child descriptor.booleanisTablePerClassPolicy()INTERNAL:protected ObjectLevelReadQueryprepareQuery(ObjectLevelReadQuery query)INTERNAL: Select all objects for a concrete descriptor.protected java.lang.ObjectselectAllObjects(ReadAllQuery query)INTERNAL: Select all objects for a concrete descriptor.java.lang.ObjectselectAllObjectsUsingMultipleTableSubclassRead(ReadAllQuery query)INTERNAL: Select all objects for an interface descriptor.protected java.lang.ObjectselectOneObject(ReadObjectQuery query)INTERNAL: Select one object of any concrete subclass.java.lang.ObjectselectOneObjectUsingMultipleTableSubclassRead(ReadObjectQuery query)INTERNAL: Select one object of any concrete subclass.voidsetDescriptor(ClassDescriptor descriptor)INTERNAL: Set the descriptor.voidsetImplementorDescriptor(java.lang.Class implementorDescriptor)INTERNAL: Sets the implementor descriptor class.voidsetImplementorDescriptorClassName(java.lang.String implementorDescriptorClassName)INTERNAL: Sets the implementor descriptor class name.voidsetParentInterfaceNames(java.util.List<java.lang.String> parentInterfaceNames)voidsetParentInterfaces(java.util.List<java.lang.Class> parentInterfaces)Set the Vector to store parent interfaces.booleanusesImplementorDescriptor()INTERNAL: Returns true if this descriptor should be ignored and the implementing descriptor should be used instead.
-
-
-
Field Detail
-
parentInterfaces
protected java.util.List<java.lang.Class> parentInterfaces
-
parentInterfaceNames
protected java.util.List<java.lang.String> parentInterfaceNames
-
parentDescriptors
protected java.util.List<ClassDescriptor> parentDescriptors
-
childDescriptors
protected java.util.List<ClassDescriptor> childDescriptors
-
descriptor
protected ClassDescriptor descriptor
-
implementorDescriptor
protected java.lang.Class implementorDescriptor
-
implementorDescriptorClassName
protected java.lang.String implementorDescriptorClassName
-
-
Constructor Detail
-
InterfacePolicy
public InterfacePolicy()
INTERNAL: Create a new policy. Only descriptor involved in interface should have a policy.
-
InterfacePolicy
public InterfacePolicy(ClassDescriptor descriptor)
INTERNAL: Create a new policy. Only descriptor involved in interface should have a policy.
-
-
Method Detail
-
addChildDescriptor
public void addChildDescriptor(ClassDescriptor childDescriptor)
INTERNAL: Add child descriptor to the parent descriptor.
-
addParentDescriptor
public void addParentDescriptor(ClassDescriptor parentDescriptor)
INTERNAL: Add parent descriptor.
-
addParentInterface
public void addParentInterface(java.lang.Class parentInterface)
PUBLIC: Add the parent Interface class. This method should be called once for each parent Interface of the Descriptor.
-
addParentInterfaceName
public void addParentInterfaceName(java.lang.String parentInterfaceName)
-
hasChild
public boolean hasChild()
INTERNAL: Return if there are any child descriptors.
-
getChildDescriptors
public java.util.List<ClassDescriptor> getChildDescriptors()
INTERNAL: Return all the child descriptors.
-
getDescriptor
protected ClassDescriptor getDescriptor()
-
getImplementorDescriptor
public java.lang.Class getImplementorDescriptor()
INTERNAL: Returns the implementor descriptor class.
-
getImplementorDescriptorClassName
public java.lang.String getImplementorDescriptorClassName()
INTERNAL: Returns the implementor descriptor class name.
-
getParentDescriptors
public java.util.List<ClassDescriptor> getParentDescriptors()
INTERNAL: Return all the parent descriptors.
-
getParentInterfaces
public java.util.List<java.lang.Class> getParentInterfaces()
INTERNAL: Return the list of parent interfaces.
-
getParentInterfaceNames
public java.util.List<java.lang.String> getParentInterfaceNames()
-
convertClassNamesToClasses
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
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
protected java.lang.Object selectAllObjects(ReadAllQuery query)
INTERNAL: Select all objects for a concrete descriptor.
-
prepareQuery
protected ObjectLevelReadQuery prepareQuery(ObjectLevelReadQuery query)
INTERNAL: Select all objects for a concrete descriptor.
-
selectAllObjectsUsingMultipleTableSubclassRead
public java.lang.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
protected java.lang.Object selectOneObject(ReadObjectQuery query) throws DescriptorException
INTERNAL: Select one object of any concrete subclass.- Throws:
DescriptorException
-
selectOneObjectUsingMultipleTableSubclassRead
public java.lang.Object selectOneObjectUsingMultipleTableSubclassRead(ReadObjectQuery query) throws DatabaseException, QueryException
INTERNAL: Select one object of any concrete subclass.- Throws:
DatabaseExceptionQueryException
-
setDescriptor
public void setDescriptor(ClassDescriptor descriptor)
INTERNAL: Set the descriptor.
-
setImplementorDescriptor
public void setImplementorDescriptor(java.lang.Class implementorDescriptor)
INTERNAL: Sets the implementor descriptor class.
-
setImplementorDescriptorClassName
public void setImplementorDescriptorClassName(java.lang.String implementorDescriptorClassName)
INTERNAL: Sets the implementor descriptor class name.
-
setParentInterfaces
public void setParentInterfaces(java.util.List<java.lang.Class> parentInterfaces)
Set the Vector to store parent interfaces.
-
setParentInterfaceNames
public void setParentInterfaceNames(java.util.List<java.lang.String> parentInterfaceNames)
-
usesImplementorDescriptor
public boolean usesImplementorDescriptor()
INTERNAL: Returns true if this descriptor should be ignored and the implementing descriptor should be used instead.
-
-