Thanks! 
Now I want to add a JSON Object to the vertex.

I tried using : 
   JSONObject json = new JSONObject();  
 
  Vertex first = graph.addVertex(null);
       json.put("data","anything);
        first.setProperty("allprop",json);
It shows the same serialization error : 
    How to add implements serializable to JSON???

Error is : 
Exception in thread "main" 
com.orientechnologies.orient.core.exception.OSerializationException: 
Impossible serialize value of type class org.json.JSONObject with the 
ODocument binary serializer
    at 
com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.serialize(ORecordSerializerBinaryV0.java:257)
    at 
com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary.toStream(ORecordSerializerBinary.java:104)
    at 
com.orientechnologies.orient.core.record.impl.ODocument.toStream(ODocument.java:2105)
    at 
com.orientechnologies.orient.core.record.impl.ODocument.toStream(ODocument.java:714)
    at 
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeSaveRecord(ODatabaseDocumentTx.java:1687)
    at 
com.orientechnologies.orient.core.tx.OTransactionOptimistic.addRecord(OTransactionOptimistic.java:312)
    at 
com.orientechnologies.orient.core.tx.OTransactionOptimistic.saveRecord(OTransactionOptimistic.java:253)
    at 
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:2306)
    at 
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:118)
    at 
com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1734)
    at 
com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1725)
    at 
com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:98)
    at 
com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.recursiveLinkSave(ORecordSerializerBinaryV0.java:674)
    at 
com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.writeOptimizedLink(ORecordSerializerBinaryV0.java:688)
    at 
com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.writeSingleValue(ORecordSerializerBinaryV0.java:572)
    at 
com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.serialize(ORecordSerializerBinaryV0.java:261)
    at 
com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary.toStream(ORecordSerializerBinary.java:104)
    at 
com.orientechnologies.orient.core.record.impl.ODocument.toStream(ODocument.java:2105)
    at 
com.orientechnologies.orient.core.record.impl.ODocument.toStream(ODocument.java:714)
    at 
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commitEntry(OAbstractPaginatedStorage.java:1939)
    at 
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commit(OAbstractPaginatedStorage.java:922)
    at 
com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:488)
    at 
com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:147)
    at 
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2427)
    at 
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2397)
    at 
com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.commit(OrientTransactionalGraph.java:162)
    at odb.vedge.main(vedge.java:39)




On Monday, 8 June 2015 13:34:18 UTC+5:30, [email protected] wrote:
>
> Hi,
>>
>    class Data must implement Serializable and provide for this class get 
> method.
>
>    Try this code 
>    first.setProperty("name","anything");
>    first.setProperty("DATA", data.getList());
>  
>
   Regards,
>    Alessandro
>
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to