@Test public void no_input_test() { final UsageTypeQueryBuilder usageTypeQueryBuilder = new UsageTypeQueryBuilder(); final UsageTypeGetRequest usageTypeGetRequest = new UsageTypeGetRequest(); final Map<String, Object> preparedStatementValues = new HashMap<>(); assertEquals("Select ut.id as ut_id,ut.code as ut_code,ut.name " + "as ut_name,ut.description as ut_description," + "ut.active as ut_active,ut.parent as ut_parent,ut.tenantid as ut_tenantid," + "ut.createdby as ut_createdby,ut.createddate as ut_createddate,ut.lastmodifiedby" + " as ut_lastmodifiedby,ut.lastmodifieddate as ut_lastmodifieddate from" + " egwtr_usage_type ut ORDER BY ut.id DESC", usageTypeQueryBuilder.getQuery(usageTypeGetRequest, preparedStatementValues)); }
public String getQuery(final UsageTypeGetRequest usageTypeGetRequest, final Map<String, Object> preparedStatementValues) { final StringBuilder selectQuery; if (!usageTypeGetRequest.getIsSubUsageType()) selectQuery = new StringBuilder(BASE_USAGE_QUERY); else selectQuery = new StringBuilder(BASE_SUBUSAGE_QUERY); addWhereClause(usageTypeGetRequest, preparedStatementValues, selectQuery); addOrderByClause(usageTypeGetRequest, selectQuery); return selectQuery.toString(); }
UsageTypeQueryBuilder { public String getQuery(final UsageTypeGetRequest usageTypeGetRequest, final Map<String, Object> preparedStatementValues) { final StringBuilder selectQuery; if (!usageTypeGetRequest.getIsSubUsageType()) selectQuery = new StringBuilder(BASE_USAGE_QUERY); else selectQuery = new StringBuilder(BASE_SUBUSAGE_QUERY); addWhereClause(usageTypeGetRequest, preparedStatementValues, selectQuery); addOrderByClause(usageTypeGetRequest, selectQuery); return selectQuery.toString(); } }
UsageTypeQueryBuilder { public String getQuery(final UsageTypeGetRequest usageTypeGetRequest, final Map<String, Object> preparedStatementValues) { final StringBuilder selectQuery; if (!usageTypeGetRequest.getIsSubUsageType()) selectQuery = new StringBuilder(BASE_USAGE_QUERY); else selectQuery = new StringBuilder(BASE_SUBUSAGE_QUERY); addWhereClause(usageTypeGetRequest, preparedStatementValues, selectQuery); addOrderByClause(usageTypeGetRequest, selectQuery); return selectQuery.toString(); }  }
UsageTypeQueryBuilder { public String getQuery(final UsageTypeGetRequest usageTypeGetRequest, final Map<String, Object> preparedStatementValues) { final StringBuilder selectQuery; if (!usageTypeGetRequest.getIsSubUsageType()) selectQuery = new StringBuilder(BASE_USAGE_QUERY); else selectQuery = new StringBuilder(BASE_SUBUSAGE_QUERY); addWhereClause(usageTypeGetRequest, preparedStatementValues, selectQuery); addOrderByClause(usageTypeGetRequest, selectQuery); return selectQuery.toString(); }  String getQuery(final UsageTypeGetRequest usageTypeGetRequest,
            final Map<String, Object> preparedStatementValues); String getUsageTypeInsertQuery(); String getUpdateUsageTypeQuery(); String getUsageTypeIdQuery(); String getUsageTypeIdQueryWithCode(); }
UsageTypeQueryBuilder { public String getQuery(final UsageTypeGetRequest usageTypeGetRequest, final Map<String, Object> preparedStatementValues) { final StringBuilder selectQuery; if (!usageTypeGetRequest.getIsSubUsageType()) selectQuery = new StringBuilder(BASE_USAGE_QUERY); else selectQuery = new StringBuilder(BASE_SUBUSAGE_QUERY); addWhereClause(usageTypeGetRequest, preparedStatementValues, selectQuery); addOrderByClause(usageTypeGetRequest, selectQuery); return selectQuery.toString(); }  String getQuery(final UsageTypeGetRequest usageTypeGetRequest,
            final Map<String, Object> preparedStatementValues); String getUsageTypeInsertQuery(); String getUpdateUsageTypeQuery(); String getUsageTypeIdQuery(); String getUsageTypeIdQueryWithCode(); static final String BASE_USAGE_QUERY; static final String BASE_SUBUSAGE_QUERY; }