| My Snippet of code: ------------------------ List<Predicate> conditions = new ArrayList<Predicate>(); if(eventData.getTotalNetworkElements() > 0) { System.out.println("Inside of TOTAL_NETWORK_ELEMENTS"); int mask = 100; Path<Long> fieldToTest = eventRoot.<Long>get("networkElementCount"); Expression<Long> product = cb.prod(fieldToTest, mask).as(Long.class); Expression<Long> parameter = cb.parameter(Long.class, "parameter"); Expression<Long> mod = cb.toLong(cb.quot(product, parameter)); Predicate maskMatched = cb.equal(mod, new Long(eventData.getTotalNetworkElements())); conditions.add(maskMatched); } //some lines of code for remaining fiels filtering //and end was List<ICRuleSummary> events = typedQuery.setParameter("parameter", count).getResultList(); |