@Test public void test_Should_Check_PipeSize() throws Exception { final List<Object> preparedStatementValues = new ArrayList<>(); preparedStatementValues.add(1.22); preparedStatementValues.add(1.45); assertNotNull(pipeSizeRepository.checkPipeSizeInmmAndCode("ABC", 1.22, "1")); }
public boolean checkPipeSizeInmmAndCode(final String code, final Double sizeInMilimeter, final String tenantId) { final List<Object> preparedStatementValues = new ArrayList<>(); preparedStatementValues.add(sizeInMilimeter); preparedStatementValues.add(tenantId); final String query; if (code == null) query = PipeSizeQueryBuilder.selectPipeSizeInmmAndCodeQuery(); else { preparedStatementValues.add(code); query = PipeSizeQueryBuilder.selectPipeSizeInmmAndCodeNotInQuery(); } final List<Map<String, Object>> pipeSizes = jdbcTemplate.queryForList(query, preparedStatementValues.toArray()); if (!pipeSizes.isEmpty()) return false; return true; }
PipeSizeRepository { public boolean checkPipeSizeInmmAndCode(final String code, final Double sizeInMilimeter, final String tenantId) { final List<Object> preparedStatementValues = new ArrayList<>(); preparedStatementValues.add(sizeInMilimeter); preparedStatementValues.add(tenantId); final String query; if (code == null) query = PipeSizeQueryBuilder.selectPipeSizeInmmAndCodeQuery(); else { preparedStatementValues.add(code); query = PipeSizeQueryBuilder.selectPipeSizeInmmAndCodeNotInQuery(); } final List<Map<String, Object>> pipeSizes = jdbcTemplate.queryForList(query, preparedStatementValues.toArray()); if (!pipeSizes.isEmpty()) return false; return true; } }
PipeSizeRepository { public boolean checkPipeSizeInmmAndCode(final String code, final Double sizeInMilimeter, final String tenantId) { final List<Object> preparedStatementValues = new ArrayList<>(); preparedStatementValues.add(sizeInMilimeter); preparedStatementValues.add(tenantId); final String query; if (code == null) query = PipeSizeQueryBuilder.selectPipeSizeInmmAndCodeQuery(); else { preparedStatementValues.add(code); query = PipeSizeQueryBuilder.selectPipeSizeInmmAndCodeNotInQuery(); } final List<Map<String, Object>> pipeSizes = jdbcTemplate.queryForList(query, preparedStatementValues.toArray()); if (!pipeSizes.isEmpty()) return false; return true; }  }
PipeSizeRepository { public boolean checkPipeSizeInmmAndCode(final String code, final Double sizeInMilimeter, final String tenantId) { final List<Object> preparedStatementValues = new ArrayList<>(); preparedStatementValues.add(sizeInMilimeter); preparedStatementValues.add(tenantId); final String query; if (code == null) query = PipeSizeQueryBuilder.selectPipeSizeInmmAndCodeQuery(); else { preparedStatementValues.add(code); query = PipeSizeQueryBuilder.selectPipeSizeInmmAndCodeNotInQuery(); } final List<Map<String, Object>> pipeSizes = jdbcTemplate.queryForList(query, preparedStatementValues.toArray()); if (!pipeSizes.isEmpty()) return false; return true; }  PipeSizeRequest create(final PipeSizeRequest pipeSizeRequest); PipeSizeRequest update(final PipeSizeRequest pipeSizeRequest); boolean checkPipeSizeInmmAndCode(final String code, final Double sizeInMilimeter, final String tenantId); List<PipeSize> findForCriteria(final PipeSizeGetRequest pipeSizeGetRequest); }
PipeSizeRepository { public boolean checkPipeSizeInmmAndCode(final String code, final Double sizeInMilimeter, final String tenantId) { final List<Object> preparedStatementValues = new ArrayList<>(); preparedStatementValues.add(sizeInMilimeter); preparedStatementValues.add(tenantId); final String query; if (code == null) query = PipeSizeQueryBuilder.selectPipeSizeInmmAndCodeQuery(); else { preparedStatementValues.add(code); query = PipeSizeQueryBuilder.selectPipeSizeInmmAndCodeNotInQuery(); } final List<Map<String, Object>> pipeSizes = jdbcTemplate.queryForList(query, preparedStatementValues.toArray()); if (!pipeSizes.isEmpty()) return false; return true; }  PipeSizeRequest create(final PipeSizeRequest pipeSizeRequest); PipeSizeRequest update(final PipeSizeRequest pipeSizeRequest); boolean checkPipeSizeInmmAndCode(final String code, final Double sizeInMilimeter, final String tenantId); List<PipeSize> findForCriteria(final PipeSizeGetRequest pipeSizeGetRequest);  }