|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) B32476-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.toplink.descriptors.ClassDescriptor
public class ClassDescriptor
Purpose: Abstract descriptor class for defining persistence information on a class. This class provides the data independent behavior and is subclassed, for relational, object-relational, EIS, XML, etc.
RelationalDescriptor
,
ObjectRelationalDescriptor
,
EISDescriptor
,
11/26/2008 - 11.1.1.1.0 Michael O'Brien
- 7596027: Remove TopLink JPA provider which is replaced by org.eclipse.persistence.jpa.PersistenceProvider
,
Serialized FormField Summary | |
---|---|
static int |
DO_NOT_SEND_CHANGES
|
static int |
INVALIDATE_CHANGED_OBJECTS
|
static int |
ISOLATE_CACHE_AFTER_TRANSACTION
|
static int |
ISOLATE_CACHE_ALWAYS
|
static int |
ISOLATE_NEW_DATA_AFTER_TRANSACTION
|
static int |
SEND_NEW_OBJECTS_WITH_CHANGES
|
static int |
SEND_OBJECT_CHANGES
|
static int |
UNDEFINED_ISOLATATION
|
static int |
UNDEFINED_OBJECT_CHANGE_BEHAVIOR
|
static int |
USE_SESSION_CACHE_AFTER_TRANSACTION
|
Constructor Summary | |
---|---|
ClassDescriptor()
Return a new descriptor. |
Method Summary | |
---|---|
void |
addAbstractQueryKey(java.lang.String queryKeyName)
This method should only be used for interface descriptors. |
void |
addConstraintDependencies(java.lang.Class dependencies)
ADVANCED: TopLink automatically orders database access through the foreign key information provided in 1:1 and 1:m mappings. |
DatabaseMapping |
addDirectMapping(java.lang.String attributeName,
java.lang.String fieldName)
Add a direct to field mapping to the receiver. |
DatabaseMapping |
addDirectMapping(java.lang.String attributeName,
java.lang.String getMethodName,
java.lang.String setMethodName,
java.lang.String fieldName)
Add a direct to field mapping to the receiver. |
void |
addDirectQueryKey(java.lang.String queryKeyName,
java.lang.String fieldName)
Add a query key to the descriptor. |
void |
addForeignKeyFieldForMultipleTable(DatabaseField sourceForeignKeyField,
DatabaseField targetPrimaryKeyField)
This protocol can be used to associate multiple tables with foreign key information. |
void |
addForeignKeyFieldNameForMultipleTable(java.lang.String sourceForeignKeyFieldName,
java.lang.String targetPrimaryKeyFieldName)
This protocol can be used to associate multiple tables with foreign key information. |
DatabaseMapping |
addMapping(DatabaseMapping mapping)
Add a database mapping to the receiver. |
void |
addMultipleTableForeignKeyField(DatabaseField sourceField,
DatabaseField targetField)
Deprecated. 11.1.1.0.0 |
void |
addMultipleTableForeignKeyFieldName(java.lang.String sourceFieldName,
java.lang.String targetFieldName)
Deprecated. 11.1.1.0.0 |
void |
addMultipleTablePrimaryKeyField(DatabaseField sourceField,
DatabaseField targetField)
Deprecated. 11.1.1.0.0 |
void |
addMultipleTablePrimaryKeyFieldName(java.lang.String sourceFieldName,
java.lang.String targetFieldName)
Deprecated. 11.1.1.0.0 |
void |
addPrimaryKeyField(DatabaseField field)
ADVANCED: Specify the primary key field of the descriptors table. |
void |
addPrimaryKeyFieldName(java.lang.String fieldName)
Specify the primary key field of the descriptors table. |
void |
addQueryKey(QueryKey queryKey)
Add a query key to the descriptor. |
void |
addTable(DatabaseTable table)
Specify the table for the class of objects the receiver describes. |
void |
addTableName(java.lang.String tableName)
Specify the table name for the class of objects the receiver describes. |
void |
alwaysConformResultsInUnitOfWork()
Used to set the descriptor to always conform in any unit of work query. |
void |
alwaysRefreshCache()
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. |
void |
alwaysRefreshCacheOnRemote()
This method is the equivalent of calling setShouldAlwaysRefreshCacheOnRemote(boolean) with an argument of true :
it configures a ClassDescriptor to always remotely refresh the cache if data is received from the database by any
query in a RemoteSession . |
void |
applyAmendmentMethod()
ADVANCED: Call the descriptor amendment method. |
void |
createCopyPolicy(java.lang.String policyType)
Create a copy policy of the type passed in as a string. |
void |
createInstantiationPolicy(java.lang.String policyType)
Create a instantiation policy of the type passed in as a string. |
void |
descriptorIsAggregate()
Sets the descriptor to be an aggregate. |
void |
descriptorIsAggregateCollection()
Sets the descriptor to be part of an aggregate collection. |
void |
descriptorIsForInterface()
Sets the descriptor to be for an interface. |
void |
descriptorIsNormal()
Sets the descriptor to be normal. |
void |
disableCacheHits()
Allow for cache hits on primary key read object queries to be disabled. |
void |
disableCacheHitsOnRemote()
Allow for remote session cache hits on primary key read object queries to be disabled. |
void |
dontAlwaysConformResultsInUnitOfWork()
The descriptor is defined to not conform the results in unit of work in read query. |
void |
dontAlwaysRefreshCache()
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. |
void |
dontAlwaysRefreshCacheOnRemote()
This method is the equivalent of calling setShouldAlwaysRefreshCacheOnRemote(boolean) with an argument of false :
it 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 . |
void |
dontDisableCacheHits()
Allow for cache hits on primary key read object queries. |
void |
dontDisableCacheHitsOnRemote()
Allow for remote session cache hits on primary key read object queries. |
void |
dontOnlyRefreshCacheIfNewerVersion()
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). |
java.lang.String |
getAlias()
Get the alias |
java.lang.Class |
getAmendmentClass()
Return the amendment class. |
java.lang.String |
getAmendmentMethodName()
Return the amendment method. |
CacheInvalidationPolicy |
getCacheInvalidationPolicy()
Return the CacheInvalidationPolicy for this descriptor For uninitialized cache invalidation policies, this will return a NoExpiryCacheInvalidationPolicy |
int |
getCacheSynchronizationType()
Get a value indicating the type of cache synchronization that will be used on objects of this type. |
CMPPolicy |
getCMPPolicy()
ADVANCED: Return the cmp descriptor that holds cmp specific information. |
java.util.Vector |
getConstraintDependencies()
ADVANCED: TopLink automatically orders database access through the foreign key information provided in 1:1 and 1:m mappings. |
DescriptorEventManager |
getDescriptorEventManager()
Get the event manager for the descriptor. |
InheritancePolicy |
getDescriptorInheritancePolicy()
The inheritance policy is used to define how a descriptor takes part in inheritance. |
DescriptorQueryManager |
getDescriptorQueryManager()
Return the queryManager. |
int |
getDescriptorType()
ADVANCED: return the descriptor type (NORMAL by default, others include INTERFACE, AGGREGATE, AGGREGATE COLLECTION) |
DescriptorEventManager |
getEventManager()
Get the event manager for the descriptor. |
FetchGroupManager |
getFetchGroupManager()
Get the fetch group manager for the descriptor. |
HistoryPolicy |
getHistoryPolicy()
Return this descriptors HistoryPolicy. |
int |
getIdentityMapSize()
Return the size of the identity map. |
InheritancePolicy |
getInheritancePolicy()
The inheritance policy is used to define how a descriptor takes part in inheritance. |
InterfacePolicy |
getInterfacePolicy()
Returns the InterfacePolicy. |
java.lang.Class |
getJavaClass()
Return the java class. |
java.lang.String |
getJavaClassName()
Return the class name, used by the MW. |
DatabaseMapping |
getMappingForAttributeName(java.lang.String attributeName)
Returns the mapping associated with a given attribute name. |
java.util.Vector<DatabaseMapping> |
getMappings()
Returns mappings |
ObjectChangePolicy |
getObjectChangePolicy()
Return this objects ObjectChangePolicy. |
oracle.toplink.internal.descriptors.OptimisticLockingPolicy |
getOptimisticLockingPolicy()
Returns the OptimisticLockingPolicy. |
java.util.Vector<java.lang.String> |
getPrimaryKeyFieldNames()
Return the names of all the primary keys. |
java.util.Map |
getProperties()
Returns the user defined properties. |
java.lang.Object |
getProperty(java.lang.String name)
Returns the descriptor property associated the given String. |
java.util.Map<java.lang.String, QueryKey> |
getQueryKeys()
Return the query keys. |
DescriptorQueryManager |
getQueryManager()
Return the queryManager. |
int |
getRemoteIdentityMapSize()
Return the size of the remote identity map. |
ReturningPolicy |
getReturningPolicy()
Return returning policy. |
java.lang.String |
getSequenceNumberFieldName()
Get sequence number field name |
java.lang.String |
getSequenceNumberName()
Get sequence number name |
java.lang.String |
getTableName()
Return the name of the descriptor's first table. |
java.util.Vector |
getTableNames()
Return the table names. |
int |
getUnitOfWorkCacheIsolationLevel()
ADVANCED: Return the unit of work cache isolation setting. |
WrapperPolicy |
getWrapperPolicy()
ADVANCED: Return the WrapperPolicy for this descriptor. |
boolean |
isAggregateCollectionDescriptor()
Return true if this descriptor is an aggregate collection descriptor |
boolean |
isAggregateDescriptor()
Return true if this descriptor is an aggregate descriptor |
boolean |
isChildDescriptor()
Return if the descriptor defines inheritence and is a child. |
boolean |
isDescriptorForInterface()
Return if the java class is interface |
boolean |
isIsolated()
Returns true if the descriptor represents an isolated class |
boolean |
isNativeConnectionRequired()
ADVANCED: Return if the descriptor requires usage of a native (unwrapped) JDBC connection. |
boolean |
isObjectRelationalDescriptor()
Return if this is an ObjectRelationalDescriptor. |
void |
onlyRefreshCacheIfNewerVersion()
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:
the ClassDescriptor was configured by calling alwaysRefreshCache() or alwaysRefreshCacheOnRemote() ,
the query was configured by calling ObjectLevelReadQuery.refreshIdentityMapResult() , or
the query was a call to Session.refreshObject(java.lang.Object)
However, if a query hits the cache, data is not refreshed regardless of how this setting is configured. |
DatabaseMapping |
removeMappingForAttributeName(java.lang.String attributeName)
ADVANCED: Removes the locally defined mapping associated with a given attribute name. |
void |
removeProperty(java.lang.String property)
Remove the user defined property. |
void |
setAlias(java.lang.String alias)
Set the alias |
void |
setAmendmentClass(java.lang.Class amendmentClass)
Set the amendment class. |
void |
setAmendmentMethodName(java.lang.String amendmentMethodName)
Set the amendment method. |
void |
setCacheInvalidationPolicy(CacheInvalidationPolicy policy)
Set the Cache Invalidation Policy for this descriptor. |
void |
setCacheSynchronizationType(int type)
Set the type of cache synchonization that will be used on objects of this type. |
void |
setCMPPolicy(CMPPolicy newCMPPolicy)
ADVANCED: Set the cmp descriptor that holds cmp specific information. |
void |
setConstraintDependencies(java.util.Vector constraintDependencies)
ADVANCED: TopLink automatically orders database access through the foreign key information provided in 1:1 and 1:m mappings. |
void |
setDefaultTableName(java.lang.String defaultTableName)
The descriptors default table can be configured if the first table is not desired. |
void |
setDescriptorType(int descriptorType)
ADVANCED: set the descriptor type (NORMAL by default, others include INTERFACE, AGGREGATE, AGGREGATE COLLECTION) |
void |
setFetchGroupManager(FetchGroupManager fetchGroupManager)
Set the fetch group manager for the descriptor. |
void |
setHistoryPolicy(HistoryPolicy policy)
Set the HistoryPolicy for this descriptor. |
void |
setIdentityMapClass(java.lang.Class theIdentityMapClass)
Set the class of identity map to be used by this descriptor. |
void |
setIdentityMapSize(int identityMapSize)
Set the size of the identity map to be used by this descriptor. |
void |
setIsIsolated(boolean isIsolated)
Used to set if the class that this descriptor represents should be isolated from the shared cache. |
void |
setIsNativeConnectionRequired(boolean isNativeConnectionRequired)
ADVANCED: Set if the descriptor requires usage of a native (unwrapped) JDBC connection. |
void |
setJavaClass(java.lang.Class theJavaClass)
Set the Java class that this descriptor maps. |
void |
setJavaInterface(java.lang.Class theJavaInterface)
Sets the descriptor to be for an interface. |
void |
setMultipleTableInsertOrder(java.util.Vector<oracle.toplink.internal.helper.DatabaseTable> newValue)
ADVANCED: Sets the Vector of DatabaseTables in the order which INSERTS should take place. |
void |
setObjectChangePolicy(ObjectChangePolicy policy)
Set the ObjectChangePolicy for this descriptor. |
void |
setOptimisticLockingPolicy(oracle.toplink.internal.descriptors.OptimisticLockingPolicy optimisticLockingPolicy)
Set the OptimisticLockingPolicy. |
void |
setPrimaryKeyFieldName(java.lang.String fieldName)
Specify the primary key field of the descriptors table. |
void |
setPrimaryKeyFieldNames(java.util.Vector primaryKeyFieldsName)
User can specify a vector of all the primary key field names if primary key is composite. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Set the user defined property. |
void |
setReadOnly()
Set the descriptor to be read-only. |
void |
setRemoteIdentityMapClass(java.lang.Class theIdentityMapClass)
Set the class of identity map to be used by this descriptor. |
void |
setRemoteIdentityMapSize(int identityMapSize)
Set the size of the identity map to be used by this descriptor. |
void |
setReturningPolicy(ReturningPolicy returningPolicy)
Sets the returning policy. |
void |
setSequenceNumberFieldName(java.lang.String fieldName)
Set the sequence number field name. |
void |
setSequenceNumberName(java.lang.String name)
Set the sequence number name. |
void |
setShouldAlwaysConformResultsInUnitOfWork(boolean shouldAlwaysConformResultsInUnitOfWork)
set if the descriptor is defined to always conform the results in unit of work in read query. |
void |
setShouldAlwaysRefreshCache(boolean shouldAlwaysRefreshCache)
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)
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 . |
void |
setShouldBeReadOnly(boolean shouldBeReadOnly)
Define if the descriptor reference class is read-only |
void |
setShouldDisableCacheHits(boolean shouldDisableCacheHits)
Set if cache hits on primary key read object queries should be disabled. |
void |
setShouldDisableCacheHitsOnRemote(boolean shouldDisableCacheHitsOnRemote)
Set if the remote session cache hits on primary key read object queries is allowed or not. |
void |
setShouldOnlyRefreshCacheIfNewerVersion(boolean shouldOnlyRefreshCacheIfNewerVersion)
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:
the ClassDescriptor was configured by calling alwaysRefreshCache() or alwaysRefreshCacheOnRemote() ,
the query was configured by calling ObjectLevelReadQuery.refreshIdentityMapResult() , or
the query was a call to Session.refreshObject(java.lang.Object)
However, if a query hits the cache, data is not refreshed regardless of how this setting is configured. |
void |
setShouldOrderMappings(boolean shouldOrderMappings)
This is set to turn off the ordering of mappings. |
void |
setTableName(java.lang.String tableName)
Specify the table name for the class of objects the receiver describes. |
void |
setTableNames(java.util.Vector tableNames)
Specify the all table names for the class of objects the receiver describes. |
void |
setTableQualifier(java.lang.String tableQualifier)
Set the table Qualifier for this descriptor. |
void |
setUnitOfWorkCacheIsolationLevel(int unitOfWorkCacheIsolationLevel)
ADVANCED: This setting configures how the session cache will be used in a unit of work. |
void |
setWrapperPolicy(WrapperPolicy wrapperPolicy)
ADVANCED: Sets the WrapperPolicy for this descriptor. |
boolean |
shouldAlwaysConformResultsInUnitOfWork()
Return if the descriptor is defined to always conform the results in unit of work in read query. |
boolean |
shouldAlwaysRefreshCache()
This method returns true if the ClassDescriptor is configured to always refresh
the cache if data is received from the database by any query. |
boolean |
shouldAlwaysRefreshCacheOnRemote()
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 . |
boolean |
shouldBeReadOnly()
Return if the descriptor reference class is defined as read-only |
boolean |
shouldDisableCacheHits()
Return if for cache hits on primary key read object queries to be disabled. |
boolean |
shouldDisableCacheHitsOnRemote()
Return if the remote server session cache hits on primary key read object queries is aloowed or not. |
boolean |
shouldOnlyRefreshCacheIfNewerVersion()
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). |
boolean |
shouldUseCacheIdentityMap()
Return true if this descriptor is using CacheIdentityMap |
boolean |
shouldUseFullIdentityMap()
Return true if this descriptor is using FullIdentityMap |
boolean |
shouldUseHardCacheWeakIdentityMap()
Return true if this descriptor is using HardCacheWeakIdentityMap. |
boolean |
shouldUseNoIdentityMap()
Return true if this descriptor is using NoIdentityMap |
boolean |
shouldUseRemoteCacheIdentityMap()
Return true if this descriptor is using CacheIdentityMap |
boolean |
shouldUseRemoteFullIdentityMap()
Return true if this descriptor is using FullIdentityMap |
boolean |
shouldUseRemoteHardCacheWeakIdentityMap()
Return true if this descriptor is using HardCacheWeakIdentityMap |
boolean |
shouldUseRemoteNoIdentityMap()
Return true if this descriptor is using NoIdentityMap |
boolean |
shouldUseRemoteSoftCacheWeakIdentityMap()
Return true if this descriptor is using SoftCacheWeakIdentityMap |
boolean |
shouldUseRemoteSoftIdentityMap()
Return true if this descriptor is using SoftIdentityMap |
boolean |
shouldUseRemoteWeakIdentityMap()
Return true if this descriptor is using WeakIdentityMap |
boolean |
shouldUseSoftCacheWeakIdentityMap()
Return true if this descriptor is using SoftCacheWeakIdentityMap. |
boolean |
shouldUseSoftIdentityMap()
Return true if this descriptor is using SoftIdentityMap |
boolean |
shouldUseWeakIdentityMap()
Return true if this descriptor is using WeakIdentityMap |
java.lang.String |
toString()
Returns a brief string representation of the receiver. |
void |
useAllFieldsLocking()
Set the locking policy an all fields locking policy. |
void |
useCacheIdentityMap()
Set the class of identity map to be the cache identity map. |
void |
useChangedFieldsLocking()
Set the locking policy a changed fields locking policy. |
void |
useCloneCopyPolicy()
Specifies that the creation of clones within a unit of work is done by sending the #clone() method to the original object. |
void |
useCloneCopyPolicy(java.lang.String cloneMethodName)
Specifies that the creation of clones within a unit of work is done by sending the cloneMethodName method to the original object. |
void |
useDefaultConstructorInstantiationPolicy()
Use the default constructor to create new instances of objects built from the database. |
void |
useFactoryInstantiationPolicy(java.lang.Class factoryClass,
java.lang.String methodName)
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)
Use an object factory to create new instances of objects built from the database. |
void |
useFactoryInstantiationPolicy(java.lang.Object factory,
java.lang.String methodName)
Use an object factory to create new instances of objects built from the database. |
void |
useFullIdentityMap()
Set the class of identity map to be the full identity map. |
void |
useHardCacheWeakIdentityMap()
Set the class of identity map to be the hard cache weak identity map. |
void |
useInstantiationCopyPolicy()
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)
Use the specified static method to create new instances of objects built from the database. |
void |
useNoIdentityMap()
Set the class of identity map to be the no identity map. |
void |
useRemoteCacheIdentityMap()
Set the class of identity map to be the cache identity map. |
void |
useRemoteFullIdentityMap()
Set the class of identity map to be the full identity map. |
void |
useRemoteHardCacheWeakIdentityMap()
Set the class of identity map to be the hard cache weak identity map. |
void |
useRemoteNoIdentityMap()
Set the class of identity map to be the no identity map. |
void |
useRemoteSoftCacheWeakIdentityMap()
Set the class of identity map to be the soft cache weak identity map. |
void |
useRemoteSoftIdentityMap()
Set the class of identity map to be the soft identity map. |
void |
useRemoteWeakIdentityMap()
Set the class of identity map to be the weak identity map. |
void |
useSelectedFieldsLocking(java.util.Vector fieldNames)
Set the locking policy a selected fields locking policy. |
void |
useSoftCacheWeakIdentityMap()
Set the class of identity map to be the soft cache weak identity map. |
void |
useSoftIdentityMap()
Set the class of identity map to be the soft identity map. |
boolean |
usesOptimisticLocking()
Return true if the receiver uses write (optimistic) locking. |
boolean |
usesSequenceNumbers()
Return true if the receiver uses sequence numbers. |
boolean |
usesVersionLocking()
Return true if the receiver uses version optimistic locking. |
void |
useTimestampLocking(java.lang.String writeLockFieldName)
Use the Timestamps locking policy and storing the value in the cache key #see useVersionLocking(String) |
void |
useTimestampLocking(java.lang.String writeLockFieldName,
boolean shouldStoreInCache)
Set the locking policy to use timestamp version locking. |
void |
useVersionLocking(java.lang.String writeLockFieldName)
Default to use the version locking policy and storing the value in the cache key #see useVersionLocking(String) |
void |
useVersionLocking(java.lang.String writeLockFieldName,
boolean shouldStoreInCache)
Set the locking policy to use numeric version locking. |
void |
useWeakIdentityMap()
Set the class of identity map to be the weak identity map. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int UNDEFINED_OBJECT_CHANGE_BEHAVIOR
public static final int SEND_OBJECT_CHANGES
public static final int INVALIDATE_CHANGED_OBJECTS
public static final int SEND_NEW_OBJECTS_WITH_CHANGES
public static final int DO_NOT_SEND_CHANGES
public static final int UNDEFINED_ISOLATATION
public static final int USE_SESSION_CACHE_AFTER_TRANSACTION
public static final int ISOLATE_NEW_DATA_AFTER_TRANSACTION
public static final int ISOLATE_CACHE_AFTER_TRANSACTION
public static final int ISOLATE_CACHE_ALWAYS
Constructor Detail |
---|
public ClassDescriptor()
Method Detail |
---|
public void addAbstractQueryKey(java.lang.String queryKeyName)
public void addConstraintDependencies(java.lang.Class dependencies)
public DatabaseMapping addDirectMapping(java.lang.String attributeName, java.lang.String fieldName)
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.
public DatabaseMapping addDirectMapping(java.lang.String attributeName, java.lang.String getMethodName, java.lang.String setMethodName, java.lang.String fieldName)
public void addDirectQueryKey(java.lang.String queryKeyName, java.lang.String fieldName)
public void addForeignKeyFieldNameForMultipleTable(java.lang.String sourceForeignKeyFieldName, java.lang.String targetPrimaryKeyFieldName) throws DescriptorException
DescriptorException
public void addForeignKeyFieldForMultipleTable(DatabaseField sourceForeignKeyField, DatabaseField targetPrimaryKeyField) throws DescriptorException
DescriptorException
public DatabaseMapping addMapping(DatabaseMapping mapping)
public void addMultipleTableForeignKeyField(DatabaseField sourceField, DatabaseField targetField) throws DescriptorException
DescriptorException
addForeignKeyFieldForMultipleTable(DatabaseField, DatabaseField)
public void addMultipleTableForeignKeyFieldName(java.lang.String sourceFieldName, java.lang.String targetFieldName) throws DescriptorException
DescriptorException
addForeignKeyFieldNameForMultipleTable(String, String)
public void addMultipleTablePrimaryKeyField(DatabaseField sourceField, DatabaseField targetField) throws DescriptorException
DescriptorException
addForeignKeyFieldForMultipleTable(DatabaseField, DatabaseField)
public void addMultipleTablePrimaryKeyFieldName(java.lang.String sourceFieldName, java.lang.String targetFieldName) throws DescriptorException
DescriptorException
addForeignKeyFieldNameForMultipleTable(String, String)
public void addPrimaryKeyFieldName(java.lang.String fieldName)
addMultipleTableForeignKeyFieldName(String, String);
public void addPrimaryKeyField(DatabaseField field)
public void addQueryKey(QueryKey queryKey)
public void addTable(DatabaseTable table)
public void addTableName(java.lang.String tableName)
public void alwaysConformResultsInUnitOfWork()
public void alwaysRefreshCache()
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.
Use this property with caution because it can lead to poor performance and may refresh on queries when it is not desired. Normally,
if you require fresh data, it is better to configure a query with ObjectLevelReadQuery.refreshIdentityMapResult()
.
To ensure that refreshes are only done when required, use this method in conjunction with onlyRefreshCacheIfNewerVersion()
.
dontAlwaysRefreshCache()
public void alwaysRefreshCacheOnRemote()
setShouldAlwaysRefreshCacheOnRemote(boolean)
with an argument of true
:
it 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.
Use this property with caution because it can lead to poor performance and may refresh on queries when it is not desired.
Normally, if you require fresh data, it is better to configure a query with ObjectLevelReadQuery.refreshIdentityMapResult()
.
To ensure that refreshes are only done when required, use this method in conjunction with onlyRefreshCacheIfNewerVersion()
.
dontAlwaysRefreshCacheOnRemote()
public void applyAmendmentMethod()
public void createCopyPolicy(java.lang.String policyType)
public void createInstantiationPolicy(java.lang.String policyType)
public void descriptorIsAggregate()
public void descriptorIsAggregateCollection()
public void descriptorIsForInterface()
public void descriptorIsNormal()
public void disableCacheHits()
alwaysRefreshCache()
or alwaysRefreshCacheOnRemote()
to ensure queries always go to the database.
public void disableCacheHitsOnRemote()
alwaysRefreshCacheOnRemote()
public void dontAlwaysConformResultsInUnitOfWork()
public void dontAlwaysRefreshCache()
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.
alwaysRefreshCache()
public void dontAlwaysRefreshCacheOnRemote()
setShouldAlwaysRefreshCacheOnRemote(boolean)
with an argument of false
:
it 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
.
alwaysRefreshCacheOnRemote()
public void dontDisableCacheHits()
disableCacheHits()
public void dontDisableCacheHitsOnRemote()
disableCacheHitsOnRemote()
public void dontOnlyRefreshCacheIfNewerVersion()
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).
onlyRefreshCacheIfNewerVersion()
public java.lang.String getAlias()
public java.lang.Class getAmendmentClass()
public java.lang.String getAmendmentMethodName()
public ObjectChangePolicy getObjectChangePolicy()
public HistoryPolicy getHistoryPolicy()
public CacheInvalidationPolicy getCacheInvalidationPolicy()
CacheInvalidationPolicy
public int getCacheSynchronizationType()
public java.util.Vector getConstraintDependencies()
public int getDescriptorType()
public DescriptorEventManager getDescriptorEventManager()
public DescriptorEventManager getEventManager()
public int getIdentityMapSize()
public InheritancePolicy getDescriptorInheritancePolicy()
public InheritancePolicy getInheritancePolicy()
public InterfacePolicy getInterfacePolicy()
public java.lang.Class getJavaClass()
public java.lang.String getJavaClassName()
public DatabaseMapping getMappingForAttributeName(java.lang.String attributeName)
public DatabaseMapping removeMappingForAttributeName(java.lang.String attributeName)
public java.util.Vector<DatabaseMapping> getMappings()
public oracle.toplink.internal.descriptors.OptimisticLockingPolicy getOptimisticLockingPolicy()
public java.util.Vector<java.lang.String> getPrimaryKeyFieldNames()
public java.util.Map getProperties()
public java.lang.Object getProperty(java.lang.String name)
public java.util.Map<java.lang.String, QueryKey> getQueryKeys()
public DescriptorQueryManager getDescriptorQueryManager()
public DescriptorQueryManager getQueryManager()
public int getRemoteIdentityMapSize()
public ReturningPolicy getReturningPolicy()
public java.lang.String getSequenceNumberFieldName()
public java.lang.String getSequenceNumberName()
public java.lang.String getTableName()
public java.util.Vector getTableNames()
public WrapperPolicy getWrapperPolicy()
public boolean isAggregateCollectionDescriptor()
public boolean isAggregateDescriptor()
public boolean isChildDescriptor()
public boolean isDescriptorForInterface()
public boolean isIsolated()
public boolean isObjectRelationalDescriptor()
public void onlyRefreshCacheIfNewerVersion()
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:
ClassDescriptor
was configured by calling alwaysRefreshCache()
or alwaysRefreshCacheOnRemote()
,ObjectLevelReadQuery.refreshIdentityMapResult()
, orSession.refreshObject(java.lang.Object)
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.
dontOnlyRefreshCacheIfNewerVersion()
public void removeProperty(java.lang.String property)
public void setAlias(java.lang.String alias)
public void setAmendmentClass(java.lang.Class amendmentClass)
public void setAmendmentMethodName(java.lang.String amendmentMethodName)
public void setCacheSynchronizationType(int type)
type
- int The synchronization type for this descriptorpublic void setObjectChangePolicy(ObjectChangePolicy policy)
public void setHistoryPolicy(HistoryPolicy policy)
public void setCacheInvalidationPolicy(CacheInvalidationPolicy policy)
CacheInvalidationPolicy
public void setConstraintDependencies(java.util.Vector constraintDependencies)
public void setDefaultTableName(java.lang.String defaultTableName)
public void setDescriptorType(int descriptorType)
public void setIdentityMapClass(java.lang.Class theIdentityMapClass)
public void setIdentityMapSize(int identityMapSize)
public void setReturningPolicy(ReturningPolicy returningPolicy)
public void setIsIsolated(boolean isIsolated)
public int getUnitOfWorkCacheIsolationLevel()
setUnitOfWorkCacheIsolationLevel(int)
public void setUnitOfWorkCacheIsolationLevel(int unitOfWorkCacheIsolationLevel)
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.
public void setJavaClass(java.lang.Class theJavaClass)
public void setJavaInterface(java.lang.Class theJavaInterface)
public void setMultipleTableInsertOrder(java.util.Vector<oracle.toplink.internal.helper.DatabaseTable> newValue)
public void setOptimisticLockingPolicy(oracle.toplink.internal.descriptors.OptimisticLockingPolicy optimisticLockingPolicy)
VersionLockingPolicy
,
TimestampLockingPolicy
,
FieldsLockingPolicy
public void setPrimaryKeyFieldName(java.lang.String fieldName)
addPrimaryKeyFieldName(String)
public void setPrimaryKeyFieldNames(java.util.Vector primaryKeyFieldsName)
addPrimaryKeyFieldName(String)
public void setProperty(java.lang.String name, java.lang.Object value)
public void setRemoteIdentityMapClass(java.lang.Class theIdentityMapClass)
public void setRemoteIdentityMapSize(int identityMapSize)
public void setSequenceNumberFieldName(java.lang.String fieldName)
public void setSequenceNumberName(java.lang.String name)
public void setShouldAlwaysConformResultsInUnitOfWork(boolean shouldAlwaysConformResultsInUnitOfWork)
public void setShouldAlwaysRefreshCache(boolean shouldAlwaysRefreshCache)
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.
Use this property with caution because it can lead to poor performance and may refresh on queries when it is not desired.
Normally, if you require fresh data, it is better to configure a query with ObjectLevelReadQuery.refreshIdentityMapResult()
.
To ensure that refreshes are only done when required, use this method in conjunction with onlyRefreshCacheIfNewerVersion()
.
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.
alwaysRefreshCache()
,
dontAlwaysRefreshCache()
public void setShouldAlwaysRefreshCacheOnRemote(boolean shouldAlwaysRefreshCacheOnRemote)
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.
Use this property with caution because it can lead to poor performance and may refresh on queries when it is
not desired. Normally, if you require fresh data, it is better to configure a query with ObjectLevelReadQuery.refreshIdentityMapResult()
.
To ensure that refreshes are only done when required, use this method in conjunction with onlyRefreshCacheIfNewerVersion()
.
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
.
alwaysRefreshCacheOnRemote()
,
dontAlwaysRefreshCacheOnRemote()
public void setShouldBeReadOnly(boolean shouldBeReadOnly)
public void setReadOnly()
public void setShouldDisableCacheHits(boolean shouldDisableCacheHits)
alwaysRefreshCache()
public void setShouldDisableCacheHitsOnRemote(boolean shouldDisableCacheHitsOnRemote)
disableCacheHitsOnRemote()
public void setShouldOnlyRefreshCacheIfNewerVersion(boolean shouldOnlyRefreshCacheIfNewerVersion)
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:
ClassDescriptor
was configured by calling alwaysRefreshCache()
or alwaysRefreshCacheOnRemote()
,ObjectLevelReadQuery.refreshIdentityMapResult()
, orSession.refreshObject(java.lang.Object)
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).
onlyRefreshCacheIfNewerVersion()
,
dontOnlyRefreshCacheIfNewerVersion()
public void setShouldOrderMappings(boolean shouldOrderMappings)
public void setTableName(java.lang.String tableName) throws DescriptorException
DescriptorException
public void setTableNames(java.util.Vector tableNames)
public void setTableQualifier(java.lang.String tableQualifier)
public void setWrapperPolicy(WrapperPolicy wrapperPolicy)
public boolean shouldAlwaysConformResultsInUnitOfWork()
public boolean shouldAlwaysRefreshCache()
true
if the ClassDescriptor
is configured to always refresh
the cache if data is received from the database by any query. Otherwise, it returns false
.
setShouldAlwaysRefreshCache(boolean)
public boolean shouldAlwaysRefreshCacheOnRemote()
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
.
setShouldAlwaysRefreshCacheOnRemote(boolean)
public boolean shouldBeReadOnly()
public boolean shouldDisableCacheHits()
disableCacheHits()
public boolean shouldDisableCacheHitsOnRemote()
disableCacheHitsOnRemote()
public boolean shouldOnlyRefreshCacheIfNewerVersion()
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
.
setShouldOnlyRefreshCacheIfNewerVersion(boolean)
public boolean shouldUseCacheIdentityMap()
public boolean shouldUseFullIdentityMap()
public boolean shouldUseSoftIdentityMap()
public boolean shouldUseRemoteSoftIdentityMap()
public boolean shouldUseHardCacheWeakIdentityMap()
public boolean shouldUseNoIdentityMap()
public boolean shouldUseRemoteCacheIdentityMap()
public boolean shouldUseRemoteFullIdentityMap()
public boolean shouldUseRemoteHardCacheWeakIdentityMap()
public boolean shouldUseRemoteNoIdentityMap()
public boolean shouldUseRemoteSoftCacheWeakIdentityMap()
public boolean shouldUseRemoteWeakIdentityMap()
public boolean shouldUseSoftCacheWeakIdentityMap()
public boolean shouldUseWeakIdentityMap()
public java.lang.String toString()
toString
in class java.lang.Object
public void useAllFieldsLocking()
AllFieldsLockingPolicy
public void useCacheIdentityMap()
public void useChangedFieldsLocking()
ChangedFieldsLockingPolicy
public void useCloneCopyPolicy()
useCloneCopyPolicy(String)
public void useCloneCopyPolicy(java.lang.String cloneMethodName)
useCloneCopyPolicy()
public void useInstantiationCopyPolicy()
useCloneCopyPolicy()
,
useCloneCopyPolicy(String)
,
useDefaultConstructorInstantiationPolicy()
,
useMethodInstantiationPolicy(String)
,
useFactoryInstantiationPolicy(Class, String)
,
useFactoryInstantiationPolicy(Class, String, String)
,
useFactoryInstantiationPolicy(Object, String)
public void useDefaultConstructorInstantiationPolicy()
useMethodInstantiationPolicy(String)
,
useFactoryInstantiationPolicy(Class, String)
,
useFactoryInstantiationPolicy(Class, String, String)
,
useFactoryInstantiationPolicy(Object, String)
public void useFactoryInstantiationPolicy(java.lang.Class factoryClass, java.lang.String methodName)
useDefaultConstructorInstantiationPolicy()
,
useMethodInstantiationPolicy(String)
,
useFactoryInstantiationPolicy(Class, String, String)
,
useFactoryInstantiationPolicy(Object, String)
public void useFactoryInstantiationPolicy(java.lang.Class factoryClass, java.lang.String methodName, java.lang.String factoryMethodName)
useDefaultConstructorInstantiationPolicy()
,
useFactoryInstantiationPolicy(Class, String)
,
useFactoryInstantiationPolicy(Object, String)
,
useMethodInstantiationPolicy(String)
public void useFactoryInstantiationPolicy(java.lang.Object factory, java.lang.String methodName)
useDefaultConstructorInstantiationPolicy()
,
useMethodInstantiationPolicy(String)
,
useFactoryInstantiationPolicy(Class, String)
,
useFactoryInstantiationPolicy(Class, String, String)
public void useFullIdentityMap()
public void useHardCacheWeakIdentityMap()
public void useSoftIdentityMap()
public void useRemoteSoftIdentityMap()
public void useMethodInstantiationPolicy(java.lang.String staticMethodName)
useDefaultConstructorInstantiationPolicy()
,
useFactoryInstantiationPolicy(Class, String)
,
useFactoryInstantiationPolicy(Class, String, String)
,
useFactoryInstantiationPolicy(Object, String)
public void useNoIdentityMap()
setIsIsolated(boolean)
public void useRemoteCacheIdentityMap()
public void useRemoteFullIdentityMap()
public void useRemoteHardCacheWeakIdentityMap()
public void useRemoteNoIdentityMap()
public void useRemoteSoftCacheWeakIdentityMap()
public void useRemoteWeakIdentityMap()
public void useSelectedFieldsLocking(java.util.Vector fieldNames)
SelectedFieldsLockingPolicy
public void useSoftCacheWeakIdentityMap()
public boolean usesOptimisticLocking()
public boolean usesVersionLocking()
public boolean usesSequenceNumbers()
public void useTimestampLocking(java.lang.String writeLockFieldName)
public void useTimestampLocking(java.lang.String writeLockFieldName, boolean shouldStoreInCache)
VersionLockingPolicy
public void useVersionLocking(java.lang.String writeLockFieldName)
public void useVersionLocking(java.lang.String writeLockFieldName, boolean shouldStoreInCache)
TimestampLockingPolicy
public void useWeakIdentityMap()
public CMPPolicy getCMPPolicy()
public void setCMPPolicy(CMPPolicy newCMPPolicy)
public FetchGroupManager getFetchGroupManager()
FetchGroupTracker
public void setFetchGroupManager(FetchGroupManager fetchGroupManager)
public void setIsNativeConnectionRequired(boolean isNativeConnectionRequired)
public boolean isNativeConnectionRequired()
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |