EclipseLink 1.1.1_ 1.1.1.v20090430-r4097 API Reference

org.eclipse.persistence.descriptors
Class InterfacePolicy

java.lang.Object
  extended by org.eclipse.persistence.descriptors.InterfacePolicy
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
TablePerClassPolicy

public class InterfacePolicy
extends java.lang.Object
implements java.io.Serializable

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:
Serialized Form
Since:
TopLink for Java 2.0

Field Summary
protected  java.util.Vector childDescriptors
           
protected  ClassDescriptor descriptor
           
protected  java.lang.Class implementorDescriptor
           
protected  java.lang.String implementorDescriptorClassName
           
protected  java.util.Vector parentDescriptors
           
protected  java.util.Vector parentInterfaceNames
           
protected  java.util.Vector parentInterfaces
           
 
Constructor Summary
InterfacePolicy()
          INTERNAL: Create a new policy.
InterfacePolicy(ClassDescriptor descriptor)
          INTERNAL: Create a new policy.
 
Method Summary
 void addChildDescriptor(ClassDescriptor childDescriptor)
          INTERNAL: Add child descriptor to the parent descriptor.
 void addParentDescriptor(ClassDescriptor parentDescriptor)
          INTERNAL: Add parent descriptor.
 void addParentInterface(java.lang.Class parentInterface)
          PUBLIC: Add the parent Interface class.
 void addParentInterfaceName(java.lang.String parentInterfaceName)
           
 java.util.Vector getChildDescriptors()
          INTERNAL: Return all the child descriptors.
protected  ClassDescriptor getDescriptor()
           
 java.lang.Class getImplementorDescriptor()
          INTERNAL: Returns the implementor descriptor class.
 java.lang.String getImplementorDescriptorClassName()
          INTERNAL: Returns the implementor descriptor class name.
 java.util.Vector getParentDescriptors()
          INTERNAL: Return all the parent descriptors.
 java.util.Vector getParentInterfaceNames()
           
 java.util.Vector getParentInterfaces()
          INTERNAL: Return the vector of parent interfaces.
 void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Set the vector to store parent interfaces.
 boolean isInterfaceChildDescriptor()
          INTERNAL: Check if it is a child descriptor.
 boolean isTablePerClassPolicy()
          INTERNAL:
protected  java.lang.Object selectAllObjects(ReadAllQuery query)
          INTERNAL: Select all objects for a concrete descriptor.
 java.lang.Object selectAllObjectsUsingMultipleTableSubclassRead(ReadAllQuery query)
          INTERNAL: Select all objects for an interface descriptor.
protected  java.lang.Object selectOneObject(ReadObjectQuery query)
          INTERNAL: Select one object of any concrete subclass.
 java.lang.Object selectOneObjectUsingMultipleTableSubclassRead(ReadObjectQuery query)
          INTERNAL: Select one object of any concrete subclass.
 void setDescriptor(ClassDescriptor descriptor)
          INTERNAL: Set the descriptor.
 void setImplementorDescriptor(java.lang.Class implementorDescriptor)
          INTERNAL: Sets the implementor descriptor class.
 void setImplementorDescriptorClassName(java.lang.String implementorDescriptorClassName)
          INTERNAL: Sets the implementor descriptor class name.
 void setParentInterfaceNames(java.util.Vector parentInterfaceNames)
           
 void setParentInterfaces(java.util.Vector parentInterfaces)
          Set the Vector to store parent interfaces.
 boolean usesImplementorDescriptor()
          INTERNAL: Returns true if this descriptor should be ignored and the implenting descriptor should be used instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentInterfaces

protected java.util.Vector parentInterfaces

parentInterfaceNames

protected java.util.Vector parentInterfaceNames

parentDescriptors

protected java.util.Vector parentDescriptors

childDescriptors

protected java.util.Vector 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)

getChildDescriptors

public java.util.Vector 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.Vector getParentDescriptors()
INTERNAL: Return all the parent descriptors.


getParentInterfaces

public java.util.Vector getParentInterfaces()
INTERNAL: Return the vector of parent interfaces.


getParentInterfaceNames

public java.util.Vector getParentInterfaceNames()

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.


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.

Returns:
Vector containing all objects.
Throws:
DatabaseException - - an error has occurred on the database.

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:
DatabaseException
QueryException

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.Vector parentInterfaces)
Set the Vector to store parent interfaces.


setParentInterfaceNames

public void setParentInterfaceNames(java.util.Vector parentInterfaceNames)

usesImplementorDescriptor

public boolean usesImplementorDescriptor()
INTERNAL: Returns true if this descriptor should be ignored and the implenting descriptor should be used instead.


EclipseLink 1.1.1_ 1.1.1.v20090430-r4097 API Reference