public class CMPPolicy
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Description: Place holder for CMP specific information. This class can be set on the ClassDescriptor.
PessimisticLockingPolicy
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
AFTER_EJBCREATE
issue SQL after ejbCreate but before ejbPostCreate
|
static int |
AFTER_EJBPOSTCREATE
issue SQL after ejbPostCreate
|
static int |
ALL_MODIFICATIONS
defer all modifications, inserts and deletes included (default)
|
static int |
NONE
defer no changes
|
static int |
UNDEFINED
undefined if it is non-deferred issue sql at create
|
static int |
UPDATE_MODIFICATIONS
defer updates
|
Constructor and Description |
---|
CMPPolicy() |
Modifier and Type | Method and Description |
---|---|
CMPPolicy |
clone()
INTERNAL:
Clone the CMPPolicy
|
void |
convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL:
Convert all the class-name-based settings in this object to actual class-based
settings.
|
java.lang.Object |
createBeanUsingKey(java.lang.Object key,
AbstractSession session)
INTERNAL:
Use the key to create a bean and initialize its primary key fields.
|
java.lang.Object |
createPrimaryKeyFromId(java.lang.Object key,
AbstractSession session)
INTERNAL:
Use the key to create a EclipseLink primary key.
|
java.lang.Object |
createPrimaryKeyInstance(java.lang.Object object,
AbstractSession session)
INTERNAL:
Create an instance of the Id class or value from the object.
|
java.lang.Object |
createPrimaryKeyInstanceFromId(java.lang.Object key,
AbstractSession session)
INTERNAL:
Create an instance of the composite primary key class for the key object.
|
java.lang.Object |
createPrimaryKeyInstanceFromPrimaryKeyValues(AbstractSession session,
int[] elementIndex,
java.lang.Object... keyElements)
INTERNAL:
Create an instance of the composite primary key class for the key object.
|
java.lang.Object |
getClassInstance(java.lang.Class cls)
INTERNAL:
Return a new instance of the class provided.
|
int |
getDeferModificationsUntilCommit()
ADVANCED:
This can be used to control when changes to objects are submitted to the database
This is only applicable to TopLink's CMP implementation and not available within
the core.
|
ClassDescriptor |
getDescriptor()
INTERNAL:
|
boolean |
getForceUpdate()
ADVANCED:
Return true if descriptor is set to always update all registered objects of this type
|
java.lang.Class |
getMappedClass()
PUBLIC:
Answer the mapped class.
|
int |
getNonDeferredCreateTime()
ADVANCED:
This setting is only available for CMP beans that are not being deferred.
|
PessimisticLockingPolicy |
getPessimisticLockingPolicy()
PUBLIC:
Return the policy for bean pessimistic locking
|
java.lang.Class |
getPKClass()
INTERNAL:
|
java.lang.Object |
getPKClassInstance()
INTERNAL:
|
boolean |
getUpdateAllFields()
ADVANCED:
Return true if descriptor is set to update all fields for an object of this
type when an update occurs.
|
boolean |
hasPessimisticLockingPolicy()
PUBLIC:
Return true if bean pessimistic locking is configured
|
void |
initialize(ClassDescriptor descriptor,
AbstractSession session)
INTERNAL:
Initialize the CMPPolicy settings.
|
java.lang.Boolean |
internalGetForceUpdate()
INTERNAL:
return internal tri-state value so we can decide whether to inherit or not at init time.
|
java.lang.Boolean |
internalGetUpdateAllFields()
INTERNAL:
return internal tri-state value so we can decide whether to inherit or not at init time.
|
void |
internalSetForceUpdate(java.lang.Boolean newForceUpdateValue)
INTERNAL:
internal method to set the tri-state value.
|
void |
internalSetUpdateAllFields(java.lang.Boolean newUpdateAllFieldsValue)
INTERNAL:
internal method to set the tri-state value.
|
boolean |
isCMP3Policy()
INTERNAL:
Return if this policy is for CMP3.
|
void |
remoteInitialize(ClassDescriptor descriptor,
AbstractSession session)
INTERNAL:
Initialize the CMPPolicy settings for remote sessions.
|
void |
setDeferModificationsUntilCommit(int deferralLevel)
ADVANCED:
This can be set to control when changes to objects are submitted to the database
This is only applicable to TopLink's CMP implementation and not available within
the core.
|
void |
setDescriptor(ClassDescriptor owningDescriptor)
INTERNAL:
|
void |
setForceUpdate(boolean shouldForceUpdate)
ADVANCED:
Configure whether TopLink should always update all registered objects of
this type.
|
void |
setMappedClass(java.lang.Class newMappedClass)
PUBLIC:
Define the mapped class.
|
void |
setNonDeferredCreateTime(int createTime)
ADVANCED:
This setting is only available for CMP beans that are not being deferred.
|
void |
setPessimisticLockingPolicy(PessimisticLockingPolicy policy)
PUBLIC:
Configure bean pessimistic locking
|
void |
setUpdateAllFields(boolean shouldUpdatAllFields)
ADVANCED:
Configure whether TopLink should update all fields for an object of this
type when an update occurs.
|
public static final int NONE
public static final int UPDATE_MODIFICATIONS
public static final int ALL_MODIFICATIONS
public static final int UNDEFINED
public static final int AFTER_EJBCREATE
public static final int AFTER_EJBPOSTCREATE
public int getNonDeferredCreateTime()
public PessimisticLockingPolicy getPessimisticLockingPolicy()
PessimisticLockingPolicy
public void setDeferModificationsUntilCommit(int deferralLevel)
public void setMappedClass(java.lang.Class newMappedClass)
newMappedClass
- public java.lang.Class getMappedClass()
public void setNonDeferredCreateTime(int createTime)
public void setPessimisticLockingPolicy(PessimisticLockingPolicy policy)
policy
- PessimisticLockingPolicy
public boolean hasPessimisticLockingPolicy()
public int getDeferModificationsUntilCommit()
public boolean getForceUpdate()
public void setForceUpdate(boolean shouldForceUpdate)
shouldForceUpdate
- public boolean getUpdateAllFields()
public void setUpdateAllFields(boolean shouldUpdatAllFields)
shouldUpdatAllFields
- public java.lang.Boolean internalGetForceUpdate()
public java.lang.Boolean internalGetUpdateAllFields()
public void internalSetForceUpdate(java.lang.Boolean newForceUpdateValue)
public void internalSetUpdateAllFields(java.lang.Boolean newUpdateAllFieldsValue)
public void initialize(ClassDescriptor descriptor, AbstractSession session) throws DescriptorException
DescriptorException
public void remoteInitialize(ClassDescriptor descriptor, AbstractSession session) throws DescriptorException
DescriptorException
public ClassDescriptor getDescriptor()
public void setDescriptor(ClassDescriptor owningDescriptor)
owningDescriptor
- The owningDescriptor to set.public boolean isCMP3Policy()
public CMPPolicy clone()
clone
in class java.lang.Object
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
classLoader
- public java.lang.Object createPrimaryKeyInstanceFromId(java.lang.Object key, AbstractSession session)
public java.lang.Object createPrimaryKeyInstanceFromPrimaryKeyValues(AbstractSession session, int[] elementIndex, java.lang.Object... keyElements)
public java.lang.Object createPrimaryKeyInstance(java.lang.Object object, AbstractSession session)
public java.lang.Object getClassInstance(java.lang.Class cls)
public java.lang.Object getPKClassInstance()
public java.lang.Class getPKClass()
public java.lang.Object createPrimaryKeyFromId(java.lang.Object key, AbstractSession session)
public java.lang.Object createBeanUsingKey(java.lang.Object key, AbstractSession session)
key
- Object the primary key to use for initializing the bean's
corresponding pk fieldsEclipseLink 2.6.3, "build v20160428-59c81c5" API Reference