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

ArrayIndexOutOfBoundsException in CriteriaLoader.java

Open tmanthey opened this issue 6 years ago • 0 comments

Steps to Reproduce

  1. define following domain class class mytest { def my_data = "123" static hasMany = [childItems: mytest] }
  2. execute the following code

def mytest = new mytest() mytest.save(failOnError: true, flush: true) def tests = mytest.where { childItems.contains(mytest) }.findAll()

Expected Behaviour

yield an empty collection

Actual Behaviour

java.lang.ArrayIndexOutOfBoundsException in CriteriaLoader.java getResultRow line 161

result[i] = types[i].nullSafeGet( rs, columnAliases[pos], session, null );

columnAliases is an Array with 0 entries, while pos = 0 tries to retrieve the first element

Environment Information

  • Operating System: Ubuntu 16.04
  • GORM Version: gormVersion=6.1.10.RELEASE
  • Grails Version (if using Grails): 3.3.8
  • JDK Version: 1.8.0_201

tmanthey avatar Feb 18 '19 08:02 tmanthey