Grails获取空关联时返回null

Grails获取空关联时返回null,grails,one-to-many,eager,empty-list,Grails,One To Many,Eager,Empty List,我有如下领域类 Class Author{ String name List books = LazyList.decorate(new ArrayList(), FactoryUtils.instantiateFactory(Book.class) static hasMany = [books:Book] } Class Book { String title static belongsTo = [author:Author] } 现在我正试着去找作者 Author aut

我有如下领域类

Class Author{
String name 

List books = LazyList.decorate(new ArrayList(), FactoryUtils.instantiateFactory(Book.class)


static hasMany = [books:Book]

}

Class Book {
String title
static belongsTo = [author:Author]

}
现在我正试着去找作者

Author authorInstance = Author.find("from Author a inner join fetch a.books where a.id =:authorid",[authorid:Long.parseLong(params.id)]
现在,当作者没有任何书籍时,即书籍协会为空 返回的authorInstance为null


我不确定,但我认为这是因为lazyList(我使用lazyList的原因是为了更方便地进行数据绑定)。

发现问题在于内部联接,当关联为空时,内部联接显然不会返回任何内容,所以我将其更改为左外部联接,它开始工作