### Question:
SingleTableDao extends AbstractDao { @Nonnull protected List<T> findAll(final SelectCommand query) { return super.findAll(reader(), query); } SingleTableDao(
            final TransactionTemplate integrationExecutor,
            final SqlExecutor sqlExecutor,
            final SqlBuilder sql,
            final TableDef table,
            final ColumnDef<I> pkColumn,
            final ResultTransformer<T> reader
    );  SingleTableDao(
            final TransactionTemplate integrationExecutor,
            final SqlExecutor sqlExecutor,
            final TableDef table,
            final ColumnDef<I> pkColumn,
            final ResultTransformer<T> reader
    );   }### Answer:
@Test public void testSelectWhereIn() { final List<List<Object>> res = _personDao.findAll(SQL.select(Person.NAME, Person.HEIGTH, Person.GENDER).from( Person.TABLE).where( Person.LASTNAME.in( "Prefect", "Poppins")).orderBy( Person.ID)); Assert.assertEquals(res, RESULT_WHERE_IN); }
@Test public void testSubselect() { final List<List<Object>> res = _personDao.findAll(SQL.select( Person.NAME, Person.HEIGTH).from( Person.TABLE).where( Person.ID.in( SQL.subSelect( Person.ID).from( Person.TABLE).where( Person.HEIGTH.eq( 170)))).orderBy( Person.ID)); Assert.assertEquals(res, RESULT_SUBSELECT); }
@Test public void testSelectMultipleResults() { final List<List<Object>> res = _personDao.findAll(SQL.select( Person.NAME, Person.HEIGTH).from( Person.TABLE).where( or( Person.LASTNAME.eq( "Prefect"), Person.LASTNAME.eq( "Poppins"))).orderBy( Person.ID)); Assert.assertEquals(res, RESULT_MULTIPLE); }
@Test public void testSelectLike() { final List<List<Object>> res = _personDao.findAll(SQL.select( Person.NAME, Person.HEIGTH).from( Person.TABLE).where( Person.LASTNAME.like( "Pa%")).orderBy( Person.ID)); Assert.assertEquals(res, RESULT_LIKE); }
@Test public void testSelectILike() { final List<List<Object>> res = _personDao.findAll(SQL.select( Person.NAME, Person.HEIGTH).from( Person.TABLE).where( Person.LASTNAME.ilike( "pa%")).orderBy( Person.ID)); Assert.assertEquals(res, RESULT_LIKE); }
@Test public void testGroupSum() { final List<List<Object>> res = _personDao.findAll(SQL.select( Person.HEIGTH, Sql.sum( Person.ID)).from( Person.TABLE).where( Person.ID.gt(new PersonId(0L))).groupBy( Person.HEIGTH).orderBy( Person.HEIGTH)); Assert.assertEquals(res, RESULT_SUM); }
@Test public void testJoin() { final List<List<Object>> res = _personDao.findAll(SQL.select( Person.NAME).from( Person.TABLE, Address.TABLE).where( Person.NAME.eq( Address.CITY))); Assert.assertEquals(res, RESULT_JOIN); }
@Test public void testNotEqualsSelectSingleResult() { final List<List<Object>> res = _personDao.findAll(SQL.select( Person.NAME).from( Person.TABLE).where( Person.LASTNAME.neq( "Prefect")).orderBy( Person.ID)); Assert.assertEquals(res, RESULT_NOT_SINGLE); }