当我使用波纹管代码时看到异常找到相同集合的两个表示。 如何解决这个问题?
class ProductModel implements Serializable{
static auditable = true
String name
Product product
Guarantee guarantee
String status
Integer width
Integer height
Integer weight
static hasMany = [variationValues: VariationValue, prices: Price]
static composites = ["prices"]
static mapping = {
sort 'id'
prices cascade: "all-delete-orphan"
searchKeys type: 'text'
}
在ProductModelController中我有这个代码用于delete()
def delete() {
def pricemodel = Price.findAllByProductModel(productModelInstance).findAll()
pricemodel.each { price ->
productModelInstance.removeFromPrices(price)
}
productModelInstance.save()
pricemodel.each {
it.delete()
}
productModelInstance.delete(flush: true)