Skip to content

ReadOnly still tries to update the field #271

@rodriciru

Description

@rodriciru

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions