@Test public void getQueryWithAssetNameAndTenantIdTest() { final String expectedQueryWithTenantId = BASE_QUERY + " AND depreciation.tenantId = ? AND asset.name ilike ?"; final DepreciationReportCriteria depreciationReportCriteria = DepreciationReportCriteria.builder() .assetName("park").tenantId("ap.kurnool").build(); final List<Object> preparedStatementValues = new ArrayList<Object>(); preparedStatementValues.add("%" + "park" + "%"); final String actualQueryWithTenantId = depreciationReportQueryBuilder.getQuery(depreciationReportCriteria, preparedStatementValues); assertEquals(expectedQueryWithTenantId, actualQueryWithTenantId); }
public String getQuery(final DepreciationReportCriteria depreciationReportCriteria, final List<Object> preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); log.info("get depreciationReportCriteria query"); addWhereClause(selectQuery, preparedStatementValues, depreciationReportCriteria); log.debug("Query from depreciationReportCriteria querybuilder for asset search : " + selectQuery); return selectQuery.toString(); }
DepreciationReportQueryBuilder { public String getQuery(final DepreciationReportCriteria depreciationReportCriteria, final List<Object> preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); log.info("get depreciationReportCriteria query"); addWhereClause(selectQuery, preparedStatementValues, depreciationReportCriteria); log.debug("Query from depreciationReportCriteria querybuilder for asset search : " + selectQuery); return selectQuery.toString(); } }
DepreciationReportQueryBuilder { public String getQuery(final DepreciationReportCriteria depreciationReportCriteria, final List<Object> preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); log.info("get depreciationReportCriteria query"); addWhereClause(selectQuery, preparedStatementValues, depreciationReportCriteria); log.debug("Query from depreciationReportCriteria querybuilder for asset search : " + selectQuery); return selectQuery.toString(); }  }
DepreciationReportQueryBuilder { public String getQuery(final DepreciationReportCriteria depreciationReportCriteria, final List<Object> preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); log.info("get depreciationReportCriteria query"); addWhereClause(selectQuery, preparedStatementValues, depreciationReportCriteria); log.debug("Query from depreciationReportCriteria querybuilder for asset search : " + selectQuery); return selectQuery.toString(); }  String getQuery(final DepreciationReportCriteria depreciationReportCriteria,
            final List<Object> preparedStatementValues); }
DepreciationReportQueryBuilder { public String getQuery(final DepreciationReportCriteria depreciationReportCriteria, final List<Object> preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); log.info("get depreciationReportCriteria query"); addWhereClause(selectQuery, preparedStatementValues, depreciationReportCriteria); log.debug("Query from depreciationReportCriteria querybuilder for asset search : " + selectQuery); return selectQuery.toString(); }  String getQuery(final DepreciationReportCriteria depreciationReportCriteria,
            final List<Object> preparedStatementValues); static final String BASE_QUERY; }