I want to get all possible combinations of two columns using Grails Criteria Projections.
I try this:
def criteria = {
projections{
property('colA')
property('colB')
}
}
def allCombinations = MyDomainEntity.createCriteria().list(criteria)
But, that code returns all the repeated combinations of colA and colB.
I also tried to use distinct
, but only works for a single column.
Any ideas to solve this problem?
Thanks!
I'm not aware of the real problem you try to solve, but according to what you've said you should use
groupProperty
.Here is the example:
P.S. I use Grails 2.5.5 for testing. Maybe your version is a little bit different, but I hope the idea is clear.