Search in sources :

Example 1 with DbListObject

use of org.simpleflatmapper.test.beans.DbListObject in project SimpleFlatMapper by arnaudroger.

the class AbstractMapperBuilderTest method checkDbListJoinMapper.

private void checkDbListJoinMapper(JoinMapper<Object[], Object[][], DbListObject, RuntimeException> mapper) {
    Iterator<DbListObject> iterator = mapper.iterator(new Object[][] { { 1, 1l, "n1" }, { 1, 2l, "n2" }, { 2, 1l, "n1" } });
    DbListObject dbListObject = iterator.next();
    assertEquals(1, dbListObject.getId());
    assertEquals(2, dbListObject.getObjects().size());
    assertEquals(1l, dbListObject.getObjects().get(0).getId());
    assertEquals("n1", dbListObject.getObjects().get(0).getName());
    assertEquals(2l, dbListObject.getObjects().get(1).getId());
    assertEquals("n2", dbListObject.getObjects().get(1).getName());
    dbListObject = iterator.next();
    assertEquals(2, dbListObject.getId());
    assertEquals(1, dbListObject.getObjects().size());
    assertEquals(1l, dbListObject.getObjects().get(0).getId());
    assertEquals("n1", dbListObject.getObjects().get(0).getName());
}
Also used : DbListObject(org.simpleflatmapper.test.beans.DbListObject)

Aggregations

DbListObject (org.simpleflatmapper.test.beans.DbListObject)1