带有@GrailsCompileStatic批注的Grails GORM类在静态映射关闭表,版本,autoTimestamp中显示为未解析的符号 [英] Grails GORM class with @GrailsCompileStatic annotation shows in the static mapping closure table, version, autoTimestamp as unresolved symbol

查看:124
本文介绍了带有@GrailsCompileStatic批注的Grails GORM类在静态映射关闭表,版本,autoTimestamp中显示为未解析的符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参考:

  1. https://youtrack.jetbrains.com/issue/IDEA-206196
  2. https://youtrack.jetbrains.com/issue /IDEA-207415?_ga=2.103698112.1724644326.1581075934-247190714.1566820331
  1. https://youtrack.jetbrains.com/issue/IDEA-206196
  2. https://youtrack.jetbrains.com/issue/IDEA-207415?_ga=2.103698112.1724644326.1581075934-247190714.1566820331

package de.equeo.requestcode

import grails.compiler.GrailsCompileStatic

@GrailsCompileStatic
class Feature {

    String name

    static mapping = {
        table 'rq_feature'
        version false
        autoTimestamp false
    }

}

这只会在IDE中导致错误(在grails run-app中或在编译时工作正常):

This results in the error in the IDE only (works fine in grails run-app or while compiling):

推荐答案

您可以使用GORM 6.1中添加的内置类型safe dsl代替

Instead of doing that you can use the built in type safe dsl added in GORM 6.1

import static grails.gorm.hibernate.mapping.MappingBuilder.*

class Book {
    String title

    static final mapping = orm {

这篇关于带有@GrailsCompileStatic批注的Grails GORM类在静态映射关闭表,版本,autoTimestamp中显示为未解析的符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆