grails-data-mapping icon indicating copy to clipboard operation
grails-data-mapping copied to clipboard

Data service JPA query doesnt compile when invoked from a Java class

Open olavgg opened this issue 6 years ago • 1 comments

Steps to Reproduce

  1. Build the application

Expected Behaviour

No compile error

Actual Behaviour

/home/olav/dataquerybug/build/tmp/compileGroovy/groovy-java-stubs/com/example/BookService.java:13: error: element value must be a constant expression
@grails.gorm.services.Query(value=null)  java.util.List<java.lang.String> getTitles();
                                  ^
1 error
startup failed:
Compilation failed; see the compiler error output for details.

1 error


FAILURE: Build failed with an exception.

Environment Information

  • Operating System: Ubuntu 18.04
  • GORM Version: 7.0.0
  • **Grails Version ** 4:00
  • JDK Version: Openjdk 11

Example Application

https://github.com/olavgg/dataquerybug

olavgg avatar Oct 15 '19 10:10 olavgg

Seems like a bug in the joint Groovy compiler

graemerocher avatar Oct 15 '19 10:10 graemerocher