任何想法,爲什麼我會收到此錯誤:不同的對象具有相同標識符
nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [Product#6]
從這個代碼:
def save = {
def productInstance = new Product(params)
if(!productInstance.hasErrors() && productInstance.save()) {
flash.message = "Product ${productInstance.id} created"
redirect(action:show,id:productInstance.id)
}
else {
render(view:'create',model:[productInstance:productInstance])
}
}
需要看你如何呈現的頁面接受初始輸入 – 2009-09-21 17:44:01
該頁面在這一點上是剛剛腳手架代碼的其餘部分。 – Thody 2009-09-23 20:48:25
Product Domain對象的外觀如何? – 2009-10-01 01:22:44