Examples of OObjectSerializerContext


Examples of com.orientechnologies.orient.object.serialization.OObjectSerializerContext

    database.delete(test);
  }

  @Test(dependsOnMethods = "testPool")
  public void testCustomTypes() {
    OObjectSerializerContext serializerContext = new OObjectSerializerContext();
    serializerContext.bind(new OObjectSerializer<CustomType, Long>() {

      @Override
      public Long serializeFieldValue(Class<?> itype, CustomType iFieldValue) {
        serialized++;
        return iFieldValue.value;
View Full Code Here

Examples of com.orientechnologies.orient.object.serialization.OObjectSerializerContext

  @Test(dependsOnMethods = "testCustomTypesDatabaseNewInstance")
  public void testEnumListWithCustomTypes() {
    OObjectDatabaseTx database = OObjectDatabasePool.global().acquire(url, "admin", "admin");
    ORID rid = null;
    try {
      OObjectSerializerContext serializerContext = new OObjectSerializerContext();
      serializerContext.bind(new OObjectSerializer<SecurityRole, String>() {

        @Override
        public Object serializeFieldValue(Class<?> type, SecurityRole role) {
          return role.name();
        }
View Full Code Here

Examples of com.orientechnologies.orient.object.serialization.OObjectSerializerContext

    database.delete(test);
  }

  @Test(dependsOnMethods = "testPool")
  public void testCustomTypes() {
    OObjectSerializerContext serializerContext = new OObjectSerializerContext();
    serializerContext.bind(new OObjectSerializer<CustomType, Long>() {

      @Override
      public Long serializeFieldValue(Class<?> itype, CustomType iFieldValue) {
        serialized++;
        return iFieldValue.value;
View Full Code Here

Examples of com.orientechnologies.orient.object.serialization.OObjectSerializerContext

  @Test(dependsOnMethods = "testCustomTypesDatabaseNewInstance")
  public void testEnumListWithCustomTypes() {
    OObjectDatabaseTx database = OObjectDatabasePool.global().acquire(url, "admin", "admin");
    ORID rid = null;
    try {
      OObjectSerializerContext serializerContext = new OObjectSerializerContext();
      serializerContext.bind(new OObjectSerializer<SecurityRole, String>() {

        @Override
        public Object serializeFieldValue(Class<?> type, SecurityRole role) {
          return role.name();
        }
View Full Code Here

Examples of com.orientechnologies.orient.object.serialization.OObjectSerializerContext

    "memory:CustomDatatypeTest");
  db.create();

  // WrappedString custom datatype registration (storing it as
  // OType.STRING)
  OObjectSerializerContext serializerContext = new OObjectSerializerContext();
  serializerContext.bind(new OObjectSerializer<WrappedString, String>() {
      @Override
      public String serializeFieldValue(Class<?> iClass,
        WrappedString iFieldValue) {
    return iFieldValue.getValue();
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.