Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails GORM where method not recognised by IntelliJ

This is more of a minor annoyance than anything, but can anyone explain why IntelliJ (15 in my case) isn't able to find the where method for Domain objects? I am able to use dynamic finders with completion, but there where method never completes.

In the image below you can see that IntelliJ is happy with the findBy*, but has no idea on the where. This is also the case when trying to autocomplete method names.

Find account by version two ways

Debugging etc works fine, so it's working somehow internally.

like image 221
acanby Avatar asked Feb 07 '16 23:02

acanby


1 Answers

I found out that the docs, in the section Using GORM for Hibernate Outside Grails, have a nice TIP that works anywhere :)

import grails.gorm.annotation.Entity

@Entity
public MyClass implements GormEntity<MyClass> {
    // class code enter code here
}
like image 127
genuinefafa Avatar answered Sep 28 '22 10:09

genuinefafa