grails 3 - 类不存在指定的配置选项 - 错误

时间:2016-03-24 21:03:23

标签: grails

我有一个域类,我在约束闭包中指定字段的顺序:

package com.myapp

class User {
    String loginId
    String password
    Date dateCreated

    static hasOne = [profile:Profile]
    static hasMany = [posts:Post, tags:Tag, following:User]

    static constraints = {
        loginId size: 3..20, unique: true
        password size: 6..8, validator: { passwd, user ->
            passwd != user.loginId
        }
        tags()
        posts()
        following()
        profile nullable: true
    }
}

我希望标记发布以及按此顺序显示。但是,我得到3个错误:

ERROR org.grails.orm.hibernate.cfg.HibernateMappingBuilder - ORM Mapping Invalid: Specified config option [tags] does not exist for class [com.myapp.User]!
ERROR org.grails.orm.hibernate.cfg.HibernateMappingBuilder - ORM Mapping Invalid: Specified config option [posts] does not exist for class [com.myapp.User]!
ERROR org.grails.orm.hibernate.cfg.HibernateMappingBuilder - ORM Mapping Invalid: Specified config option [following] does not exist for class [com.myapp.User]!

有什么想法吗?

由于

标记

0 个答案:

没有答案