@Test public void all_input_test(){ StatusCriteria statusCriteria = new StatusCriteria(); StatusQueryBuilder builder = new StatusQueryBuilder(); statusCriteria.setCode("Submitted"); statusCriteria.setObjectType("ReceiptHeader"); statusCriteria.setTenantId("default"); assertEquals( "select id,code,objecttype,description,tenantId,createdBy," + "createdDate,lastModifiedBy,lastModifiedDate FROM egcl_status" +" WHERE tenantId = ? AND code = ? AND objecttype = ?", builder.getQuery(statusCriteria, new ArrayList<>())); }
@SuppressWarnings("rawtypes") public String getQuery(StatusCriteria criteria, List preparedStatementValues) { StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(selectQuery, preparedStatementValues, criteria); logger.debug("Query : " + selectQuery); return selectQuery.toString(); }
StatusQueryBuilder { @SuppressWarnings("rawtypes") public String getQuery(StatusCriteria criteria, List preparedStatementValues) { StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(selectQuery, preparedStatementValues, criteria); logger.debug("Query : " + selectQuery); return selectQuery.toString(); } }
StatusQueryBuilder { @SuppressWarnings("rawtypes") public String getQuery(StatusCriteria criteria, List preparedStatementValues) { StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(selectQuery, preparedStatementValues, criteria); logger.debug("Query : " + selectQuery); return selectQuery.toString(); }  }
StatusQueryBuilder { @SuppressWarnings("rawtypes") public String getQuery(StatusCriteria criteria, List preparedStatementValues) { StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(selectQuery, preparedStatementValues, criteria); logger.debug("Query : " + selectQuery); return selectQuery.toString(); }  @SuppressWarnings("rawtypes") String getQuery(StatusCriteria criteria, List preparedStatementValues); }
StatusQueryBuilder { @SuppressWarnings("rawtypes") public String getQuery(StatusCriteria criteria, List preparedStatementValues) { StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(selectQuery, preparedStatementValues, criteria); logger.debug("Query : " + selectQuery); return selectQuery.toString(); }  @SuppressWarnings("rawtypes") String getQuery(StatusCriteria criteria, List preparedStatementValues);  }