@Test public void all_input_test(){ AgreementCriteria agreementsModel = new AgreementCriteria(); Map params = new HashMap(); agreementsModel.setTenantId("ap.kurnool"); agreementsModel.setAcknowledgementNumber("ack"); Set<Long> idList = new HashSet<>(); idList.add(1l); idList.add(2l); agreementsModel.setAgreementId(idList); agreementsModel.setAgreementNumber("ack"); agreementsModel.setAllottee(idList); agreementsModel.setAsset(idList); agreementsModel.setFromDate(new Date()); agreementsModel.setToDate(new Date()); agreementsModel.setOffSet(0l); agreementsModel.setSize(10l); agreementsModel.setStateId("1"); agreementsModel.setStatus(Status.ACTIVE); agreementsModel.setTenderNumber("ack"); agreementsModel.setTinNumber("ack"); agreementsModel.setTradelicenseNumber("ack"); assertEquals("SELECT *,agreement.id as lamsagreementid FROM eglams_agreement agreement LEFT OUTER JOIN eglams_demand demand " + "ON agreement.id = demand.agreementid" + " LEFT OUTER JOIN eglams_rentincrementtype rent ON agreement.rent_increment_method = rent.id" + " WHERE agreement.id is not null and AGREEMENT.ID IN (:agreementId) and AGREEMENT.AGREEMENT_NO = :agreementNumber and AGREEMENT.STATUS = :status" + " and AGREEMENT.TENANT_ID = :tenantId and AGREEMENT.TENDER_NUMBER = :tenderNumber and AGREEMENT.TIN_NUMBER = :tinNumber" + " and AGREEMENT.TRADE_LICENSE_NUMBER = :tradeLicenseNumber and AGREEMENT.acknowledgementnumber = :acknowledgementnumber" + " and AGREEMENT.stateid = :stateId and AGREEMENT.ASSET IN (:assetId) and AGREEMENT.ALLOTTEE IN (:allottee)" + " and AGREEMENT.CREATED_DATE >= :fromDate and AGREEMENT.CREATED_DATE <= :toDate" + " ORDER BY AGREEMENT.ID LIMIT :pageSize OFFSET :pageNumber", AgreementQueryBuilder.getAgreementSearchQuery(agreementsModel, params)); assertEquals(15, params.size()); }
public static String getAgreementSearchQuery(AgreementCriteria agreementsModel, @SuppressWarnings("rawtypes") Map params) { StringBuilder selectQuery = new StringBuilder(BASE_SEARCH_QUERY); appendParams(agreementsModel, params, selectQuery); appendLimitAndOffset(agreementsModel, params, selectQuery); return selectQuery.toString(); }
AgreementQueryBuilder { public static String getAgreementSearchQuery(AgreementCriteria agreementsModel, @SuppressWarnings("rawtypes") Map params) { StringBuilder selectQuery = new StringBuilder(BASE_SEARCH_QUERY); appendParams(agreementsModel, params, selectQuery); appendLimitAndOffset(agreementsModel, params, selectQuery); return selectQuery.toString(); } }
AgreementQueryBuilder { public static String getAgreementSearchQuery(AgreementCriteria agreementsModel, @SuppressWarnings("rawtypes") Map params) { StringBuilder selectQuery = new StringBuilder(BASE_SEARCH_QUERY); appendParams(agreementsModel, params, selectQuery); appendLimitAndOffset(agreementsModel, params, selectQuery); return selectQuery.toString(); }  }
AgreementQueryBuilder { public static String getAgreementSearchQuery(AgreementCriteria agreementsModel, @SuppressWarnings("rawtypes") Map params) { StringBuilder selectQuery = new StringBuilder(BASE_SEARCH_QUERY); appendParams(agreementsModel, params, selectQuery); appendLimitAndOffset(agreementsModel, params, selectQuery); return selectQuery.toString(); }  static String getAgreementSearchQuery(AgreementCriteria agreementsModel,
                                                 @SuppressWarnings("rawtypes") Map params); static String getAgreementByAgreementNoQuery(AgreementCriteria agreementsModel, Map<String, Object> params); static String getAgreementQuery(AgreementCriteria agreementsModel,
                                                 @SuppressWarnings("rawtypes") Map params); static String getAgreementIdQuery(final List<Long> idList); static String getHistoryAgreementSearchQuery(Agreement agreement, Map<String, Object> params); }
AgreementQueryBuilder { public static String getAgreementSearchQuery(AgreementCriteria agreementsModel, @SuppressWarnings("rawtypes") Map params) { StringBuilder selectQuery = new StringBuilder(BASE_SEARCH_QUERY); appendParams(agreementsModel, params, selectQuery); appendLimitAndOffset(agreementsModel, params, selectQuery); return selectQuery.toString(); }  static String getAgreementSearchQuery(AgreementCriteria agreementsModel,
                                                 @SuppressWarnings("rawtypes") Map params); static String getAgreementByAgreementNoQuery(AgreementCriteria agreementsModel, Map<String, Object> params); static String getAgreementQuery(AgreementCriteria agreementsModel,
                                                 @SuppressWarnings("rawtypes") Map params); static String getAgreementIdQuery(final List<Long> idList); static String getHistoryAgreementSearchQuery(Agreement agreement, Map<String, Object> params); static final Logger logger; static final String RENT_INCREMENT_TYPE_QUERY; static final String AGREEMENT_QUERY; static final String AGREEMENT_BY_ASSET_QUERY; static final String BASE_SEARCH_QUERY; static final String INSERT_AGREEMENT_QUERY; static final String UPDATE_AGREEMENT_QUERY; }