我有一個域名就像
如何在Grails中刪除java.sql.BatchUpdateException?
class BusinessOrganization {
static hasMany = [organizationBusinessTypes:OrganizationBusinessType]
String name
String icon
static constraints = {
name(blank:false,unique:true)
icon(unique:true)
}
String toString() {
return "${name}"
}
}
同時節省了第一次的數據將被保存,並沒有錯誤。但是,當我試圖挽救我第二次出現此錯誤:
Class java.sql.BatchUpdateException Message
Batch entry 0 insert into business_organization (version, icon, name, id) values ('0', '', '', '2') was aborted. Call getNextException to see the cause.
它說:
def save() {
23: def businessOrganizationInstance = new BusinessOrganization(params)
24: if (!businessOrganizationInstance.save(flush: true)) {
25: render(view: "create", model: [businessOrganizationInstance: businessOrganizationInstance])
26: return
27: }
錯誤在第24行,我無法找出我做錯了。在其他領域,這工作得很好。請有人幫忙。我是新來的Grails,現在被困在這裏。我使用PostgreSQL