In SQL, we have "distinct" keyword to return unique result.
In Hibernate, Projections is used with Criteria to return distinct result.
Criteria crit = session.createCriteria(Survey.class);
ProjectionList projList = Projections.projectionList();
But, in the case, I need to get Session.
I am not sure how to get Session in Infinispan.
Or is there any way to get unique result from Query module in Infinispan?
the technology behind the Query module is not a good fit to implement a "Distinct" operation.
Still all retrieved entities are going to be unique.. or are you needing to apply the distinct to a property of your objects?
In that case you'll have to use a Map/Reduce operation using the Distributed Executor API, that's better suited for this task.