我是groovy grails的新開發者,我在數據庫測試下有一個名爲user的表。我成功通過使用grails登錄到該數據庫,但我無法成功註冊新用戶。我用GORM導入數據庫,但有一個奇怪的錯誤,我找不到任何可能的解決方案來解決這個問題。groovy.lang.MissingMethodException - 保存GORM
我域類
package com.example.ulu
import grails.persistence.Entity;
@Entity
class User {
String userName
String password
String fullName
static constraints = {
}
}
控制器
def registeruser = {
User a = new User()
a.fullName("John")
a.userName("burak")
a.password("1")
a.save()
}
插件的和依賴
dependencies {
runtime 'mysql:mysql-connector-java:5.1.29'
test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4"
compile "javax.validation:validation-api:1.1.0.Final"
compile "org.grails:grails-spring:2.4.5"
compile "org.codehaus.groovy:groovy-all:2.4.5"
runtime "org.hibernate:hibernate-validator:5.0.3.Final"
}
plugins {
build ":tomcat:8.0.22"
compile ":scaffolding:2.1.2"
compile ':cache:1.1.8'
compile ":asset-pipeline:2.1.5"
runtime ":resources:1.2.14"
runtime ":hibernate4:4.3.8.1"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
}
好奇的是,該導引誤導你以這樣的方式。你只是補充了一點,或者你是否找到了如何上網的地方 – Vahid