neollie opened a new issue, #14651:
URL: https://github.com/apache/grails-core/issues/14651
### _Description_
Having following domain models
```
class Case { Person person }
class Event { Case generalCase }
class Person { String fullname }
```
I tried test following methods in test
```
def getEvents(List<Long> caseIds,Long personId) {
def events = Event.where {
(generalCase.id in caseIds) || (generalCase.person.id ==
personId)
}.list(max:10, sort:'id', order:'asc')
}
```
or similar ( **note** using && instead of || )
```
def getEvents2(List<Long> caseIds,Long personId) {
def events = Event.where {
(generalCase.id in caseIds) && (generalCase.person.id ==
personId)
}.list(max:10, sort:'id', order:'asc')
}
```
### _Obtained result_
I obtained following error
```
org.hibernate.QueryException: could not resolve property: person of:
events.Event
```
The only case when query works as expected is using _newline_
```
def getEvents3(List<Long> caseIds,Long personId) {
def events = Event.where {
generalCase.id in caseIds
generalCase.person.id == personId
}.list(max:10, sort:'id', order:'asc')
}
```
### _Expected result_
All queries should be valid ( according to my current knowledge) and second
and third query should lead to same result.
Used grails version: 2.3.8
Please see details in provided project. There is EventServiceIntegrationSpec
simulating invocation of the methods.
[events.zip](https://github.com/grails/grails-data-mapping/files/277921/events.zip)
--
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]