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

public Class InterfacePolicy

extends Object
implements Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable
Known Direct Subclasses
org.eclipse.persistence.descriptors.TablePerClassPolicy
Imports
java.io.Serializable, java.util.ArrayList, .Iterator, .List, org.eclipse.persistence.exceptions.DatabaseException, .DescriptorException, .QueryException, .ValidationException, org.eclipse.persistence.expressions.Expression, org.eclipse.persistence.internal.queries.ContainerPolicy, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, org.eclipse.persistence.internal.sessions.AbstractSession, org.eclipse.persistence.queries.ComplexQueryResult, .ObjectLevelReadQuery, .ReadAllQuery, .ReadObjectQuery

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.

Since
TopLink for Java 2.0

Field Summary

Modifier and TypeField and Description
protected List<ClassDescriptor>
protected ClassDescriptor
protected Class<?>
protected String
protected List<ClassDescriptor>
protected List<String>
protected List<Class<?>>

Constructor Summary

AccessConstructor and Description
public
InterfacePolicy()

INTERNAL: Create a new policy.

public
InterfacePolicy(ClassDescriptor descriptor)

INTERNAL: Create a new policy.

Method Summary

Modifier and TypeMethod and Description
public void
addChildDescriptor(ClassDescriptor childDescriptor)

INTERNAL: Add child descriptor to the parent descriptor.

public void
addParentDescriptor(ClassDescriptor parentDescriptor)

INTERNAL: Add parent descriptor.

public void
addParentInterface(Class<?> parentInterface)

PUBLIC: Add the parent Interface class.

public void
addParentInterfaceName(String parentInterfaceName)

public void
convertClassNamesToClasses(ClassLoader classLoader)

INTERNAL: Convert all the class-name-based settings in this InheritancePolicy to actual class-based settings.

public List<ClassDescriptor>
getChildDescriptors()

INTERNAL: Return all the child descriptors.

protected ClassDescriptor
public <T> Class<T>
getImplementorDescriptor()

INTERNAL: Returns the implementor descriptor class.

public String
getImplementorDescriptorClassName()

INTERNAL: Returns the implementor descriptor class name.

public List<ClassDescriptor>
getParentDescriptors()

INTERNAL: Return all the parent descriptors.

public List<String>
public List<Class<?>>
getParentInterfaces()

INTERNAL: Return the list of parent interfaces.

public boolean
hasChild()

INTERNAL: Return if there are any child descriptors.

public void
initialize(AbstractSession session)

INTERNAL: Set the vector to store parent interfaces.

public boolean
isInterfaceChildDescriptor()

INTERNAL: Check if it is a child descriptor.

public boolean
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.

public Object
selectAllObjectsUsingMultipleTableSubclassRead(ReadAllQuery query)

INTERNAL: Select all objects for an interface descriptor.

protected Object
selectOneObject(ReadObjectQuery query)

INTERNAL: Select one object of any concrete subclass.

public Object
selectOneObjectUsingMultipleTableSubclassRead(ReadObjectQuery query)

INTERNAL: Select one object of any concrete subclass.

public void
setDescriptor(ClassDescriptor descriptor)

INTERNAL: Set the descriptor.

public void
setImplementorDescriptor(Class<?> implementorDescriptor)

INTERNAL: Sets the implementor descriptor class.

public void
setImplementorDescriptorClassName(String implementorDescriptorClassName)

INTERNAL: Sets the implementor descriptor class name.

public void
setParentInterfaceNames(List<String> parentInterfaceNames)

public void
setParentInterfaces(List<Class<?>> parentInterfaces)

Set the Vector to store parent interfaces.

public boolean
usesImplementorDescriptor()

INTERNAL: Returns true if this descriptor should be ignored and the implementing descriptor should be used instead.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

childDescriptorsback to summary
protected List<ClassDescriptor> childDescriptors
descriptorback to summary
protected ClassDescriptor descriptor
implementorDescriptorback to summary
protected Class<?> implementorDescriptor
implementorDescriptorClassNameback to summary
protected String implementorDescriptorClassName
parentDescriptorsback to summary
protected List<ClassDescriptor> parentDescriptors
parentInterfaceNamesback to summary
protected List<String> parentInterfaceNames
parentInterfacesback to summary
protected List<Class<?>> parentInterfaces

Constructor Detail

InterfacePolicyback to summary
public InterfacePolicy()

INTERNAL: Create a new policy. Only descriptor involved in interface should have a policy.

InterfacePolicyback to summary
public InterfacePolicy(ClassDescriptor descriptor)

INTERNAL: Create a new policy. Only descriptor involved in interface should have a policy.

Method Detail

addChildDescriptorback to summary
public void addChildDescriptor(ClassDescriptor childDescriptor)

INTERNAL: Add child descriptor to the parent descriptor.

addParentDescriptorback to summary
public void addParentDescriptor(ClassDescriptor parentDescriptor)

INTERNAL: Add parent descriptor.

addParentInterfaceback to summary
public void addParentInterface(Class<?> parentInterface)

PUBLIC: Add the parent Interface class. This method should be called once for each parent Interface of the Descriptor.

addParentInterfaceNameback to summary
public void addParentInterfaceName(String parentInterfaceName)
convertClassNamesToClassesback to summary
public void convertClassNamesToClasses(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.

getChildDescriptorsback to summary
public List<ClassDescriptor> getChildDescriptors()

INTERNAL: Return all the child descriptors.

getDescriptorback to summary
protected ClassDescriptor getDescriptor()
getImplementorDescriptorback to summary
public <T> Class<T> getImplementorDescriptor()

INTERNAL: Returns the implementor descriptor class.

Annotations
@SuppressWarnings:unchecked
getImplementorDescriptorClassNameback to summary
public String getImplementorDescriptorClassName()

INTERNAL: Returns the implementor descriptor class name.

getParentDescriptorsback to summary
public List<ClassDescriptor> getParentDescriptors()

INTERNAL: Return all the parent descriptors.

getParentInterfaceNamesback to summary
public List<String> getParentInterfaceNames()
getParentInterfacesback to summary
public List<Class<?>> getParentInterfaces()

INTERNAL: Return the list of parent interfaces.

hasChildback to summary
public boolean hasChild()

INTERNAL: Return if there are any child descriptors.

initializeback to summary
public void initialize(AbstractSession session)

INTERNAL: Set the vector to store parent interfaces.

isInterfaceChildDescriptorback to summary
public boolean isInterfaceChildDescriptor()

INTERNAL: Check if it is a child descriptor.

isTablePerClassPolicyback to summary
public boolean isTablePerClassPolicy()

INTERNAL:

prepareQueryback to summary
protected ObjectLevelReadQuery prepareQuery(ObjectLevelReadQuery query)

INTERNAL: Select all objects for a concrete descriptor.

selectAllObjectsback to summary
protected Object selectAllObjects(ReadAllQuery query)

INTERNAL: Select all objects for a concrete descriptor.

selectAllObjectsUsingMultipleTableSubclassReadback to summary
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.

selectOneObjectback to summary
protected Object selectOneObject(ReadObjectQuery query) throws DescriptorException

INTERNAL: Select one object of any concrete subclass.

selectOneObjectUsingMultipleTableSubclassReadback to summary
public Object selectOneObjectUsingMultipleTableSubclassRead(ReadObjectQuery query) throws DatabaseException, QueryException

INTERNAL: Select one object of any concrete subclass.

setDescriptorback to summary
public void setDescriptor(ClassDescriptor descriptor)

INTERNAL: Set the descriptor.

setImplementorDescriptorback to summary
public void setImplementorDescriptor(Class<?> implementorDescriptor)

INTERNAL: Sets the implementor descriptor class.

setImplementorDescriptorClassNameback to summary
public void setImplementorDescriptorClassName(String implementorDescriptorClassName)

INTERNAL: Sets the implementor descriptor class name.

setParentInterfaceNamesback to summary
public void setParentInterfaceNames(List<String> parentInterfaceNames)
setParentInterfacesback to summary
public void setParentInterfaces(List<Class<?>> parentInterfaces)

Set the Vector to store parent interfaces.

usesImplementorDescriptorback to summary
public boolean usesImplementorDescriptor()

INTERNAL: Returns true if this descriptor should be ignored and the implementing descriptor should be used instead.