This is a property of Usuario component:
property
name ="idAutor"
column ="IdAutor"
type ="numeric"
readonly="true";
When I try to execute this code:
var usuario = Usuario.findOrFail( rc.id ?: 0 );
usuario.fill( {
"nombre" : rc.nombre ?: usuario.getNombre(),
"login" : rc.login ?: usuario.getLogin(),
"mail" : rc.mail ?: usuario.getMail(),
"activo" : rc.activo ?: 0
} );
usuario.save();
The sql resultant is this :
UPDATE [Usuarios] SET [IdAutor] = 2280 WHERE ([Usuarios].[idUsuario] = 'XXX')
I think idAutor should not be in the SQL (that's readonly meaning). I know about insert="false" and the same about update, but for me, it does have the same meaning.
And yes, readonly prevents from setting that value, but if the example tries to update without explicitly write, lost all the sense.
Insert and Update =false actually removes from the query
This is a property of Usuario component:
When I try to execute this code:
var usuario = Usuario.findOrFail( rc.id ?: 0 ); usuario.fill( { "nombre" : rc.nombre ?: usuario.getNombre(), "login" : rc.login ?: usuario.getLogin(), "mail" : rc.mail ?: usuario.getMail(), "activo" : rc.activo ?: 0 } ); usuario.save();The sql resultant is this :
I think idAutor should not be in the SQL (that's readonly meaning). I know about insert="false" and the same about update, but for me, it does have the same meaning.
And yes, readonly prevents from setting that value, but if the example tries to update without explicitly write, lost all the sense.
Insert and Update =false actually removes from the query