@Test public void testFindForCriteria() { List<GlCodeMaster> glCodeMaster = new ArrayList<>(); glCodeMaster.add(getGlCodeMaster()); String query =""; when(glCodeMasterQueryBuilder.getQuery(new GlCodeMasterCriteria(),new ArrayList<>())).thenReturn(query); when(jdbcTemplate.query(any(String.class), any(Object[].class), any(GlCodeMasterRowMapper.class))).thenReturn(glCodeMaster); assertTrue(glCodeMaster.equals(glCodeMasterRepository.findForCriteria(new GlCodeMasterCriteria()))); }
public List<GlCodeMaster> findForCriteria(GlCodeMasterCriteria glCodeMasterCriteria) { List<Object> preparedStatementValues = new ArrayList<>(); String queryStr = glCodeMasterQueryBuilder.getQuery(glCodeMasterCriteria, preparedStatementValues); List<GlCodeMaster> glCodeMaster = null; try { log.info("queryStr::" + queryStr + "preparedStatementValues::" + preparedStatementValues.toString()); glCodeMaster = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), glCodeMasterRowMapper); log.info("GlCodeMasterRepository::" + glCodeMaster); } catch (Exception ex) { log.info("the exception from findforcriteria : " + ex); } return glCodeMaster; }
GlCodeMasterRepository { public List<GlCodeMaster> findForCriteria(GlCodeMasterCriteria glCodeMasterCriteria) { List<Object> preparedStatementValues = new ArrayList<>(); String queryStr = glCodeMasterQueryBuilder.getQuery(glCodeMasterCriteria, preparedStatementValues); List<GlCodeMaster> glCodeMaster = null; try { log.info("queryStr::" + queryStr + "preparedStatementValues::" + preparedStatementValues.toString()); glCodeMaster = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), glCodeMasterRowMapper); log.info("GlCodeMasterRepository::" + glCodeMaster); } catch (Exception ex) { log.info("the exception from findforcriteria : " + ex); } return glCodeMaster; } }
GlCodeMasterRepository { public List<GlCodeMaster> findForCriteria(GlCodeMasterCriteria glCodeMasterCriteria) { List<Object> preparedStatementValues = new ArrayList<>(); String queryStr = glCodeMasterQueryBuilder.getQuery(glCodeMasterCriteria, preparedStatementValues); List<GlCodeMaster> glCodeMaster = null; try { log.info("queryStr::" + queryStr + "preparedStatementValues::" + preparedStatementValues.toString()); glCodeMaster = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), glCodeMasterRowMapper); log.info("GlCodeMasterRepository::" + glCodeMaster); } catch (Exception ex) { log.info("the exception from findforcriteria : " + ex); } return glCodeMaster; }  }
GlCodeMasterRepository { public List<GlCodeMaster> findForCriteria(GlCodeMasterCriteria glCodeMasterCriteria) { List<Object> preparedStatementValues = new ArrayList<>(); String queryStr = glCodeMasterQueryBuilder.getQuery(glCodeMasterCriteria, preparedStatementValues); List<GlCodeMaster> glCodeMaster = null; try { log.info("queryStr::" + queryStr + "preparedStatementValues::" + preparedStatementValues.toString()); glCodeMaster = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), glCodeMasterRowMapper); log.info("GlCodeMasterRepository::" + glCodeMaster); } catch (Exception ex) { log.info("the exception from findforcriteria : " + ex); } return glCodeMaster; }  List<GlCodeMaster> findForCriteria(GlCodeMasterCriteria glCodeMasterCriteria); @Transactional void create(GlCodeMasterRequest glCodeMasterRequest); void update(GlCodeMasterRequest glCodeMasterRequest); }
GlCodeMasterRepository { public List<GlCodeMaster> findForCriteria(GlCodeMasterCriteria glCodeMasterCriteria) { List<Object> preparedStatementValues = new ArrayList<>(); String queryStr = glCodeMasterQueryBuilder.getQuery(glCodeMasterCriteria, preparedStatementValues); List<GlCodeMaster> glCodeMaster = null; try { log.info("queryStr::" + queryStr + "preparedStatementValues::" + preparedStatementValues.toString()); glCodeMaster = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), glCodeMasterRowMapper); log.info("GlCodeMasterRepository::" + glCodeMaster); } catch (Exception ex) { log.info("the exception from findforcriteria : " + ex); } return glCodeMaster; }  List<GlCodeMaster> findForCriteria(GlCodeMasterCriteria glCodeMasterCriteria); @Transactional void create(GlCodeMasterRequest glCodeMasterRequest); void update(GlCodeMasterRequest glCodeMasterRequest);  }