@Test public void testSelectQueryWithIdAsEmpty() { String expectedQuery = "SELECT ck.keyName as keyName, cv.value as value FROM egmr_serviceconfiguration ck JOIN egmr_serviceconfigurationvalues cv ON ck.id = cv.keyId WHERE ck.tenantId=? ORDER BY ck.keyName ASC,cv.effectivefrom DESC;"; List<Integer> idsList = new ArrayList<>(); serviceConfigurationSearchCriteria = ServiceConfigurationSearchCriteria.builder().ids(idsList) .tenantId("ap.kurnool").build(); List<Object> preparedStatementValues = new ArrayList<>(); String actualQuery = serviceConfigurationQueryBuilder.getSelectQuery(serviceConfigurationSearchCriteria, preparedStatementValues); List<Object> expectedPreparedStatementValues = new ArrayList<>(); expectedPreparedStatementValues.add("ap.kurnool"); assertEquals(preparedStatementValues, expectedPreparedStatementValues); assertEquals(expectedQuery, actualQuery); }
public String getSelectQuery(ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria, List<Object> preparedStatementValues) { selectQuery = new StringBuilder(BASEQUERY); addWhereCluase(serviceConfigurationSearchCriteria, preparedStatementValues); log.debug("QueryForSearch: " + selectQuery.toString()); return selectQuery.toString(); }
ServiceConfigurationQueryBuilder { public String getSelectQuery(ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria, List<Object> preparedStatementValues) { selectQuery = new StringBuilder(BASEQUERY); addWhereCluase(serviceConfigurationSearchCriteria, preparedStatementValues); log.debug("QueryForSearch: " + selectQuery.toString()); return selectQuery.toString(); } }
ServiceConfigurationQueryBuilder { public String getSelectQuery(ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria, List<Object> preparedStatementValues) { selectQuery = new StringBuilder(BASEQUERY); addWhereCluase(serviceConfigurationSearchCriteria, preparedStatementValues); log.debug("QueryForSearch: " + selectQuery.toString()); return selectQuery.toString(); }  }
ServiceConfigurationQueryBuilder { public String getSelectQuery(ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria, List<Object> preparedStatementValues) { selectQuery = new StringBuilder(BASEQUERY); addWhereCluase(serviceConfigurationSearchCriteria, preparedStatementValues); log.debug("QueryForSearch: " + selectQuery.toString()); return selectQuery.toString(); }  String getSelectQuery(ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria,
			List<Object> preparedStatementValues); }
ServiceConfigurationQueryBuilder { public String getSelectQuery(ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria, List<Object> preparedStatementValues) { selectQuery = new StringBuilder(BASEQUERY); addWhereCluase(serviceConfigurationSearchCriteria, preparedStatementValues); log.debug("QueryForSearch: " + selectQuery.toString()); return selectQuery.toString(); }  String getSelectQuery(ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria,
			List<Object> preparedStatementValues); final String BASEQUERY; }