我有一个域名就像
如何在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