Ibratan / kikaha-jdbi3

Jdbi3 support for Kikaha 2
Apache License 2.0
1 stars 1 forks source link

Numeric non primitive types return 0 instead NULL #1

Closed roneigebert closed 1 year ago

roneigebert commented 6 years ago

Test case:

@Entity
public class DataTypes {

    @Column long longPrimitive;
    @Column Long longObject;

}

@Test
public void ensureThatReturnTheSameValuesFromDatabaseOnNumericTypes(){
    final DataTypes object = new DataTypes();
    object.setLongObject( null );
    queries.insert( object );
    final List<DataTypes> results = queries.find();
    assertEquals(1, results.size());
    assertNull( results.get(0).getLongObject() );
    assertEquals( 0, results.get(0).getLongPrimitive() );
}

Types with this error: Long, Integer, Double and Float

roneigebert commented 1 year ago

Solved in version 0.5.0 https://github.com/Ibratan/kikaha-jdbi3/commit/242d33f0948784acb5b2cd79dd9a10c9f5b10ce5