if (value != null)
{
if (value instanceof OID)
{
// What situation is this catering for exactly ?
DatastoreField col = null;
if (javaTypeMappings[i].getReferenceMapping() != null)
{
col = javaTypeMappings[i].getReferenceMapping().getDatastoreMapping(0).getDatastoreField();
}
else
{
col = javaTypeMappings[i].getDatastoreMapping(0).getDatastoreField();
}
String className = col.getStoredJavaType();
value = OIDFactory.getInstance(ec.getNucleusContext(), className, ((OID)value).getKeyValue());
return ec.findObject(value, false, true, null);
}
else if (ec.getClassLoaderResolver().classForName(getType()).isAssignableFrom(value.getClass()))
{