mdaynul opened a new issue, #14600: URL: https://github.com/apache/grails-core/issues/14600
I was trying to use addTo* method, then findAllBy*, it is producing unexpected error. GORM dynamic finder should not suggest such methods - Book.findAllByAuthors() if it does not work. I posted the details in [Stackoverflow](https://stackoverflow.com/questions/47138194/grails-3-3-0-bidirectiona-hasmany-is-not-working), ``` class Author { String name static hasMany = [fiction: Book, nonFiction: Book] } ``` ``` class Book { String title static belongsTo = Author static hasMany = [authors:Author] } ``` ``` class BookController { def testBook(){ def fictBook = new Book(title: "IT") def fictBook2 = new Book(title: "MBA") def fictBook3 = new Book(title: "DBA") def nonFictBook = new Book(title: "On Writing: A Memoir of the Craft") def nonFictBook2 = new Book(title: "Cleaning Codex writer") def a = new Author(name: "Stephen King") .addToFiction(fictBook) .addToNonFiction(nonFictBook) .save(flush:true) println a.fiction // println Book.findAllByAuthors([a]) // doesn't work, same error println Book.withCriteria() { 'in'('authors', [a]) } // it works // println Book.withCriteria() { // authors { // 'in'('id', [a.id]) // } // } render "helllo" } } ``` ### Expected Behaviour Book.findAllByAuthors(<List of Authors>) should give the list of the books from given Authors ### Actual Behaviour ``` URI /book/testBook Class org.h2.jdbc.JdbcSQLException Message null Caused by Parameter "#1" is not set; SQL statement: select this_.id as id1_4_0_, this_.version as version2_4_0_, this_.title as title3_4_0_ from book this_ where this_.id in (?) [90012-195] ``` ### Environment Information - **Operating System**: Ubuntu 17.04 - **Grails Version:** 3.3.0 - **JDK Version:** 1.8.0_131 - **gormVersion:** 6.1.6.RELEASE - **gradleWrapperVersion:** 3.5 ### Example Application - TODO: link to github repository with example that reproduces the issue -- 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]
