public class CMP3Policy extends CMPPolicy
CMPPolicy.KeyElementAccessor, CMPPolicy.KeyIsElementAccessor| Modifier and Type | Field and Description |
|---|---|
protected HashMap<DatabaseField,CMPPolicy.KeyElementAccessor> |
fieldToAccessorMap
Used to look up the KeyElementAccessor for a specific DatabaseField, used for
resolving DerivedIds
|
protected CMPPolicy.KeyElementAccessor[] |
keyClassFields
Stores the fields for this classes compound primary key class if required.
|
protected Class |
pkClass |
protected String |
pkClassName |
AFTER_EJBCREATE, AFTER_EJBPOSTCREATE, ALL_MODIFICATIONS, descriptor, forceUpdate, mappedClass, modificationDeferralLevel, nonDeferredCreateTime, NONE, pessimisticLockingPolicy, UNDEFINED, UPDATE_MODIFICATIONS, updateAllFields| Constructor and Description |
|---|
CMP3Policy() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addReadOnlyMappings(ClassDescriptor aDescriptor,
DatabaseField field,
List allMappings)
INTERNAL:
Add the writable mapping for the given field to the allMappings list.
|
protected void |
addWritableMapping(ClassDescriptor aDescriptor,
DatabaseField field,
List allMappings)
INTERNAL:
Add the read only mappings for the given field to the allMappings list.
|
CMP3Policy |
clone()
INTERNAL:
Clone the CMP3Policy
|
void |
convertClassNamesToClasses(ClassLoader classLoader)
INTERNAL:
Convert all the class-name-based settings in this object to actual class-based
settings.
|
Object |
createBeanUsingKey(Object key,
AbstractSession session)
INTERNAL:
Use the key to create a bean and initialize its primary key fields.
|
Object |
createPrimaryKeyFromId(Object key,
AbstractSession session)
INTERNAL:
Use the key to create a EclipseLink primary key.
|
protected Field |
getField(Class cls,
String fieldName)
INTERNAL:
|
protected CMPPolicy.KeyElementAccessor[] |
getKeyClassFields()
INTERNAL:
|
Class |
getPKClass()
INTERNAL:
Return the java Class representing the primary key class name
|
Object |
getPKClassInstance()
INTERNAL:
|
String |
getPKClassName()
INTERNAL:
|
Object |
getPkValueFromKeyForField(Object key,
DatabaseField field,
AbstractSession session)
INTERNAL:
Pull the value for the field from the key.
|
void |
initialize(ClassDescriptor descriptor,
AbstractSession session)
INTERNAL:
Initialize the CMPPolicy settings.
|
protected CMPPolicy.KeyElementAccessor[] |
initializePrimaryKeyFields(Class keyClass,
AbstractSession session)
INTERNAL:
Cache the bean's primary key fields so speed up creating of primary key
objects and initialization of beans.
|
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 |
setPKClass(Class pkClass)
ADVANCED:
|
void |
setPrimaryKeyClassName(String pkClassName)
INTERNAL:
|
createPrimaryKeyInstance, createPrimaryKeyInstanceFromId, createPrimaryKeyInstanceFromPrimaryKeyValues, getClassInstance, getDeferModificationsUntilCommit, getDescriptor, getForceUpdate, getMappedClass, getNonDeferredCreateTime, getPessimisticLockingPolicy, getUpdateAllFields, hasPessimisticLockingPolicy, internalGetForceUpdate, internalGetUpdateAllFields, internalSetForceUpdate, internalSetUpdateAllFields, isSingleKey, setDeferModificationsUntilCommit, setDescriptor, setFieldValue, setForceUpdate, setMappedClass, setNonDeferredCreateTime, setPessimisticLockingPolicy, setUpdateAllFieldsprotected transient CMPPolicy.KeyElementAccessor[] keyClassFields
protected transient HashMap<DatabaseField,CMPPolicy.KeyElementAccessor> fieldToAccessorMap
protected String pkClassName
protected Class pkClass
protected void addWritableMapping(ClassDescriptor aDescriptor, DatabaseField field, List allMappings)
aDescriptor - field - allMappings - protected void addReadOnlyMappings(ClassDescriptor aDescriptor, DatabaseField field, List allMappings)
aDescriptor - field - allMappings - public CMP3Policy clone()
public void convertClassNamesToClasses(ClassLoader classLoader)
convertClassNamesToClasses in class CMPPolicyclassLoader - public boolean isCMP3Policy()
isCMP3Policy in class CMPPolicypublic void setPrimaryKeyClassName(String pkClassName)
public Class getPKClass()
getPKClass in class CMPPolicypublic void setPKClass(Class pkClass)
public String getPKClassName()
public Object getPKClassInstance()
getPKClassInstance in class CMPPolicypublic Object createPrimaryKeyFromId(Object key, AbstractSession session)
createPrimaryKeyFromId in class CMPPolicyprotected Field getField(Class cls, String fieldName) throws NoSuchFieldException
cls - fieldName - NoSuchFieldExceptionpublic Object createBeanUsingKey(Object key, AbstractSession session)
createBeanUsingKey in class CMPPolicykey - Object the primary key to use for initializing the bean's
corresponding pk fieldsprotected CMPPolicy.KeyElementAccessor[] initializePrimaryKeyFields(Class keyClass, AbstractSession session)
protected CMPPolicy.KeyElementAccessor[] getKeyClassFields()
getKeyClassFields in class CMPPolicypublic Object getPkValueFromKeyForField(Object key, DatabaseField field, AbstractSession session)
key - Object the primary key to use to get the value for the fieldfield - DatabaseField the field to find a value forpublic void initialize(ClassDescriptor descriptor, AbstractSession session) throws DescriptorException
initialize in class CMPPolicyDescriptorExceptionpublic void remoteInitialize(ClassDescriptor descriptor, AbstractSession session) throws DescriptorException
remoteInitialize in class CMPPolicyDescriptorExceptionCopyright © 2007–2021 Eclipse.org - EclipseLink Project. All rights reserved.