Problems updating record data with dataBinding in Grails

2

I have the following domains:

class Cliente {

    static belongsTo = [empresa: Empresa]

    static constraints = {
    }
}

class Empresa {

    /* aqui temos alguns atributos*/

}

When creating a new business class record I can do good:

Empresa empresa = new Empresa(params)
empresa.save(flush:true)

but attempting to update this registry:

Empresa empresa = Empresa.get(params.id)

/* ja tentei de todas essas maneiras */

empresa.properties = params
empresa = params
bindData(empresa,params)
bindData(empresa,params, exclude:[empresa.id]) // ja tentei com include em td tbm
bindData(empresa.properties, params)

I've also tried to put the property bindable: true into constraints more than nothing solved, sometimes the error and sometimes it just does not update the data, version of grails: 2.4.2

    
asked by anonymous 13.08.2014 / 22:58

1 answer

0

Solved! - > Doubts in Grails Brazil

    
25.08.2014 / 15:01