Package com.j256.ormlite.field

Examples of com.j256.ormlite.field.FieldConverter.javaToSqlArg()


        assertEquals(defaultSqlVal, dataPersister.parseDefaultString(fieldType, defaultValStr));
      }
      if (sqlArg == null) {
        // noop
      } else if (sqlArg instanceof byte[]) {
        assertTrue(Arrays.equals((byte[]) sqlArg, (byte[]) dataPersister.javaToSqlArg(fieldType, javaVal)));
      } else {
        assertEquals(sqlArg, dataPersister.javaToSqlArg(fieldType, javaVal));
      }
      assertEquals(isValidGeneratedType, dataPersister.isValidGeneratedType());
      assertEquals(isAppropriateId, dataPersister.isAppropriateId());
View Full Code Here


      if (sqlArg == null) {
        // noop
      } else if (sqlArg instanceof byte[]) {
        assertTrue(Arrays.equals((byte[]) sqlArg, (byte[]) dataPersister.javaToSqlArg(fieldType, javaVal)));
      } else {
        assertEquals(sqlArg, dataPersister.javaToSqlArg(fieldType, javaVal));
      }
      assertEquals(isValidGeneratedType, dataPersister.isValidGeneratedType());
      assertEquals(isAppropriateId, dataPersister.isAppropriateId());
      assertEquals(isEscapedValue, dataPersister.isEscapedValue());
      assertEquals(isEscapedValue, dataPersister.isEscapedDefaultValue());
View Full Code Here

  @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());
  }

  @Test
  public void testObjectFieldConverterJavaToArg() throws Exception {
    DerbyEmbeddedDatabaseType type = new DerbyEmbeddedDatabaseType();
View Full Code Here

  @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());
  }

  @Test
  public void testObjectFieldConverterResultToJavaStreamNull() throws Exception {
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.