You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to upgrade to 4.0.6/7.0.8 since I thought I was experiencing a bug similar to grails/gorm-hibernate5#202, but it appears GORM Data Service Where queries that query on association properties are fundamentally broken.
Task List
Steps to reproduce provided
Stacktrace (if present) provided
Example that reproduces the problem uploaded to Github
Full description of the issue provided (see below)
Steps to Reproduce
Create a domain entity that belongsTo a parent entity and also has a simple association with another entity
Create a GORM data service for said domain entity with a custom Where query that restricts based on the belongsTo association as well as a property on it's simple (peer) association
Expected Behaviour
The Where query pass static compilation and works as expected, performing as though it were a regular detached criteria for the given domain class
Actual Behaviour
While the Where query passes static compilation, it fails the actual runtime query. It appears to think the association property is actually on itself.
org.hibernate.QueryException: could not resolve property: isAlive of: com.test.Book
at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:73)
at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:67)
at at org.grails.orm.hibernate.query.AbstractHibernateQuery.singleResultViaListCall(AbstractHibernateQuery.java:808)
at org.grails.orm.hibernate.query.AbstractHibernateQuery.singleResult(AbstractHibernateQuery.java:795)
at grails.gorm.DetachedCriteria.count_closure3(DetachedCriteria.groovy:515)
...
The text was updated successfully, but these errors were encountered:
jamesdh
changed the title
GORM Data Service @Where queries broken after upgrading from 4.0.3 to 4.0.6
GORM Data Service @Where queries broken after upgrading from Grials 4.0.3 to 4.0.6 and GORM 7.0.4 to 7.0.8
Dec 29, 2020
I'm witnessing this in Micronaut GORM as well, using grails-database-gorm:7.1.0.M2. It's as if the association is cropped off and it tries to apply the associated property directly to the domain class for which the service belongs to.
I tried to upgrade to 4.0.6/7.0.8 since I thought I was experiencing a bug similar to grails/gorm-hibernate5#202, but it appears GORM Data Service Where queries that query on association properties are fundamentally broken.
Task List
Steps to Reproduce
belongsTo
association as well as a property on it's simple (peer) associationExpected Behaviour
The Where query pass static compilation and works as expected, performing as though it were a regular detached criteria for the given domain class
Actual Behaviour
While the Where query passes static compilation, it fails the actual runtime query. It appears to think the association property is actually on itself.
Environment Information
Example Application
Library Domain Model
Book Domain Model
Author Domain Model
Book Service
BookServiceSpec
The text was updated successfully, but these errors were encountered: