Oracle Fusion Middleware Java API Reference for Oracle TopLink (Deprecated)
11g Release 1 (11.1.1)

B32476-04

oracle.toplink.descriptors
Class CMPPolicy

java.lang.Object
  extended by oracle.toplink.descriptors.CMPPolicy
All Implemented Interfaces:
java.io.Serializable

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

Description: Place holder for CMP specific information. This class can be set on the ClassDescriptor.

Since:
TopLink 10.1.3
See Also:
PessimisticLockingPolicy, Serialized Form

Field Summary
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 boolean OPTIMIZE_PESSIMISTIC_CMP
           
static int UNDEFINED
          undefined if it is non-deferred issue sql at create
static int UPDATE_MODIFICATIONS
          defer updates
 
Constructor Summary
CMPPolicy()
           
 
Method Summary
 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.
 boolean getForceUpdate()
          ADVANCED: Return true if descriptor is set to always update all registered objects of this type
 java.lang.Class getMappedClass()
          Answer the mapped class.
 int getNonDeferredCreateTime()
          ADVANCED: This setting is only available for CMP beans that are not being deferred.
 PessimisticLockingPolicy getPessimisticLockingPolicy()
          Return the policy for bean pessimistic locking
 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()
          Return true if bean pessimistic locking is configured
 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 setForceUpdate(boolean shouldForceUpdate)
          ADVANCED: Configure whether TopLink should always update all registered objects of this type.
 void setMappedClass(java.lang.Class newMappedClass)
          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)
          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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTIMIZE_PESSIMISTIC_CMP

public static boolean OPTIMIZE_PESSIMISTIC_CMP

NONE

public static final int NONE
Description copied from class: CMPPolicy
defer no changes

See Also:
Constant Field Values

UPDATE_MODIFICATIONS

public static final int UPDATE_MODIFICATIONS
Description copied from class: CMPPolicy
defer updates

See Also:
Constant Field Values

ALL_MODIFICATIONS

public static final int ALL_MODIFICATIONS
Description copied from class: CMPPolicy
defer all modifications, inserts and deletes included (default)

See Also:
Constant Field Values

UNDEFINED

public static final int UNDEFINED
Description copied from class: CMPPolicy
undefined if it is non-deferred issue sql at create

See Also:
Constant Field Values

AFTER_EJBCREATE

public static final int AFTER_EJBCREATE
Description copied from class: CMPPolicy
issue SQL after ejbCreate but before ejbPostCreate

See Also:
Constant Field Values

AFTER_EJBPOSTCREATE

public static final int AFTER_EJBPOSTCREATE
Description copied from class: CMPPolicy
issue SQL after ejbPostCreate

See Also:
Constant Field Values
Constructor Detail

CMPPolicy

public CMPPolicy()
Method Detail

getNonDeferredCreateTime

public int getNonDeferredCreateTime()
ADVANCED: This setting is only available for CMP beans that are not being deferred. Using it will allow TopLink to determine if the INSERT SQL should be sent to the database before or after the postCreate call.


getPessimisticLockingPolicy

public PessimisticLockingPolicy getPessimisticLockingPolicy()
Return the policy for bean pessimistic locking

See Also:
#oracle.toplink.descriptors.PessimisticLockingPolicy

setDeferModificationsUntilCommit

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


setMappedClass

public void setMappedClass(java.lang.Class newMappedClass)
Define the mapped class. This is the class which was originally mapped in the MW

Parameters:
Class - newMappedClass

getMappedClass

public java.lang.Class getMappedClass()
Answer the mapped class. This is the class which was originally mapped in the MW


setNonDeferredCreateTime

public void setNonDeferredCreateTime(int createTime)
ADVANCED: This setting is only available for CMP beans that are not being deferred. Using it will allow TopLink to determine if the INSERT SQL should be sent to the database before or after the postCreate call.


setPessimisticLockingPolicy

public void setPessimisticLockingPolicy(PessimisticLockingPolicy policy)
Configure bean pessimistic locking

Parameters:
PessimisticLockingPolicy - policy
See Also:
#oracle.toplink.descriptors.PessimisticLockingPolicy

hasPessimisticLockingPolicy

public boolean hasPessimisticLockingPolicy()
Return true if bean pessimistic locking is configured


getDeferModificationsUntilCommit

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


getForceUpdate

public boolean getForceUpdate()
ADVANCED: Return true if descriptor is set to always update all registered objects of this type


setForceUpdate

public void setForceUpdate(boolean shouldForceUpdate)
ADVANCED: Configure whether TopLink should always update all registered objects of this type. NOTE: if set to true, then updateAllFields must also be set to true

Parameters:
boolean - shouldForceUpdate

getUpdateAllFields

public boolean getUpdateAllFields()
ADVANCED: Return true if descriptor is set to update all fields for an object of this type when an update occurs.


setUpdateAllFields

public void setUpdateAllFields(boolean shouldUpdatAllFields)
ADVANCED: Configure whether TopLink should update all fields for an object of this type when an update occurs.

Parameters:
boolean - shouldUpdatAllFields

Copyright © 1998, 2012, Oracle. All Rights Reserved.