Methods Summary |
---|
public void | convertClassNamesToClasses(java.lang.ClassLoader classLoader)INTERNAL:
Convert all the class-name-based settings in this converter to actual class-based
settings. This method is used when converting a project that has been built
with class names to a project with classes.
This method is implemented by subclasses as necessary.
Class dataClass = null;
Class objectClass = null;
try{
if (dataClassName != null){
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
try {
dataClass = (Class)AccessController.doPrivileged(new PrivilegedClassForName(dataClassName, true, classLoader));
} catch (PrivilegedActionException exception) {
throw ValidationException.classNotFoundWhileConvertingClassNames(dataClassName, exception.getException());
}
} else {
dataClass = oracle.toplink.essentials.internal.security.PrivilegedAccessHelper.getClassForName(dataClassName, true, classLoader);
}
setDataClass(dataClass);
}
} catch (ClassNotFoundException exc){
throw ValidationException.classNotFoundWhileConvertingClassNames(dataClassName, exc);
}
try {
if (objectClassName != null){
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
try {
objectClass = (Class)AccessController.doPrivileged(new PrivilegedClassForName(objectClassName, true, classLoader));
} catch (PrivilegedActionException exception) {
throw ValidationException.classNotFoundWhileConvertingClassNames(objectClassName, exception.getException());
}
} else {
objectClass = oracle.toplink.essentials.internal.security.PrivilegedAccessHelper.getClassForName(objectClassName, true, classLoader);
}
setObjectClass(objectClass);
}
} catch (ClassNotFoundException exc){
throw ValidationException.classNotFoundWhileConvertingClassNames(objectClassName, exc);
}
|
public java.lang.Object | convertDataValueToObjectValue(java.lang.Object fieldValue, oracle.toplink.essentials.sessions.Session session)INTERNAL:
The field value must first be converted to the field type, then the attribute type.
Object attributeValue = fieldValue;
if (attributeValue != null) {
try {
attributeValue = ((AbstractSession)session).getDatasourcePlatform().convertObject(attributeValue, getDataClass());
} catch (ConversionException e) {
throw ConversionException.couldNotBeConverted(mapping, mapping.getDescriptor(), e);
}
try {
attributeValue = ((AbstractSession)session).getDatasourcePlatform().convertObject(attributeValue, getObjectClass());
} catch (ConversionException e) {
throw ConversionException.couldNotBeConverted(mapping, mapping.getDescriptor(), e);
}
}
return attributeValue;
|
public java.lang.Object | convertObjectValueToDataValue(java.lang.Object attributeValue, oracle.toplink.essentials.sessions.Session session)INTERNAL:
Convert to the field class.
try {
return ((AbstractSession)session).getDatasourcePlatform().convertObject(attributeValue, getDataClass());
} catch (ConversionException e) {
throw ConversionException.couldNotBeConverted(mapping, mapping.getDescriptor(), e);
}
|
public java.lang.Class | getDataClass()PUBLIC:
Returns the class type of the data value.
return dataClass;
|
public java.lang.String | getDataClassName()INTERNAL:
Return the name of the data type for the MW usage.
if ((dataClassName == null) && (dataClass != null)) {
dataClassName = dataClass.getName();
}
return dataClassName;
|
protected oracle.toplink.essentials.mappings.DatabaseMapping | getMapping()INTERNAL:
Return the mapping.
return mapping;
|
public java.lang.Class | getObjectClass()PUBLIC:
Returns the class type of the object value.
return objectClass;
|
public java.lang.String | getObjectClassName()INTERNAL:
Return the name of the object type for the MW usage.
if ((objectClassName == null) && (objectClass != null)) {
objectClassName = objectClass.getName();
}
return objectClassName;
|
public void | initialize(oracle.toplink.essentials.mappings.DatabaseMapping mapping, oracle.toplink.essentials.sessions.Session session)INTERNAL:
Set the mapping.
this.mapping = mapping;
// CR#... Mapping must also have the field classification.
if (getMapping().isDirectToFieldMapping()) {
AbstractDirectMapping directMapping = (AbstractDirectMapping)getMapping();
// Allow user to specify field type to override computed value. (i.e. blob, nchar)
if (directMapping.getFieldClassification() == null) {
directMapping.setFieldClassification(getDataClass());
}
// Set the object class from the attribute, if null.
if (getObjectClass() == null) {
setObjectClass(directMapping.getAttributeClassification());
}
}
|
public boolean | isMutable()INTERNAL:
If the converter converts the value to a non-atomic value, i.e.
a value that can have its' parts changed without being replaced,
then it must return false, serialization can be non-atomic.
return false;
|
public void | setDataClass(java.lang.Class dataClass)PUBLIC:
Set the class type of the data value.
this.dataClass = dataClass;
|
public void | setDataClassName(java.lang.String dataClassName)INTERNAL:
Set the name of the data type for the MW usage.
this.dataClassName = dataClassName;
|
public void | setObjectClass(java.lang.Class objectClass)PUBLIC:
Set the class type of the object value.
this.objectClass = objectClass;
|
public void | setObjectClassName(java.lang.String objectClassName)INTERNAL:
Set the name of the object type for the MW usage.
this.objectClassName = objectClassName;
|