@Test public void getQueryWithEffectiveFromTest() { final List<Object> preparedStatementValues = new ArrayList<>(); Mockito.doReturn("500").when(applicationProperties).getSearchPageSizeDefault(); final AssetConfigurationCriteria assetConfigurationCriteria = AssetConfigurationCriteria.builder() .effectiveFrom(Long.valueOf("1500381058598")).build(); final String expectedQueryWithId = "SELECT ck.keyName as key, cv.value as value FROM egasset_assetconfiguration ck JOIN " + "egasset_assetconfigurationvalues cv ON ck.id = cv.keyId AND ck.tenantId = cv.tenantId WHERE cv.effectiveFrom = ?"; assertEquals(expectedQueryWithId, assetConfigurationQueryBuilder.getQuery(assetConfigurationCriteria, preparedStatementValues)); final List<Object> expectedPreparedStatementValues = new ArrayList<>(); expectedPreparedStatementValues.add(Long.valueOf("1500381058598")); assertTrue(preparedStatementValues.equals(expectedPreparedStatementValues)); }
@SuppressWarnings("rawtypes") public String getQuery(final AssetConfigurationCriteria assetConfigurationCriteria, final List preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(selectQuery, preparedStatementValues, assetConfigurationCriteria); log.debug("Asset Configuration Query : " + selectQuery); return selectQuery.toString(); }
AssetConfigurationQueryBuilder { @SuppressWarnings("rawtypes") public String getQuery(final AssetConfigurationCriteria assetConfigurationCriteria, final List preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(selectQuery, preparedStatementValues, assetConfigurationCriteria); log.debug("Asset Configuration Query : " + selectQuery); return selectQuery.toString(); } }
AssetConfigurationQueryBuilder { @SuppressWarnings("rawtypes") public String getQuery(final AssetConfigurationCriteria assetConfigurationCriteria, final List preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(selectQuery, preparedStatementValues, assetConfigurationCriteria); log.debug("Asset Configuration Query : " + selectQuery); return selectQuery.toString(); }  }
AssetConfigurationQueryBuilder { @SuppressWarnings("rawtypes") public String getQuery(final AssetConfigurationCriteria assetConfigurationCriteria, final List preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(selectQuery, preparedStatementValues, assetConfigurationCriteria); log.debug("Asset Configuration Query : " + selectQuery); return selectQuery.toString(); }  @SuppressWarnings("rawtypes") String getQuery(final AssetConfigurationCriteria assetConfigurationCriteria,
            final List preparedStatementValues); }
AssetConfigurationQueryBuilder { @SuppressWarnings("rawtypes") public String getQuery(final AssetConfigurationCriteria assetConfigurationCriteria, final List preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(selectQuery, preparedStatementValues, assetConfigurationCriteria); log.debug("Asset Configuration Query : " + selectQuery); return selectQuery.toString(); }  @SuppressWarnings("rawtypes") String getQuery(final AssetConfigurationCriteria assetConfigurationCriteria,
            final List preparedStatementValues);  }