문제

I wrote the following domain class with its unit test. When I run the tests, I get the error message
No such property: admittedMobileUser. When I comment that line in domain class I get the same problem on other fields. Does anyone knows how to solve it?

class MobileUser {
    String userName
    String userDevice="Android"
    Integer userCluster
    Boolean admittedMobileUser
    Date lastTimeUpdatedUserSpaceTime=new Date()
    byte[] userSpaceTimeXml

    static constraints = {
        userName blank:false, unique:true
        userDevice blank:false
        userCluster validator : {val-> return val > 0}
        admittedMobileUser
        lastTimeUpdatedUserSpaceTime
        userSpaceTimeXml maxSize:1024*1024
    }

    String toString(){
        return "${userName}_${userCluster}"
    }

}
도움이 되었습니까?

해결책

remove such rows from constraints :

    ....
    admittedMobileUser
    lastTimeUpdatedUserSpaceTime
    ....

or add minimum one constraint to each!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top