Examples of FieldConverter


Examples of com.j256.ormlite.field.FieldConverter

  }

  @Test
  public void testGetFieldConverterSerializable() {
    DerbyEmbeddedDatabaseType type = new DerbyEmbeddedDatabaseType();
    FieldConverter converter = type.getFieldConverter(DataType.SERIALIZABLE.getDataPersister(), null);
    assertEquals(SqlType.BLOB, converter.getSqlType());
    assertTrue(converter.isStreamType());
  }
View Full Code Here

Examples of com.j256.ormlite.field.FieldConverter

  }

  @Test(expected = SQLException.class)
  public void testObjectFieldConverterParseDefaultString() throws Exception {
    DerbyEmbeddedDatabaseType type = new DerbyEmbeddedDatabaseType();
    FieldConverter converter = type.getFieldConverter(DataType.SERIALIZABLE.getDataPersister(), null);
    converter.parseDefaultString(null, null);
  }
View Full Code Here

Examples of com.j256.ormlite.field.FieldConverter

  }

  @Test(expected = SQLException.class)
  public void testObjectFieldConverterJavaToArgNonSerializable() throws Exception {
    DerbyEmbeddedDatabaseType type = new DerbyEmbeddedDatabaseType();
    FieldConverter converter = type.getFieldConverter(DataType.SERIALIZABLE.getDataPersister(), null);
    converter.javaToSqlArg(null, new NotSerializable());
  }
View Full Code Here

Examples of com.j256.ormlite.field.FieldConverter

  }

  @Test
  public void testObjectFieldConverterJavaToArg() throws Exception {
    DerbyEmbeddedDatabaseType type = new DerbyEmbeddedDatabaseType();
    FieldConverter converter = type.getFieldConverter(DataType.SERIALIZABLE.getDataPersister(), null);
    Object object = converter.javaToSqlArg(null, "TEST");
    assertEquals(SerialBlob.class, object.getClass());
  }
View Full Code Here

Examples of com.j256.ormlite.field.FieldConverter

    int COLUMN = 1;
    DatabaseResults results = (DatabaseResults) createMock(DatabaseResults.class);
    expect(results.getBlobStream(COLUMN)).andReturn(null);
    replay(results);
    DerbyEmbeddedDatabaseType type = new DerbyEmbeddedDatabaseType();
    FieldConverter converter = type.getFieldConverter(DataType.SERIALIZABLE.getDataPersister(), null);
    assertEquals(null, converter.resultToJava(null, results, COLUMN));
    verify(results);
  }
View Full Code Here

Examples of com.j256.ormlite.field.FieldConverter

    DatabaseResults results = (DatabaseResults) createMock(DatabaseResults.class);
    String value = "NotASerializedObject";
    expect(results.getBlobStream(COLUMN)).andReturn(new ByteArrayInputStream(value.getBytes()));
    replay(results);
    DerbyEmbeddedDatabaseType type = new DerbyEmbeddedDatabaseType();
    FieldConverter converter = type.getFieldConverter(DataType.SERIALIZABLE.getDataPersister(), null);
    Object obj = converter.resultToJava(null, results, COLUMN);
    verify(results);
    assertEquals(value, obj);
  }
View Full Code Here

Examples of org.apache.drill.exec.store.EventBasedRecordWriter.FieldConverter

    public MapJsonConverter(int fieldId, String fieldName, FieldReader reader) {
      super(fieldId, fieldName, reader);
      int i = 0;
      for (String name : reader) {
        FieldConverter converter = EventBasedRecordWriter.getConverter(JsonRecordWriter.this, i++, name, reader.reader(name));
        converters.add(converter);
      }
    }
View Full Code Here

Examples of org.apache.drill.exec.store.EventBasedRecordWriter.FieldConverter

    public MapParquetConverter(int fieldId, String fieldName, FieldReader reader) {
      super(fieldId, fieldName, reader);
      int i = 0;
      for (String name : reader) {
        FieldConverter converter = EventBasedRecordWriter.getConverter(ParquetRecordWriter.this, i++, name, reader.reader(name));
        converters.add(converter);
      }
    }
View Full Code Here

Examples of org.apache.drill.exec.store.EventBasedRecordWriter.FieldConverter

    public RepeatedMapParquetConverter(int fieldId, String fieldName, FieldReader reader) {
      super(fieldId, fieldName, reader);
      int i = 0;
      for (String name : reader) {
        FieldConverter converter = EventBasedRecordWriter.getConverter(ParquetRecordWriter.this, i++, name, reader.reader(name));
        converters.add(converter);
      }
    }
View Full Code Here

Examples of org.apache.drill.exec.store.EventBasedRecordWriter.FieldConverter

    public RepeatedMapJsonConverter(int fieldId, String fieldName, FieldReader reader) {
      super(fieldId, fieldName, reader);
      int i = 0;
      for (String name : reader) {
        FieldConverter converter = EventBasedRecordWriter.getConverter(JsonRecordWriter.this, i++, name, reader.reader(name));
        converters.add(converter);
      }
    }
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.