mcaligares opened a new issue, #14593:
URL: https://github.com/apache/grails-core/issues/14593
### Task List
- [x] Steps to reproduce provided
- [x] Example that reproduces the problem uploaded to Github
- [x] Full description of the issue provided (see below)
### Steps to Reproduce
1. Create a domain class with a group field
2. Insert some data to test
3. Create a Unit Test to check the group by
### Expected Behaviour
The "group by" statement should return a group result
```groovy
new User(name: 'user1', team: 'team1').save(flush: true)
new User(name: 'user2', team: 'team2').save(flush: true)
new User(name: 'user3', team: 'team2').save(flush: true)
def result = User.createCriteria().list {
projections {
groupProperty 'team'
}
}
result.size() == 2
result == [team1, team2]
```
### Actual Behaviour
The "group by" statement return a wrong result
```groovy
new User(name: 'user1', team: 'team1').save(flush: true)
new User(name: 'user2', team: 'team2').save(flush: true)
new User(name: 'user3', team: 'team2').save(flush: true)
def result = User.createCriteria().list {
projections {
groupProperty 'team'
}
}
result.size() == 3 // must be 2
result == [team1, team2, team2]
```
### Environment Information
- **Operating System**: Ubuntu 14.04.1 x86_64
- **GORM Version:** 6.1.6.RELEASE
- **Grails Version (if using Grails):** 3.3.0
- **JDK Version:** 1.8.0_40
### Example Application
[Grails Application with Unit Test to
play](https://github.com/mcaligares/gorm-test)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]