用 MappingBuilder 解决 mapping DSL 在 IDEA 中报错的问题

IDEA 不能正确识别 GORM 中的 mapping block 下的一些方法名,会报告错误,例如:
IDEA 不识别 cache 方法
我们可以用 MappingBuilder 来解决这个问题,代码如下:

import static grails.gorm.hibernate.mapping.MappingBuilder.*
。。。
	static mapping = orm {
		cache enabled: true
	}
。。。
    static final mapping = orm {
        table "rq_feature"
        version false
        autoTimestamp false
        property("bio", [type: "text"])
        property("firstName", {
            column([name: "fn"])
        })
    }

参考

猜你喜欢

转载自blog.csdn.net/yangbo_hr/article/details/106686601
DSL