@Override @Test public void testLimitFormat() throws Exception { connectionSource.setDatabaseType(databaseType); BaseDaoImpl<StringId, String> dao = new BaseDaoImpl<StringId, String>(connectionSource, StringId.class) {}; dao.initialize(); QueryBuilder<StringId, String> qb = dao.queryBuilder(); long limit = 1232; qb.limit(limit); String query = qb.prepareStatementString(); assertTrue( query + " should start with stuff", query.startsWith("SELECT LIMIT 0 " + limit + " ")); }
private List<KnouNoticeInfo> getListKnouNoticeInfo(String blngDc, String blngCd, String anncNo) { List<KnouNoticeInfo> knouNoticeInfoList = null; try { Dao<KnouNoticeInfo, Long> knouNoticeInfoDao = this.getHelper().getKnouNoticeInfoDao(); QueryBuilder<KnouNoticeInfo, Long> qb = knouNoticeInfoDao.queryBuilder(); Where where = qb.where(); where.eq(KNOU_NOTICE.blngDc, blngDc); where.and(); where.eq(KNOU_NOTICE.blngCd, blngCd); where.and(); where.eq(KNOU_NOTICE.anncNo, anncNo); System.out.println("sql:" + qb.prepareStatementString()); knouNoticeInfoList = qb.query(); } catch (SQLException e) { e.printStackTrace(); } return knouNoticeInfoList; }