public class CMP3Policy
extends CMPPolicy
| Modifier and Type | Field and Description |
|---|---|
protected java.util.HashMap<DatabaseField,KeyElementAccessor> |
fieldToAccessorMap
Used to look up the KeyElementAccessor for a specific DatabaseField, used for
resolving DerivedIds
|
protected KeyElementAccessor[] |
keyClassFields
Stores the fields for this classes compound primary key class if required.
|
protected java.lang.Class |
pkClass |
protected java.lang.String |
pkClassName |
| Constructor and Description |
|---|
CMP3Policy() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addReadOnlyMappings(ClassDescriptor aDescriptor,
DatabaseField field,
java.util.List allMappings)
INTERNAL:
Add the writable mapping for the given field to the allMappings list.
|
protected void |
addWritableMapping(ClassDescriptor aDescriptor,
DatabaseField field,
java.util.List allMappings)
INTERNAL:
Add the read only mappings for the given field to the allMappings list.
|
CMP3Policy |
clone()
INTERNAL:
Clone the CMP3Policy
|
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.
|
protected java.lang.reflect.Field |
getField(java.lang.Class cls,
java.lang.String fieldName)
INTERNAL:
|
protected KeyElementAccessor[] |
getKeyClassFields()
INTERNAL:
|
java.lang.Class |
getPKClass()
INTERNAL:
Return the java Class representing the primary key class name
|
java.lang.Object |
getPKClassInstance()
INTERNAL:
|
java.lang.String |
getPKClassName()
INTERNAL:
|
java.lang.Object |
getPkValueFromKeyForField(java.lang.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 KeyElementAccessor[] |
initializePrimaryKeyFields(java.lang.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(java.lang.Class pkClass)
ADVANCED:
|
void |
setPrimaryKeyClassName(java.lang.String pkClassName)
INTERNAL:
|
protected transient KeyElementAccessor[] keyClassFields
protected transient java.util.HashMap<DatabaseField,KeyElementAccessor> fieldToAccessorMap
protected java.lang.String pkClassName
protected java.lang.Class pkClass
protected void addWritableMapping(ClassDescriptor aDescriptor,
DatabaseField field,
java.util.List allMappings)
aDescriptor - field - allMappings - protected void addReadOnlyMappings(ClassDescriptor aDescriptor,
DatabaseField field,
java.util.List allMappings)
aDescriptor - field - allMappings - public CMP3Policy clone()
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
classLoader - public boolean isCMP3Policy()
public void setPrimaryKeyClassName(java.lang.String pkClassName)
public java.lang.Class getPKClass()
public void setPKClass(java.lang.Class pkClass)
public java.lang.String getPKClassName()
public java.lang.Object getPKClassInstance()
public java.lang.Object createPrimaryKeyFromId(java.lang.Object key,
AbstractSession session)
protected java.lang.reflect.Field getField(java.lang.Class cls,
java.lang.String fieldName)
throws java.lang.NoSuchFieldException
cls - fieldName - java.lang.NoSuchFieldExceptionpublic java.lang.Object createBeanUsingKey(java.lang.Object key,
AbstractSession session)
key - Object the primary key to use for initializing the bean's
corresponding pk fieldsprotected KeyElementAccessor[] initializePrimaryKeyFields(java.lang.Class keyClass,
AbstractSession session)
protected KeyElementAccessor[] getKeyClassFields()
public java.lang.Object getPkValueFromKeyForField(java.lang.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
DescriptorExceptionpublic void remoteInitialize(ClassDescriptor descriptor,
AbstractSession session)
throws DescriptorException
DescriptorException