public class OObjectEntitySerializer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
OObjectEntitySerializer.OObjectEntitySerializedSchema |
Modifier and Type | Field and Description |
---|---|
static String |
SIMPLE_NAME |
Constructor and Description |
---|
OObjectEntitySerializer() |
Modifier and Type | Method and Description |
---|---|
protected static void |
addCascadeDeleteField(Class<?> currentClass,
String fieldName) |
protected static void |
addFetchLazyField(Class<?> currentClass,
String fieldName) |
static <T> T |
attach(T o,
ODatabaseObject db)
Method that attaches all data contained in the object to the associated document
|
protected static boolean |
checkCascadeAnnotationAttribute(javax.persistence.CascadeType[] cascadeList) |
protected static boolean |
checkCascadeDelete(javax.persistence.ManyToMany manyToMany) |
protected static boolean |
checkCascadeDelete(javax.persistence.OneToMany oneToMany) |
protected static boolean |
checkCascadeDelete(javax.persistence.OneToOne oneToOne) |
protected static void |
checkClassRegistration(Class<?> iClass) |
protected static boolean |
checkFetchLazy(javax.persistence.OneToOne oneToOne) |
static void |
deregisterClass(Class<?> iClass) |
static Object |
deserializeFieldValue(Class<?> type,
Object iFieldValue) |
static <T> T |
detach(T o,
ODatabaseObject db)
Method that detaches all fields contained in the document to the given object.
|
static <T> T |
detach(T o,
ODatabaseObject db,
boolean returnNonProxiedInstance)
Method that detaches all fields contained in the document to the g(e non fare al solitiven
object.
|
static <T> T |
detachAll(T o,
ODatabaseObject db,
boolean returnNonProxiedInstance,
Map<Object,Object> alreadyDetached,
Map<Object,Object> lazyObjects)
Method that detaches all fields contained in the document to the given object and recursively
all object tree.
|
static Class<?> |
getBoundClassTarget(Class<?> type) |
static Field |
getBoundedDocumentField(Class<?> iClass) |
protected static List<Method> |
getCallbackMethods(Class<?> iAnnotation,
Class<?> iClass) |
static List<String> |
getCascadeDeleteFields(Class<?> iClass) |
static List<String> |
getCascadeDeleteFields(String iClassName) |
static List<String> |
getClassFields(Class<?> iClass) |
protected static OObjectEntitySerializer.OObjectEntitySerializedSchema |
getCurrentSerializedSchema() |
static Annotation[] |
getDeclaredAnnotations(Class<?> clazz)
Retrieves and returns all declared
Field s from the given class. |
static Field[] |
getDeclaredFields(Class<?> clazz)
Retrieves and returns all declared
Field s from the given class. |
static ODocument |
getDocument(javassist.util.proxy.Proxy proxiedObject)
Method that given a proxied entity returns the associated ODocument
|
static Class<?> |
getEnclosingClass(Class<?> clazz) |
static Field |
getField(String fieldName,
Class<?> iClass) |
static Object |
getFieldValue(Field iField,
Object iInstance) |
static Field |
getIdField(Class<?> iClass) |
static <T> T |
getNonProxiedInstance(T iObject) |
static ORID |
getRid(javassist.util.proxy.Proxy proxiedObject)
Method that given a proxied entity returns the associated ODocument RID
|
static Class<?> |
getSerializedType(Field iField) |
static Class<?> |
getSpecifiedLinkedType(Field f) |
static Class<?> |
getSpecifiedMultiLinkedType(Field f) |
static OType |
getTypeByClass(Class<?> iClass,
String fieldName) |
static OType |
getTypeByClass(Class<?> iClass,
String fieldName,
Field f) |
static int |
getVersion(javassist.util.proxy.Proxy proxiedObject)
Method that given a proxied entity returns the associated ODocument version
|
static Field |
getVersionField(Class<?> iClass) |
static boolean |
hasBoundedDocumentField(Class<?> iClass) |
static void |
invokeAfterDeserializationCallbacks(Class<?> iClass,
Object iInstance,
ODocument iDocument) |
static void |
invokeAfterSerializationCallbacks(Class<?> iClass,
Object iInstance,
ODocument iDocument) |
static void |
invokeBeforeDeserializationCallbacks(Class<?> iClass,
Object iInstance,
ODocument iDocument) |
static void |
invokeBeforeSerializationCallbacks(Class<?> iClass,
Object iInstance,
ODocument iDocument) |
protected static void |
invokeCallback(Class<?> iClass,
Object iPojo,
ODocument iDocument,
Class<?> iAnnotation) |
protected static void |
invokeCallback(Object iPojo,
ODocument iDocument,
Class<?> iAnnotation) |
static boolean |
isCascadeDeleteField(Class<?> iClass,
String iField) |
static boolean |
isClassField(Class<?> iClass,
String iField) |
static boolean |
isEmbeddedField(Class<?> iClass,
String iField) |
static boolean |
isFetchLazyField(Class<?> iClass,
String iField) |
static boolean |
isIdField(Class<?> iClass,
String iFieldName) |
static boolean |
isIdField(Field iField) |
static boolean |
isSerializedType(Field iField) |
static boolean |
isToSerialize(Class<?> type) |
static boolean |
isTransientField(Class<?> iClass,
String iField) |
static boolean |
isVersionField(Class<?> iClass,
String iFieldName) |
static void |
registerClass(Class<?> iClass) |
static void |
registerClass(Class<?> iClass,
boolean forceReload)
Registers the class informations that will be used in serialization, deserialization and lazy
loading of it.
|
static Object |
serializeFieldValue(Class<?> type,
Object iFieldValue) |
static <T> T |
serializeObject(T o,
ODatabaseObject db)
Method that given an object serialize it an creates a proxy entity, in case the object isn't
generated using the ODatabaseObject.newInstance()
|
static void |
setFieldValue(Field iField,
Object iInstance,
Object iValue) |
static void |
setIdField(Class<?> iClass,
Object iObject,
ORID iValue) |
static void |
setVersionField(Class<?> iClass,
Object iObject,
int iValue) |
static void |
synchronizeSchema() |
protected static <T> T |
toStream(T iPojo,
javassist.util.proxy.Proxy iProxiedPojo,
ODatabaseObject db)
Serialize the user POJO to a ORecordDocument instance.
|
static Object |
typeToStream(Object iFieldValue,
OType iType,
ODatabaseObject db,
ODocument iRecord) |
public static final String SIMPLE_NAME
protected static OObjectEntitySerializer.OObjectEntitySerializedSchema getCurrentSerializedSchema()
public static <T> T serializeObject(T o, ODatabaseObject db)
o
- - the object to serializepublic static <T> T attach(T o, ODatabaseObject db)
T
- o
- :- the object to attachdb
- :- the database instancepublic static <T> T detach(T o, ODatabaseObject db)
OObjectEntitySerializer#detach(T o, ODatabaseObject db, boolean returnNonProxiedInstance)
T
- o
- :- the object to detachdb
- :- the database instancepublic static <T> T detach(T o, ODatabaseObject db, boolean returnNonProxiedInstance)
T
- o
- :- the object to detachdb
- :- the database instancereturnNonProxiedInstance
- :- defines if the return object will be a proxied instance or
not. If set to TRUE and the object does not contains @Id and @Version fields it could
procude data replicationpublic static <T> T detachAll(T o, ODatabaseObject db, boolean returnNonProxiedInstance, Map<Object,Object> alreadyDetached, Map<Object,Object> lazyObjects)
StackOverflowError
with big objects tree. To avoid it
set the stack size with -Xss java optionT
- o
- :- the object to detachdb
- :- the database instancereturnNonProxiedInstance
- :- defines if the return object will be a proxied instance or
not. If set to TRUE and the object does not contains @Id and @Version fields it could
procude data replicationpublic static ODocument getDocument(javassist.util.proxy.Proxy proxiedObject)
proxiedObject
- - the proxied entity objectpublic static ORID getRid(javassist.util.proxy.Proxy proxiedObject)
proxiedObject
- - the proxied entity objectpublic static int getVersion(javassist.util.proxy.Proxy proxiedObject)
proxiedObject
- - the proxied entity objectprotected static void checkClassRegistration(Class<?> iClass)
public static void registerClass(Class<?> iClass)
public static void registerClass(Class<?> iClass, boolean forceReload)
iClass
- :- the Class> to registerforceReload
- whether or not to force the reload of the schema before registeringpublic static void deregisterClass(Class<?> iClass)
protected static boolean checkCascadeDelete(javax.persistence.OneToOne oneToOne)
protected static boolean checkCascadeDelete(javax.persistence.OneToMany oneToMany)
protected static boolean checkCascadeDelete(javax.persistence.ManyToMany manyToMany)
protected static boolean checkCascadeAnnotationAttribute(javax.persistence.CascadeType[] cascadeList)
protected static boolean checkFetchLazy(javax.persistence.OneToOne oneToOne)
protected static void addCascadeDeleteField(Class<?> currentClass, String fieldName)
public static boolean isSerializedType(Field iField)
public static boolean isToSerialize(Class<?> type)
public static Object typeToStream(Object iFieldValue, OType iType, ODatabaseObject db, ODocument iRecord)
public static boolean hasBoundedDocumentField(Class<?> iClass)
public static boolean isIdField(Field iField)
public static void setIdField(Class<?> iClass, Object iObject, ORID iValue) throws IllegalArgumentException, IllegalAccessException
public static void setVersionField(Class<?> iClass, Object iObject, int iValue) throws IllegalArgumentException, IllegalAccessException
public static Object getFieldValue(Field iField, Object iInstance) throws IllegalArgumentException, IllegalAccessException
public static void setFieldValue(Field iField, Object iInstance, Object iValue) throws IllegalArgumentException, IllegalAccessException
public static void invokeBeforeSerializationCallbacks(Class<?> iClass, Object iInstance, ODocument iDocument)
public static void invokeAfterSerializationCallbacks(Class<?> iClass, Object iInstance, ODocument iDocument)
public static void invokeAfterDeserializationCallbacks(Class<?> iClass, Object iInstance, ODocument iDocument)
public static void invokeBeforeDeserializationCallbacks(Class<?> iClass, Object iInstance, ODocument iDocument)
public static <T> T getNonProxiedInstance(T iObject)
public static void synchronizeSchema()
protected static <T> T toStream(T iPojo, javassist.util.proxy.Proxy iProxiedPojo, ODatabaseObject db) throws IllegalArgumentException, IllegalAccessException
iPojo
- User pojo to serializeIllegalAccessException
IllegalArgumentException
protected static void invokeCallback(Object iPojo, ODocument iDocument, Class<?> iAnnotation)
protected static void invokeCallback(Class<?> iClass, Object iPojo, ODocument iDocument, Class<?> iAnnotation)
protected static List<Method> getCallbackMethods(Class<?> iAnnotation, Class<?> iClass)
public static Field[] getDeclaredFields(Class<?> clazz)
Field
s from the given class.clazz
- The class type.Field
s for the object instance.public static Annotation[] getDeclaredAnnotations(Class<?> clazz)
Field
s from the given class.clazz
- The class type.Field
s for the object instance.Copyright © 2009–2020 OrientDB. All rights reserved.