additionalAggregateCollectionKeyFields
used by aggregate descriptors to hold additional fields needed when they are stored in an AggregatateCollection
These fields are generally foreign key fields that are required in addition to the fields in the descriptor's
mappings to uniquely identify the Aggregate

addAbstractQueryKey(java.lang.String queryKeyName)
PUBLIC:
This method should only be used for interface descriptors.

void

addCascadeLockingPolicy(org.eclipse.persistence.internal.descriptors.CascadeLockingPolicy policy)
INTERNAL:
Add the cascade locking policy to all children that have a relationship to this descriptor
either by inheritance or by encapsulation/aggregation.

addForeignKeyFieldForMultipleTable(org.eclipse.persistence.internal.helper.DatabaseField sourceForeignKeyField,
org.eclipse.persistence.internal.helper.DatabaseField targetPrimaryKeyField)
PUBLIC:
This protocol can be used to associate multiple tables with foreign key
information.

void

addForeignKeyFieldNameForMultipleTable(java.lang.String sourceForeignKeyFieldName,
java.lang.String targetPrimaryKeyFieldName)
PUBLIC:
This protocol can be used to associate multiple tables with foreign key
information.

buildCallFromStatement(org.eclipse.persistence.internal.expressions.SQLStatement statement,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Return a call built from a statement.

buildField(java.lang.String fieldName)
INTERNAL:
A DatabaseField is built from the given field name.

java.lang.Object

buildFieldValueFromDirectValues(java.util.Vector directValues,
java.lang.String elementDataTypeName,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Build the appropriate field value for the specified
set of direct values.

java.lang.Object

buildFieldValueFromForeignKeys(java.util.Vector foreignKeys,
java.lang.String referenceDataTypeName,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Build and return the appropriate field value for the specified
set of foreign keys (i.e. each row has the fields that
make up a foreign key).

buildFieldValueFromNestedRows(java.util.Vector nestedRows,
java.lang.String structureName,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Build and return the appropriate field value for the specified
set of nested rows.

org.eclipse.persistence.internal.sessions.AbstractRecord

buildNestedRowFromFieldValue(java.lang.Object fieldValue)
INTERNAL:
Build and return the nested database row from the specified field value.

java.util.Vector

buildNestedRowsFromFieldValue(java.lang.Object fieldValue,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Build and return the nested rows from the specified field value.

protected void

checkDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session)
To check that tables and fields are present in database

getAdditionalAggregateCollectionKeyFields()
INTERNAL:
additionalAggregateCollectionKeyFields are used by aggregate descriptors to hold additional fields needed when they are stored in an AggregatateCollection
These fields are generally foreign key fields that are required in addition to the fields in the descriptor's
mappings to uniquely identify the Aggregate

getCacheInterceptorClass()
A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction
between EclipseLink and the internal cache for that class will pass through the Interceptor.

java.lang.String

getCacheInterceptorClassName()
A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction
between EclipseLink and the internal cache for that class will pass through the Interceptor.

getDefaultDeleteObjectQueryRedirector()
A Default DeleteObjectQuery Redirector will be applied to any executing
DeleteObjectQuery or DeleteAllQuery that does not have a redirector set directly on the query.

getDefaultQueryRedirector()
A Default Query Redirector will be applied to any executing object query
that does not have a more precise default (like the default
ReadObjectQuery Redirector) or a redirector set directly on the query.

getDefaultUpdateObjectQueryRedirector()
A Default UpdateObjectQuery Redirector will be applied to any executing
UpdateObjectQuery or UpdateAllQuery that does not have a redirector set directly on the query.

setAdditionalTablePrimaryKeyFields(org.eclipse.persistence.internal.helper.DatabaseTable table,
org.eclipse.persistence.internal.helper.DatabaseField field1,
org.eclipse.persistence.internal.helper.DatabaseField field2)
INTERNAL:
This is used to map the primary key field names in a multiple table
descriptor.

void

setAdditionalTablePrimaryKeyFields(java.util.Map<org.eclipse.persistence.internal.helper.DatabaseTable,java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField>> additionalTablePrimaryKeyFields)
INTERNAL:
This is used to map the primary key field names in a multiple table
descriptor.

setCacheInterceptorClass(java.lang.Class cacheInterceptorClass)
PUBLIC:
A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction
between EclipseLink and the internal cache for that class will pass through the Interceptor.

void

setCacheInterceptorClassName(java.lang.String cacheInterceptorClassName)
PUBLIC:
A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction
between EclipseLink and the internal cache for that class will pass through the Interceptor.

setCopyPolicyClassName(java.lang.String className)
INTERNAL:
Sets the name of a Class that implements CopyPolicy
Will be instantiatied as a copy policy at initialization times
using the no-args constructor

setDefaultDeleteObjectQueryRedirectorClassName(java.lang.String defaultDeleteObjectQueryRedirectorClassName)
A Default DeleteObjectQuery Redirector will be applied to any executing
DeleteObjectQuery or DeleteAllQuery that does not have a redirector set directly on the query.

setDefaultInsertObjectQueryRedirectorClassName(java.lang.String defaultInsertObjectQueryRedirectorClassName)
A Default InsertObjectQuery Redirector will be applied to any executing
InsertObjectQuery that does not have a redirector set directly on the query.

void

setDefaultQueryRedirector(QueryRedirector defaultRedirector)
A Default Query Redirector will be applied to any executing object query
that does not have a more precise default (like the default
ReadObjectQuery Redirector) or a redirector set directly on the query.

void

setDefaultQueryRedirectorClassName(java.lang.String defaultQueryRedirectorClassName)
A Default Query Redirector will be applied to any executing object query
that does not have a more precise default (like the default
ReadObjectQuery Redirector) or a redirector set directly on the query.

setDefaultReadAllQueryRedirectorClassName(java.lang.String defaultReadAllQueryRedirectorClassName)
A Default ReadAllQuery Redirector will be applied to any executing
ReadAllQuery that does not have a redirector set directly on the query.

setDefaultReadObjectQueryRedirectorClassName(java.lang.String defaultReadObjectQueryRedirectorClassName)
A Default ReadObjectQuery Redirector will be applied to any executing
ReadObjectQuery that does not have a redirector set directly on the query.

setDefaultReportQueryRedirectorClassName(java.lang.String defaultReportQueryRedirectorClassName)
A Default ReportQuery Redirector will be applied to any executing
ReportQuery that does not have a redirector set directly on the query.

void

setDefaultTable(org.eclipse.persistence.internal.helper.DatabaseTable defaultTable)
INTERNAL:
The descriptors default table can be configured if the first table is not desired.

void

setDefaultTableName(java.lang.String defaultTableName)
PUBLIC:
The descriptors default table can be configured if the first table is not desired.

setDefaultUpdateObjectQueryRedirectorClassName(java.lang.String defaultUpdateObjectQueryRedirectorClassName)
A Default UpdateObjectQuery Redirector will be applied to any executing
UpdateObjectQuery or UpdateAllQuery that does not have a redirector set directly on the query.

setShouldAlwaysRefreshCache(boolean shouldAlwaysRefreshCache)
PUBLIC:
When the shouldAlwaysRefreshCache argument passed into this method is true,
this method configures a ClassDescriptor to always refresh the cache if data is received from
the database by any query.

void

setShouldAlwaysRefreshCacheOnRemote(boolean shouldAlwaysRefreshCacheOnRemote)
PUBLIC:
When the shouldAlwaysRefreshCacheOnRemote argument passed into this method is true,
this method configures a ClassDescriptor to always remotely refresh the cache if data is received from
the database by any query in a RemoteSession.

setShouldRegisterResultsInUnitOfWork(boolean shouldRegisterResultsInUnitOfWork)
INTERNAL:
Set to false to have queries conform to a UnitOfWork without registering
any additional objects not already in that UnitOfWork.

void

setTableName(java.lang.String tableName)
PUBLIC:
Specify the table name for the class of objects the receiver describes.

void

setTableNames(java.util.Vector tableNames)
PUBLIC:
Specify the all table names for the class of objects the receiver describes.

shouldOnlyRefreshCacheIfNewerVersion()
PUBLIC:
This method returns true if the ClassDescriptor is configured to only refresh the cache
if the data received from the database by a query is newer than the data in the cache (as determined by the
optimistic locking field).

useFactoryInstantiationPolicy(java.lang.Class factoryClass,
java.lang.String methodName)
PUBLIC:
Use an object factory to create new instances of objects built from the database.

void

useFactoryInstantiationPolicy(java.lang.Class factoryClass,
java.lang.String methodName,
java.lang.String factoryMethodName)
PUBLIC:
Use an object factory to create new instances of objects built from the database.

void

useFactoryInstantiationPolicy(java.lang.Object factory,
java.lang.String methodName)
PUBLIC:
Use an object factory to create new instances of objects built from the database.

void

useFactoryInstantiationPolicy(java.lang.String factoryClassName,
java.lang.String methodName)
INTERNAL:
Set the factory class name, used by the MW.

void

useFactoryInstantiationPolicy(java.lang.String factoryClassName,
java.lang.String methodName,
java.lang.String factoryMethodName)
INTERNAL:
Set the factory class name, used by the MW.

useInstantiationCopyPolicy()
PUBLIC:
Specifies that the creation of clones within a unit of work is done by building
a new instance using the
technique indicated by the descriptor's instantiation policy
(which by default is to use the
the default constructor).

void

useMethodInstantiationPolicy(java.lang.String staticMethodName)
PUBLIC:
Use the specified static method to create new instances of objects built from the database.

void

useNoIdentityMap()
PUBLIC:
Set the class of identity map to be the no identity map.

additionalAggregateCollectionKeyFields

used by aggregate descriptors to hold additional fields needed when they are stored in an AggregatateCollection
These fields are generally foreign key fields that are required in addition to the fields in the descriptor's
mappings to uniquely identify the Aggregate

preDeleteMappings

stores a list of mappings that require preDelete as a group prior to the delete individually

Constructor Detail

ClassDescriptor

public ClassDescriptor()

PUBLIC:
Return a new descriptor.

Method Detail

addAbstractQueryKey

public void addAbstractQueryKey(java.lang.String queryKeyName)

PUBLIC:
This method should only be used for interface descriptors. It
adds an abstract query key to the interface descriptor. Any
implementors of that interface must define the query key
defined by this abstract query key.

addCascadeLockingPolicy

INTERNAL:
Add the cascade locking policy to all children that have a relationship to this descriptor
either by inheritance or by encapsulation/aggregation.

Parameters:

policy - - the CascadeLockingPolicy

addConstraintDependencies

public void addConstraintDependencies(java.lang.Class dependencies)

ADVANCED:
EclipseLink automatically orders database access through the foreign key information provided in 1:1 and 1:m mappings.
In some case when 1:1 are not defined it may be required to tell the descriptor about a constraint,
this defines that this descriptor has a foreign key constraint to another class and must be inserted after
instances of the other class.

addConstraintDependency

public void addConstraintDependency(java.lang.Class dependencies)

ADVANCED:
EclipseLink automatically orders database access through the foreign key information provided in 1:1 and 1:m mappings.
In some case when 1:1 are not defined it may be required to tell the descriptor about a constraint,
this defines that this descriptor has a foreign key constraint to another class and must be inserted after
instances of the other class.

addDirectMapping

PUBLIC:
Add a direct to field mapping to the receiver. The new mapping specifies that
an instance variable of the class of objects which the receiver describes maps in
the default manner for its type to the indicated database field.

Parameters:

attributeName - is the name of an instance variable of the
class which the receiver describes.

fieldName - is the name of the database column which corresponds
with the designated instance variable.

Returns:

The newly created DatabaseMapping is returned.

addDirectMapping

PUBLIC:
Add a direct to field mapping to the receiver. The new mapping specifies that
a variable accessed by the get and set methods of the class of objects which
the receiver describes maps in the default manner for its type to the indicated
database field.

addForeignKeyFieldNameForMultipleTable

PUBLIC:
This protocol can be used to associate multiple tables with foreign key
information. Use this method to associate secondary tables to a
primary table. Specify the source foreign key field to the target
primary key field. The join criteria will be generated based on the
fields provided. Unless the customary insert order is specified by the user
(using setMultipleTableInsertOrder method)
the (automatically generated) table insert order will ensure that
insert into target table happens before insert into the source table
(there may be a foreign key constraint in the database that requires
target table to be inserted before the source table).

PUBLIC:
This protocol can be used to associate multiple tables with foreign key
information. Use this method to associate secondary tables to a
primary table. Specify the source foreign key field to the target
primary key field. The join criteria will be generated based on the
fields provided.

validateMappingType

addPrimaryKeyFieldName

public void addPrimaryKeyFieldName(java.lang.String fieldName)

PUBLIC:
Specify the primary key field of the descriptors table.
This should be called for each field that makes up the primary key of the table.
If the descriptor has many tables, this must be the primary key in the first table,
if the other tables have the same primary key nothing else is required, otherwise
a primary key/foreign key field mapping must be provided for each of the other tables.

See Also:

#addMultipleTableForeignKeyFieldName(String, String);

addPrimaryKeyField

ADVANCED:
Specify the primary key field of the descriptors table.
This should be called for each field that makes up the primary key of the table.
This can be used for advanced field types, such as XML nodes, or to set the field type.

addTable

PUBLIC:
Specify the table for the class of objects the receiver describes.
This method is used if there is more than one table.

addTableName

public void addTableName(java.lang.String tableName)

PUBLIC:
Specify the table name for the class of objects the receiver describes.
If the table has a qualifier it should be specified using the dot notation,
(i.e. "userid.employee"). This method is used if there is more than one table.

adjustMultipleTableInsertOrder

public void adjustMultipleTableInsertOrder()

INTERNAL:
Adjust the order of the tables in the multipleTableInsertOrder Vector according to the FK
relationship if one (or more) were previously specified. I.e. target of FK relationship should be inserted
before source.
If the multipleTableInsertOrder has been specified (presumably by the user) then do not change it.

alwaysConformResultsInUnitOfWork

public void alwaysConformResultsInUnitOfWork()

PUBLIC:
Used to set the descriptor to always conform in any unit of work query.

alwaysRefreshCache

public void alwaysRefreshCache()

PUBLIC:
This method is the equivalent of calling setShouldAlwaysRefreshCache(boolean) with an argument of true:
it configures a ClassDescriptor to always refresh the cache if data is received from the database by any query.

However, if a query hits the cache, data is not refreshed regardless of how this setting is configured. For example, by
default, when a query for a single object based on its primary key is executed, OracleAS TopLink will first look in the
cache for the object. If the object is in the cache, the cached object is returned and data is not refreshed. To avoid
cache hits, use the disableCacheHits() method.

Also note that the UnitOfWork will not refresh its registered objects.

However, if a query hits the cache, data is not refreshed regardless of how this setting is configured. For example, by
default, when a query for a single object based on its primary key is executed, OracleAS TopLink will first look in the
cache for the object. If the object is in the cache, the cached object is returned and data is not refreshed. To avoid
cache hits, use the disableCacheHitsOnRemote() method.

Also note that the UnitOfWork will not refresh its registered objects.

buildField

INTERNAL:
The table of the field is ensured to be unique from the descriptor's tables.
If the field has no table the default table is assigned.
This is used only in initialization.
Fields are ensured to be unique so if the field has already been built it is returned.

createMultipleTableInsertOrder

protected void createMultipleTableInsertOrder()

INTERNAL:
Create multiple table insert order.
If its a child descriptor then insert order starts
with the same insert order as in the parent.
Non-inherited tables ordered to adhere to
multipleTableForeignKeys:
the target table (the key in multipleTableForeignKeys map)
should stand in insert order before any of the source tables
(members of the corresponding value in multipleTableForeignKeys).

verifyMultipleTableInsertOrder

protected void verifyMultipleTableInsertOrder()

INTERNAL:
Verify multiple table insert order provided by the user.
If its a child descriptor then insert order starts
with the same insert order as in the parent.
Non-inherited tables ordered to adhere to
multipleTableForeignKeys:
the target table (the key in multipleTableForeignKeys map)
should stand in insert order before any of the source tables
(members of the corresponding value in multipleTableForeignKeys).

verifyMultipleTablesForeignKeysTables

protected void verifyMultipleTablesForeignKeysTables()

INTERNAL:
Verify that the tables specified in multipleTablesForeignKeysTables are valid.

createTableOrder

INTERNAL:
This helper method recursively puts indexes from 0 to nTables-1 into tableOrder according to tableComparison 2 dim array.
k is index in tableOrder that currently the method is working on - the method should be called with k = 0.

clone

public java.lang.Object clone()

INTERNAL:
Clones the descriptor

Overrides:

clone in class java.lang.Object

convertClassNamesToClasses

INTERNAL:
Convert all the class-name-based settings in this Descriptor 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.

Parameters:

classLoader -

createCopyPolicy

public void createCopyPolicy(java.lang.String policyType)

PUBLIC:
Create a copy policy of the type passed in as a string.

createInstantiationPolicy

public void createInstantiationPolicy(java.lang.String policyType)

PUBLIC:
Create a instantiation policy of the type passed in as a string.

descriptorIsAggregate

public void descriptorIsAggregate()

PUBLIC:
Sets the descriptor to be an aggregate.
An aggregate descriptor is contained within another descriptor's table.
Aggregate descriptors are insert/updated/deleted with their owner and cannot exist without their owner as they share the same row.
Aggregates are not cached (they are cached as part of their owner) and cannot be read/written/deleted/registered.
All aggregate descriptors must call this.

descriptorIsAggregateCollection

public void descriptorIsAggregateCollection()

PUBLIC:
Sets the descriptor to be part of an aggregate collection.
An aggregate collection descriptor stored in a separate table but some of the fields (the primary key) comes from its owner.
Aggregate collection descriptors are insert/updated/deleted with their owner and cannot exist without their owner as they share the primary key.
Aggregate collections are not cached (they are cached as part of their owner) and cannot be read/written/deleted/registered.
All aggregate collection descriptors must call this.

descriptorIsForInterface

public void descriptorIsForInterface()

PUBLIC:
Sets the descriptor to be for an interface.
An interface descriptor allows for other classes to reference an interface or one of several other classes.
The implementor classes can be completely unrelated in term of the database stored in distinct tables.
Queries can also be done for the interface which will query each of the implementor classes.
An interface descriptor cannot define any mappings as an interface is just API and not state,
a interface descriptor should define the common query key of its implementors to allow querying.
An interface descriptor also does not define a primary key or table or other settings.
If an interface only has a single implementor (i.e. a classes public interface or remote) then an interface
descriptor should not be defined for it and relationships should be to the implementor class not the interface,
in this case the implementor class can add the interface through its interface policy to map queries on the interface to it.

descriptorIsNormal

public void descriptorIsNormal()

PUBLIC:
Sets the descriptor to be normal.
This is the default and means the descriptor is not aggregate or for an interface.

disableCacheHitsOnRemote

public void disableCacheHitsOnRemote()

PUBLIC:
Allow for remote session cache hits on primary key read object queries to be disabled.
This can be used with alwaysRefreshCacheOnRemote() to ensure queries always go to the server session cache.

dontAlwaysConformResultsInUnitOfWork

PUBLIC:
The descriptor is defined to not conform the results in unit of work in read query. Default.

dontAlwaysRefreshCache

public void dontAlwaysRefreshCache()

PUBLIC:
This method is the equivalent of calling setShouldAlwaysRefreshCache(boolean) with an argument of false:
it ensures that a ClassDescriptor is not configured to always refresh the cache if data is received from the database by any query.

dontDisableCacheHitsOnRemote

dontOnlyRefreshCacheIfNewerVersion

public void dontOnlyRefreshCacheIfNewerVersion()

PUBLIC:
This method is the equivalent of calling setShouldOnlyRefreshCacheIfNewerVersion(boolean) with an argument of false:
it ensures that a ClassDescriptor is not configured to only refresh the cache if the data received from the database by
a query is newer than the data in the cache (as determined by the optimistic locking field).

extractDefaultTable

getAdditionalAggregateCollectionKeyFields

public java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getAdditionalAggregateCollectionKeyFields()

INTERNAL:
additionalAggregateCollectionKeyFields are used by aggregate descriptors to hold additional fields needed when they are stored in an AggregatateCollection
These fields are generally foreign key fields that are required in addition to the fields in the descriptor's
mappings to uniquely identify the Aggregate

Returns:

getAdditionalTablePrimaryKeyFields

public java.util.Map<org.eclipse.persistence.internal.helper.DatabaseTable,java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField>> getAdditionalTablePrimaryKeyFields()

INTERNAL:
This is used to map the primary key field names in a multiple table descriptor.

getAlias

public java.lang.String getAlias()

PUBLIC:
Get the alias

getAllFields

public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getAllFields()

INTERNAL:
Return all the fields which include all child class fields.
By default it is initialized to the fields for the current descriptor.

getAmendmentClass

public java.lang.Class getAmendmentClass()

PUBLIC:
Return the amendment class.
The amendment method will be called on the class before initialization to allow for it to initialize the descriptor.
The method must be a public static method on the class.

getAmendmentClassName

public java.lang.String getAmendmentClassName()

INTERNAL:
Return amendment class name, used by the MW.

getAmendmentMethodName

public java.lang.String getAmendmentMethodName()

PUBLIC:
Return the amendment method.
This will be called on the amendment class before initialization to allow for it to initialize the descriptor.
The method must be a public static method on the class.

getHistoryPolicy

getCacheInterceptorClass

public java.lang.Class getCacheInterceptorClass()

A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction
between EclipseLink and the internal cache for that class will pass through the Interceptor.
Advanced users could use this interceptor to audit, profile or log cache access. This Interceptor
could also be used to redirect or augment the TopLink cache with an alternate cache mechanism.
EclipseLink's configurated IdentityMaps will be passed to the Interceptor constructor.
As with IdentityMaps an entire class inheritance heirachy will share the same interceptor.

getCacheInterceptorClassName

public java.lang.String getCacheInterceptorClassName()

A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction
between EclipseLink and the internal cache for that class will pass through the Interceptor.
Advanced users could use this interceptor to audit, profile or log cache access. This Interceptor
could also be used to redirect or augment the TopLink cache with an alternate cache mechanism.
EclipseLink's configurated IdentityMaps will be passed to the Interceptor constructor.
As with IdentityMaps an entire class inheritance heirachy will share the same interceptor.

getCacheSynchronizationType

public int getCacheSynchronizationType()

PUBLIC:
Get a value indicating the type of cache synchronization that will be used on objects of
this type. Possible values are:
SEND_OBJECT_CHANGES
INVALIDATE_CHANGED_OBJECTS
SEND_NEW_OBJECTS+WITH_CHANGES
DO_NOT_SEND_CHANGES

Returns:

int

getCascadeLockingPolicies

public java.util.Vector getCascadeLockingPolicies()

INTERNAL:

getConstraintDependencies

public java.util.Vector getConstraintDependencies()

ADVANCED:
automatically orders database access through the foreign key information provided in 1:1 and 1:m mappings.
In some case when 1:1 are not defined it may be required to tell the descriptor about a constraint,
this defines that this descriptor has a foreign key constraint to another class and must be inserted after
instances of the other class.

getIdentityMapSize

getDescriptorInheritancePolicy

PUBLIC:
The inheritance policy is used to define how a descriptor takes part in inheritance.
All inheritance properties for both child and parent classes is configured in inheritance policy.
Caution must be used in using this method as it lazy initializes an inheritance policy.
Calling this on a descriptor that does not use inheritance will cause problems, #hasInheritance() must always first be called.

getInheritancePolicy

PUBLIC:
The inheritance policy is used to define how a descriptor takes part in inheritance.
All inheritance properties for both child and parent classes is configured in inheritance policy.
Caution must be used in using this method as it lazy initializes an inheritance policy.
Calling this on a descriptor that does not use inheritance will cause problems, #hasInheritance() must always first be called.

getInstantiationPolicy

getInterfacePolicy

PUBLIC:
Returns the InterfacePolicy.
The interface policy allows for a descriptor's public and variable interfaces to be defined.
Caution must be used in using this method as it lazy initializes an interface policy.
Calling this on a descriptor that does not use interfaces will cause problems, #hasInterfacePolicy() must always first be called.

getMultipleTableForeignKeys

public java.util.Map<org.eclipse.persistence.internal.helper.DatabaseTable,java.util.Set<org.eclipse.persistence.internal.helper.DatabaseTable>> getMultipleTableForeignKeys()

INTERNAL:
Returns the foreign key relationships used for multiple tables which were specified by the user. The key
of the Map is the field in the source table of the foreign key relationship. The value is the field
name of the target table.

getTableNames

getTablePerClassPolicy

PUBLIC:
Returns the TablePerClassPolicy.
The table per class policy allows JPA users to configure the
TABLE_PER_CLASS inheritance strategy. Calling this on a descriptor that
does not use table per class will cause problems,
#hasTablePerClassPolicy() must always first be called.

See Also:

setTablePerClassPolicy()

getTables

public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseTable> getTables()

initializeAggregateInheritancePolicy

INTERNAL:
This initialized method is used exclusively for inheritance. It passes in
true if the child descriptor is isolated.
This is needed by regular aggregate descriptors (because they require review);
but not by SDK aggregate descriptors.

isPrimaryKeySetAfterInsert

INTERNAL:
Indicates whether pk or some of its components
set after insert into the database.
Shouldn't be called before ClassDescriptor has been initialized.

shouldUseFullChangeSetsForNewObjects

public boolean shouldUseFullChangeSetsForNewObjects()

INTERNAL:
Return if change sets are required for new objects.

onlyRefreshCacheIfNewerVersion

public void onlyRefreshCacheIfNewerVersion()

PUBLIC:
This method is the equivalent of calling setShouldOnlyRefreshCacheIfNewerVersion(boolean) with an argument of true:
it configures a ClassDescriptor to only refresh the cache if the data received from the database by a query is newer than
the data in the cache (as determined by the optimistic locking field) and as long as one of the following is true:

However, if a query hits the cache, data is not refreshed regardless of how this setting is configured. For example, by default,
when a query for a single object based on its primary key is executed, EclipseLink will first look in the cache for the object.
If the object is in the cache, the cached object is returned and data is not refreshed. To avoid cache hits, use
the disableCacheHits() method.

Also note that the UnitOfWork will not refresh its registered objects.

rehashFieldDependancies

INTERNAL:
Rehash any hashtables based on fields.
This is used to clone descriptors for aggregates, which hammer field names,
it is probably better not to hammer the field name and this should be refactored.

reInitializeJoinedAttributes

public void reInitializeJoinedAttributes()

INTERNAL:
A user should not be setting which attributes to join or not to join
after descriptor initialization; provided only for backwards compatibility.

INTERNAL:
This is used to map the primary key field names in a multiple table
descriptor.

toggleAdditionalTablePrimaryKeyFields

protected void toggleAdditionalTablePrimaryKeyFields()

INTERNAL:
Eclipselink needs additionalTablePKFields entries to be associated with tables other than the main (getTables.get(0)) one.
Also in case of two non-main tables additionalTablePKFields entry should be associated with the one
father down insert order.

setAllFields

setAmendmentClass

public void setAmendmentClass(java.lang.Class amendmentClass)

PUBLIC:
Set the amendment class.
The amendment method will be called on the class before initialization to allow for it to initialize the descriptor.
The method must be a public static method on the class.

setAmendmentMethodName

PUBLIC:
Set the amendment method.
This will be called on the amendment class before initialization to allow for it to initialize the descriptor.
The method must be a public static method on the class.

setCacheSynchronizationType

public void setCacheSynchronizationType(int type)

PUBLIC:
Set the type of cache synchronization that will be used on objects of this type. Possible values
are:
SEND_OBJECT_CHANGES
INVALIDATE_CHANGED_OBJECTS
SEND_NEW_OBJECTS_WITH_CHANGES
DO_NOT_SEND_CHANGES
Note: Cache Synchronization type cannot be altered for descriptors that are set as isolated using
the setIsIsolated method.

setHistoryPolicy

setCacheInterceptorClass

PUBLIC:
A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction
between EclipseLink and the internal cache for that class will pass through the Interceptor.
Advanced users could use this interceptor to audit, profile or log cache access. This Interceptor
could also be used to redirect or augment the TopLink cache with an alternate cache mechanism.
EclipseLink's configurated IdentityMaps will be passed to the Interceptor constructor.
As with IdentityMaps an entire class inheritance heirachy will share the same interceptor.

setCacheInterceptorClassName

PUBLIC:
A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction
between EclipseLink and the internal cache for that class will pass through the Interceptor.
Advanced users could use this interceptor to audit, profile or log cache access. This Interceptor
could also be used to redirect or augment the TopLink cache with an alternate cache mechanism.
EclipseLink's configurated IdentityMaps will be passed to the Interceptor constructor.
As with IdentityMaps an entire class inheritance heirachy will share the same interceptor.

setConstraintDependencies

ADVANCED:
automatically orders database access through the foreign key information provided in 1:1 and 1:m mappings.
In some case when 1:1 are not defined it may be required to tell the descriptor about a constraint,
this defines that this descriptor has a foreign key constraint to another class and must be inserted after
instances of the other class.

setInternalDefaultTable

INTERNAL:
Set the default table if one if not already set. This method will set
the table that is provided as the default.

setIsIsolated

public void setIsIsolated(boolean isIsolated)

PUBLIC:
Used to set if the class that this descriptor represents should be isolated from the shared cache.
Isolated objects will only be cached locally in the ClientSession, never in the ServerSession cache.
This is the best method for disabling caching.
Isolated objects cannot be referenced by non-isolated (shared) objects.
Note: Calling this method with true will also set the cacheSynchronizationType to DO_NOT_SEND_CHANGES
since isolated objects cannot be sent by cache synchronization.

shouldIsolateObjectsInUnitOfWork

public boolean shouldIsolateObjectsInUnitOfWork()

INTERNAL:
Return if the unit of work should by-pass the session cache.
Objects will be built in the unit of work, and never merged into the session cache.

shouldIsolateObjectsInUnitOfWorkEarlyTransaction

public boolean shouldIsolateObjectsInUnitOfWorkEarlyTransaction()

INTERNAL:
Return if the unit of work should by-pass the session cache after an early transaction.

shouldUseSessionCacheInUnitOfWorkEarlyTransaction

public boolean shouldUseSessionCacheInUnitOfWorkEarlyTransaction()

INTERNAL:
Return if the unit of work should use the session cache after an early transaction.

getUnitOfWorkCacheIsolationLevel

public int getUnitOfWorkCacheIsolationLevel()

ADVANCED:
Return the unit of work cache isolation setting.
This setting configures how the session cache will be used in a unit of work.

setUnitOfWorkCacheIsolationLevel

ADVANCED:
This setting configures how the session cache will be used in a unit of work.
Most of the options only apply to a unit of work in an early transaction,
such as a unit of work that was flushed (writeChanges), issued a modify query, or acquired a pessimistic lock.

USE_SESSION_CACHE_AFTER_TRANSACTION - Objects built from new data accessed after a unit of work early transaction are stored in the session cache.
This options is the most efficient as it allows the cache to be used after an early transaction.
This should only be used if it is known that this class is not modified in the transaction,
otherwise this could cause uncommitted data to be loaded into the session cache.
ISOLATE_NEW_DATA_AFTER_TRANSACTION - Default (when using caching): Objects built from new data accessed after a unit of work early transaction are only stored in the unit of work.
This still allows previously cached objects to be accessed in the unit of work after an early transaction,
but ensures uncommitted data will never be put in the session cache by storing any object built from new data only in the unit of work.
ISOLATE_CACHE_AFTER_TRANSACTION - After a unit of work early transaction the session cache is no longer used for this class.
Objects will be directly built from the database data and only stored in the unit of work, even if previously cached.
Note that this may lead to poor performance as the session cache is bypassed after an early transaction.
ISOLATE_CACHE_ALWAYS - Default (when using isolated cache): The session cache will never be used for this class.
Objects will be directly built from the database data and only stored in the unit of work.
New objects and changes will also never be merged into the session cache.
Note that this may lead to poor performance as the session cache is bypassed,
however if this class is isolated or pessimistic locked and always accessed in a transaction, this can avoid having to build two copies of the object.

setJavaClass

public void setJavaClass(java.lang.Class theJavaClass)

PUBLIC:
Set the Java class that this descriptor maps.
Every descriptor maps one and only one class.

setJavaClassName

public void setJavaClassName(java.lang.String theJavaClassName)

INTERNAL:
Return the java class name, used by the MW.

setJavaInterface

public void setJavaInterface(java.lang.Class theJavaInterface)

PUBLIC:
Sets the descriptor to be for an interface.
An interface descriptor allows for other classes to reference an interface or one of several other classes.
The implementor classes can be completely unrelated in term of the database stored in distinct tables.
Queries can also be done for the interface which will query each of the implementor classes.
An interface descriptor cannot define any mappings as an interface is just API and not state,
a interface descriptor should define the common query key of its implementors to allow querying.
An interface descriptor also does not define a primary key or table or other settings.
If an interface only has a single implementor (i.e. a classes public interface or remote) then an interface
descriptor should not be defined for it and relationships should be to the implementor class not the interface,
in this case the implementor class can add the interface through its interface policy to map queries on the interface to it.

setPrimaryKeyFieldName

public void setPrimaryKeyFieldName(java.lang.String fieldName)

PUBLIC:
Specify the primary key field of the descriptors table.
This should only be called if it is a singlton primary key field,
otherwise addPrimaryKeyFieldName should be called.
If the descriptor has many tables, this must be the primary key in all of the tables.

setSequenceNumberFieldName

PUBLIC:
Set the sequence number field name.
This is the field in the descriptors table that needs its value to be generated.
This is normally the primary key field of the descriptor.

setSequenceNumberName

public void setSequenceNumberName(java.lang.String name)

PUBLIC:
Set the sequence number name.
This is the seq_name part of the row stored in the sequence table for this descriptor.
If using Oracle native sequencing this is the name of the Oracle sequence object.
If using Sybase native sequencing this name has no meaning, but should still be set for compatibility.
The name does not have to be unique among descriptors, as having descriptors share sequences can
improve pre-allocation performance.

setSessionName

protected void setSessionName(java.lang.String sessionName)

INTERNAL:
Set the name of the session local to this descriptor.
This is used by the session broker.

setShouldAlwaysRefreshCache

PUBLIC:
When the shouldAlwaysRefreshCache argument passed into this method is true,
this method configures a ClassDescriptor to always refresh the cache if data is received from
the database by any query.

However, if a query hits the cache, data is not refreshed regardless of how this setting is configured.
For example, by default, when a query for a single object based on its primary key is executed, OracleAS TopLink
will first look in the cache for the object. If the object is in the cache, the cached object is returned and
data is not refreshed. To avoid cache hits, use the disableCacheHits() method.

Also note that the UnitOfWork will not refresh its registered objects.

When the shouldAlwaysRefreshCache argument passed into this method is false, this method
ensures that a ClassDescriptor is not configured to always refresh the cache if data is received from the database by any query.

setShouldAlwaysRefreshCacheOnRemote

PUBLIC:
When the shouldAlwaysRefreshCacheOnRemote argument passed into this method is true,
this method configures a ClassDescriptor to always remotely refresh the cache if data is received from
the database by any query in a RemoteSession.
However, if a query hits the cache, data is not refreshed regardless of how this setting is configured. For
example, by default, when a query for a single object based on its primary key is executed, OracleAS TopLink
will first look in the cache for the object. If the object is in the cache, the cached object is returned and
data is not refreshed. To avoid cache hits, use the disableCacheHitsOnRemote() method.

Also note that the UnitOfWork will not refresh its registered objects.

When the shouldAlwaysRefreshCacheOnRemote argument passed into this method is false,
this method ensures that a ClassDescriptor is not configured to always remotely refresh the cache if data
is received from the database by any query in a RemoteSession.

setShouldBeReadOnly

public void setShouldBeReadOnly(boolean shouldBeReadOnly)

PUBLIC:
Define if the descriptor reference class is read-only

setReadOnly

public void setReadOnly()

PUBLIC:
Set the descriptor to be read-only.
Declaring a descriptor is read-only means that instances of the reference class will never be modified.
Read-only descriptor is usually used in the unit of work to gain performance as there is no need for
the registration, clone and merge for the read-only classes.

setShouldDisableCacheHits

public void setShouldDisableCacheHits(boolean shouldDisableCacheHits)

PUBLIC:
Set if cache hits on primary key read object queries should be disabled.

setShouldOnlyRefreshCacheIfNewerVersion

PUBLIC:
When the shouldOnlyRefreshCacheIfNewerVersion argument passed into this method is true,
this method configures a ClassDescriptor to only refresh the cache if the data received from the database
by a query is newer than the data in the cache (as determined by the optimistic locking field) and as long as one of the following is true:

However, if a query hits the cache, data is not refreshed regardless of how this setting is configured. For example, by default,
when a query for a single object based on its primary key is executed, OracleAS TopLink will first look in the cache for the object.
If the object is in the cache, the cached object is returned and data is not refreshed. To avoid cache hits, use
the disableCacheHits() method.

Also note that the UnitOfWork will not refresh its registered objects.

When the shouldOnlyRefreshCacheIfNewerVersion argument passed into this method is false, this method
ensures that a ClassDescriptor is not configured to only refresh the cache if the data received from the database by a
query is newer than the data in the cache (as determined by the optimistic locking field).

setShouldOrderMappings

public void setShouldOrderMappings(boolean shouldOrderMappings)

PUBLIC:
This is set to turn off the ordering of mappings. By Default this is set to true.
By ordering the mappings insures that object are merged in the right order.
If the order of the mappings needs to be specified by the developer then set this to
false and will use the order that the mappings were added to the descriptor

setTableName

PUBLIC:
Specify the table name for the class of objects the receiver describes.
If the table has a qualifier it should be specified using the dot notation,
(i.e. "userid.employee"). This method is used for single table.

setTableNames

public void setTableNames(java.util.Vector tableNames)

PUBLIC:
Specify the all table names for the class of objects the receiver describes.
If the table has a qualifier it should be specified using the dot notation,
(i.e. "userid.employee"). This method is used for multiple tables

shouldAlwaysRefreshCacheOnRemote

public boolean shouldAlwaysRefreshCacheOnRemote()

PUBLIC:
This method returns true if the ClassDescriptor is configured to always remotely
refresh the cache if data is received from the database by any query in a RemoteSession.
Otherwise, it returns false.

shouldDisableCacheHitsOnRemote

shouldOnlyRefreshCacheIfNewerVersion

public boolean shouldOnlyRefreshCacheIfNewerVersion()

PUBLIC:
This method returns true if the ClassDescriptor is configured to only refresh the cache
if the data received from the database by a query is newer than the data in the cache (as determined by the
optimistic locking field). Otherwise, it returns false.

setShouldAcquireCascadedLocks

INTERNAL:
PERF: Set if deferred locks should be used.
This is determined based on if any relationships do not use indirection,
but this provides a backdoor hook to force on if require because of events usage etc.

shouldUseCacheIdentityMap

public boolean shouldUseCacheIdentityMap()

PUBLIC:
Return true if this descriptor is using CacheIdentityMap

shouldUseFullIdentityMap

public boolean shouldUseFullIdentityMap()

PUBLIC:
Return true if this descriptor is using FullIdentityMap

shouldUseSoftIdentityMap

public boolean shouldUseSoftIdentityMap()

PUBLIC:
Return true if this descriptor is using SoftIdentityMap

shouldUseRemoteSoftIdentityMap

public boolean shouldUseRemoteSoftIdentityMap()

PUBLIC:
Return true if this descriptor is using SoftIdentityMap

shouldUseHardCacheWeakIdentityMap

public boolean shouldUseHardCacheWeakIdentityMap()

PUBLIC:
Return true if this descriptor is using HardCacheWeakIdentityMap.

shouldUseNoIdentityMap

public boolean shouldUseNoIdentityMap()

PUBLIC:
Return true if this descriptor is using NoIdentityMap

shouldRegisterResultsInUnitOfWork

public boolean shouldRegisterResultsInUnitOfWork()

INTERNAL:
Allows one to do conforming in a UnitOfWork without registering.
Queries executed on a UnitOfWork will only return working copies for objects
that have already been registered.

Extreme care should be taken in using this feature, for a user will
get back a mix of registered and original (unregistered) objects.

Best used with a WrapperPolicy where invoking on an object will trigger
its registration (CMP). Without a WrapperPolicy registerExistingObject
should be called on any object that you intend to change.

shouldUseWeakIdentityMap

supportsChangeTracking

INTERNAL:
Returns whether this descriptor is capable of supporting weaved change tracking.
This method is used before the project is initialized.

toString

public java.lang.String toString()

PUBLIC:
Returns a brief string representation of the receiver.

Overrides:

toString in class java.lang.Object

useAllFieldsLocking

public void useAllFieldsLocking()

PUBLIC:
Set the locking policy an all fields locking policy.
A field locking policy is base on locking on all fields by comparing with their previous values to detect field-level collisions.
Note: the unit of work must be used for all updates when using field locking.

useCacheIdentityMap

public void useCacheIdentityMap()

PUBLIC:
Set the class of identity map to be the cache identity map.
This map caches the LRU instances read from the database.
Note: This map does not guarantee object identity.
The default is the "SoftCacheWeakIdentityMap".

useChangedFieldsLocking

public void useChangedFieldsLocking()

PUBLIC:
Set the locking policy a changed fields locking policy.
A field locking policy is base on locking on all changed fields by comparing with their previous values to detect field-level collisions.
Note: the unit of work must be used for all updates when using field locking.

useCloneCopyPolicy

public void useCloneCopyPolicy()

PUBLIC:
Specifies that the creation of clones within a unit of work is done by
sending the #clone() method to the original object. The #clone() method
must return a logical shallow copy of the original object.
This can be used if the default mechanism of creating a new instance
does not handle the object's non-persistent attributes correctly.

useCloneCopyPolicy

public void useCloneCopyPolicy(java.lang.String cloneMethodName)

PUBLIC:
Specifies that the creation of clones within a unit of work is done by
sending the cloneMethodName method to the original object. This method
must return a logical shallow copy of the original object.
This can be used if the default mechanism of creating a new instance
does not handle the object's non-persistent attributes correctly.

useInstantiationCopyPolicy

public void useInstantiationCopyPolicy()

PUBLIC:
Specifies that the creation of clones within a unit of work is done by building
a new instance using the
technique indicated by the descriptor's instantiation policy
(which by default is to use the
the default constructor). This new instance is then populated by using the
descriptor's mappings to copy attributes from the original to the clone.
This is the default.
If another mechanism is desired the copy policy allows for a clone method to be called.

useDefaultConstructorInstantiationPolicy

public void useDefaultConstructorInstantiationPolicy()

PUBLIC:
Use the default constructor to create new instances of objects built from the database.
This is the default.
The descriptor's class must either define a default constructor or define
no constructors at all.

useFactoryInstantiationPolicy

PUBLIC:
Use an object factory to create new instances of objects built from the database.
The methodName is the name of the
method that will be invoked on the factory. When invoked, it must return a new instance
of the descriptor's class.
The factory will be created by invoking the factoryClass's default constructor.

useFactoryInstantiationPolicy

PUBLIC:
Use an object factory to create new instances of objects built from the database.
The factoryMethodName is a static method declared by the factoryClass.
When invoked, it must return an instance of the factory. The methodName is the name of the
method that will be invoked on the factory. When invoked, it must return a new instance
of the descriptor's class.

useFactoryInstantiationPolicy

PUBLIC:
Use an object factory to create new instances of objects built from the database.
The methodName is the name of the
method that will be invoked on the factory. When invoked, it must return a new instance
of the descriptor's class.

useFullIdentityMap

PUBLIC:
Set the class of identity map to be the full identity map.
This map caches all instances read and grows to accomodate them.
The default is the "SoftCacheWeakIdentityMap".

useHardCacheWeakIdentityMap

public void useHardCacheWeakIdentityMap()

PUBLIC:
Set the class of identity map to be the hard cache weak identity map.
This map uses weak references to only cache object in-memory.
It also includes a secondary fixed sized hard cache to improve caching performance.
This is provided because some Java VM's implement soft references differently.
The default is the "SoftCacheWeakIdentityMap".

useSoftIdentityMap

public void useSoftIdentityMap()

PUBLIC:
Set the class of identity map to be the soft identity map.
This map uses soft references to only cache all object in-memory, until memory is low.
Note that "low" is interpreted differently by different JVM's.
The default is the "SoftCacheWeakIdentityMap".

useRemoteSoftIdentityMap

public void useRemoteSoftIdentityMap()

PUBLIC:
Set the class of identity map to be the soft identity map.
This map uses soft references to only cache all object in-memory, until memory is low.
Note that "low" is interpreted differently by different JVM's.
The default is the "SoftCacheWeakIdentityMap".

useMethodInstantiationPolicy

PUBLIC:
Use the specified static method to create new instances of objects built from the database.
This method must be statically declared by the descriptor's class, and it must
return a new instance of the descriptor's class.

useNoIdentityMap

public void useNoIdentityMap()

PUBLIC:
Set the class of identity map to be the no identity map.
This map does no caching.
Note: This map does not maintain object identity.
In general if caching is not desired a WeakIdentityMap should be used with an isolated descriptor.
The default is the "SoftCacheWeakIdentityMap".

useRemoteCacheIdentityMap

PUBLIC:
Set the class of identity map to be the cache identity map.
This map caches the LRU instances read from the database.
The default is the "SoftCacheWeakIdentityMap".

useRemoteFullIdentityMap

public void useRemoteFullIdentityMap()

PUBLIC:
Set the class of identity map to be the full identity map.
This map caches all instances read and grows to accomodate them.
The default is the "SoftCacheWeakIdentityMap".

useRemoteHardCacheWeakIdentityMap

public void useRemoteHardCacheWeakIdentityMap()

PUBLIC:
Set the class of identity map to be the hard cache weak identity map.
This map uses weak references to only cache object in-memory.
It also includes a secondary fixed sized soft cache to improve caching performance.
This is provided because some Java VM's do not implement soft references correctly.
The default is the "SoftCacheWeakIdentityMap".

useRemoteNoIdentityMap

public void useRemoteNoIdentityMap()

PUBLIC:
Set the class of identity map to be the no identity map.
This map does no caching.
The default is the "SoftCacheWeakIdentityMap".

useRemoteSoftCacheWeakIdentityMap

public void useRemoteSoftCacheWeakIdentityMap()

PUBLIC:
Set the class of identity map to be the soft cache weak identity map.
The SoftCacheIdentityMap holds a fixed number of objects is memory
(using SoftReferences) to improve caching.
The default is the "SoftCacheWeakIdentityMap".

useRemoteWeakIdentityMap

public void useRemoteWeakIdentityMap()

PUBLIC:
Set the class of identity map to be the weak identity map.
The default is the "SoftCacheWeakIdentityMap".

useSelectedFieldsLocking

public void useSelectedFieldsLocking(java.util.Vector fieldNames)

PUBLIC:
Set the locking policy a selected fields locking policy.
A field locking policy is base on locking on the specified fields by comparing with their previous values to detect field-level collisions.
Note: the unit of work must be used for all updates when using field locking.

usesFieldLocking

public boolean usesFieldLocking()

INTERNAL:
Return true if the receiver uses either all or changed fields for optimistic locking.

useSoftCacheWeakIdentityMap

public void useSoftCacheWeakIdentityMap()

PUBLIC:
Set the class of identity map to be the soft cache weak identity map.
The SoftCacheIdentityMap holds a fixed number of objects is memory
(using SoftReferences) to improve caching.
The default is the "SoftCacheWeakIdentityMap".

usesOptimisticLocking

public boolean usesOptimisticLocking()

PUBLIC:
Return true if the receiver uses write (optimistic) locking.

usesVersionLocking

public boolean usesVersionLocking()

PUBLIC:
Return true if the receiver uses version optimistic locking.

usesSequenceNumbers

public boolean usesSequenceNumbers()

PUBLIC:
Return true if the receiver uses sequence numbers.

useTimestampLocking

public void useTimestampLocking(java.lang.String writeLockFieldName)

PUBLIC:
Use the Timestamps locking policy and storing the value in the cache key
#see useVersionLocking(String)

useTimestampLocking

PUBLIC:
Set the locking policy to use timestamp version locking.
This updates the timestamp field on all updates, first comparing that the field has not changed to detect locking conflicts.
Note: many database have limited precision of timestamps which can be an issue is highly concurrent systems.
The parameter 'shouldStoreInCache' configures the version lock value to be stored in the cache or in the object.
Note: if using a stateless model where the object can be passed to a client and then later updated in a different transaction context,
then the version lock value should not be stored in the cache, but in the object to ensure it is the correct value for that object.

useVersionLocking

PUBLIC:
Set the locking policy to use numeric version locking.
This updates the version field on all updates, first comparing that the field has not changed to detect locking conflicts.
The parameter 'shouldStoreInCache' configures the version lock value to be stored in the cache or in the object.
Note: if using a stateless model where the object can be passed to a client and then later updated in a different transaction context,
then the version lock value should not be stored in the cache, but in the object to ensure it is the correct value for that object.

hasPessimisticLockingPolicy

getFetchGroupManager

PUBLIC:
Get the fetch group manager for the descriptor. The fetch group manager is responsible
for managing the fetch group behaviors and operations.
To use the fetch group, the domain object must implement FetchGroupTracker interface. Otherwise,
a descriptor validation exception would throw during initialization.
NOTE: This is currently only supported in CMP2.

getIdValidation

getDefaultQueryRedirector

A Default Query Redirector will be applied to any executing object query
that does not have a more precise default (like the default
ReadObjectQuery Redirector) or a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

setDefaultQueryRedirector

A Default Query Redirector will be applied to any executing object query
that does not have a more precise default (like the default
ReadObjectQuery Redirector) or a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

getDefaultReadAllQueryRedirector

A Default ReadAllQuery Redirector will be applied to any executing
ReadAllQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

setDefaultReadAllQueryRedirector

A Default ReadAllQuery Redirector will be applied to any executing
ReadAllQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

getDefaultReadObjectQueryRedirector

A Default ReadObjectQuery Redirector will be applied to any executing
ReadObjectQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

setDefaultReadObjectQueryRedirector

A Default ReadObjectQuery Redirector will be applied to any executing
ReadObjectQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

getDefaultReportQueryRedirector

A Default ReportQuery Redirector will be applied to any executing
ReportQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

setDefaultReportQueryRedirector

A Default ReportQuery Redirector will be applied to any executing
ReportQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

getDefaultUpdateObjectQueryRedirector

A Default UpdateObjectQuery Redirector will be applied to any executing
UpdateObjectQuery or UpdateAllQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

setDefaultUpdateObjectQueryRedirector

A Default UpdateObjectQuery Redirector will be applied to any executing
UpdateObjectQuery or UpdateAllQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

getDefaultInsertObjectQueryRedirector

A Default InsertObjectQuery Redirector will be applied to any executing
InsertObjectQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

setDefaultInsertObjectQueryRedirector

A Default InsertObjectQuery Redirector will be applied to any executing
InsertObjectQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

getDefaultDeleteObjectQueryRedirector

A Default DeleteObjectQuery Redirector will be applied to any executing
DeleteObjectQuery or DeleteAllQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

setDefaultDeleteObjectQueryRedirector

A Default DeleteObjectQuery Redirector will be applied to any executing
DeleteObjectQuery or DeleteAllQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

setDefaultQueryRedirectorClassName

A Default Query Redirector will be applied to any executing object query
that does not have a more precise default (like the default
ReadObjectQuery Redirector) or a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

setDefaultReadAllQueryRedirectorClassName

A Default ReadAllQuery Redirector will be applied to any executing
ReadAllQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query exection preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

setDefaultReadObjectQueryRedirectorClassName

A Default ReadObjectQuery Redirector will be applied to any executing
ReadObjectQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

setDefaultReportQueryRedirectorClassName

A Default ReportQuery Redirector will be applied to any executing
ReportQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

setDefaultUpdateObjectQueryRedirectorClassName

A Default UpdateObjectQuery Redirector will be applied to any executing
UpdateObjectQuery or UpdateAllQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query execution preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

setDefaultInsertObjectQueryRedirectorClassName

A Default InsertObjectQuery Redirector will be applied to any executing
InsertObjectQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query exection preventing
it or alternately performing some side effect like auditing.

See Also:

org.eclipse.persistence.queryframework.QueryRedirector

setDefaultDeleteObjectQueryRedirectorClassName

A Default DeleteObjectQuery Redirector will be applied to any executing
DeleteObjectQuery or DeleteAllQuery that does not have a redirector set directly on the query.
Query redirectors allow the user to intercept query exection preventing
it or alternately performing some side effect like auditing.