class MarriageRegnRepository {

	@SuppressWarnings("unchecked")
	public List<MarriageRegn> findForCriteria(MarriageRegnCriteria marriageRegnCriteria) {
		List<Object> preparedStatementValuesForListOfMarriageRegnIds = new ArrayList<Object>();
		String queryStrForListOfMarriageRegnIds = marriageRegnQueryBuilder.getQueryForListOfMarriageRegnIds(
				marriageRegnCriteria, preparedStatementValuesForListOfMarriageRegnIds);

		List<String> listOfApplNos = jdbcTemplate.query(queryStrForListOfMarriageRegnIds,
				preparedStatementValuesForListOfMarriageRegnIds.toArray(), marriageRegnIdsRowMapper);

		System.out.println("queryStrForListOfMarriageRegnIds " + queryStrForListOfMarriageRegnIds);

		System.out.println("listOfApplNos " + listOfApplNos);
		if (listOfApplNos.isEmpty()) {
			return Collections.EMPTY_LIST;
		}
		List<Object> preparedStatementValues = new ArrayList<Object>();
		String queryStr = marriageRegnQueryBuilder.getQuery(marriageRegnCriteria, preparedStatementValues,
				listOfApplNos);
		List<MarriageRegn> marriageRegn = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(),
				marriageRegnRowMapper);
		return marriageRegn;
	}

}