@Test public void date_test(){ AgreementCriteria agreementsModel = new AgreementCriteria(); Map params = new HashMap(); agreementsModel.setTenantId("ap.kurnool"); Calendar calendar = Calendar.getInstance(); agreementsModel.setFromDate(calendar.getTime()); calendar.add(Calendar.YEAR,1); agreementsModel.setToDate(calendar.getTime()); 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.STATUS IN ('ACTIVE','WORKFLOW','RENEWED','REJECTED','EXPIRED') and" + " AGREEMENT.TENANT_ID = :tenantId" + " and AGREEMENT.CREATED_DATE >= :fromDate and AGREEMENT.CREATED_DATE <= :toDate" + " ORDER BY AGREEMENT.ID LIMIT :pageSize OFFSET :pageNumber", AgreementQueryBuilder.getAgreementSearchQuery(agreementsModel, params)); assertEquals(3, params.size() - 2); }
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; }