Readonly in DB but Read/Write in Entity?

Posts   
 
    
Meteor
User
Posts: 67
Joined: 06-Apr-2007
# Posted on: 20-Jun-2007 09:09:06   

I'm using the SelfServicing model with LLBLGen Pro v2., SQL Server 2000 database

I have a table called "Members" in my database. It has a computed column called "LoweredUserName".

In the "Mapped entity fields" property grid in the LLBLGen main window, the following properties are displayed:

"Is readonly = True", "Is computed = True".

I would have expected the generated Entity code to have a readonly field for "LoweredUserName", but it's not (it's read/write) rage

The other thing is that the "Is nullable" property in the grid is set to "True" - would this be the cause? confused

Tim

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 20-Jun-2007 09:27:06   

Did you succeed in setting a value to it? I think the readonly check is done when you set the value.

Meteor
User
Posts: 67
Joined: 06-Apr-2007
# Posted on: 21-Jun-2007 00:24:02   

Yes, I could set a value - the property is read/write, even though in the database it is a computed column.

Wouldn't you expect the property to be read only?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 21-Jun-2007 05:56:10   

Meteor wrote:

Yes, I could set a value - the property is read/write, even though in the database it is a computed column.

Wouldn't you expect the property to be read only?

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=4238

David Elizondo | LLBLGen Support Team
Meteor
User
Posts: 67
Joined: 06-Apr-2007
# Posted on: 21-Jun-2007 06:33:31   

Thanks for the quick responses.

Still, for a non-PK readonly database field, I'd have expected that there was no setter for that property in the generated entity.

To me that would be more intuitive than throwing a runtime error.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39612
Joined: 17-Aug-2003
# Posted on: 21-Jun-2007 10:36:07   

Meteor wrote:

Thanks for the quick responses.

Still, for a non-PK readonly database field, I'd have expected that there was no setter for that property in the generated entity.

To me that would be more intuitive than throwing a runtime error.

That's also what we thought so we changed it in v2.5 (now in beta, free upgrade for v2.0 users) simple_smile Readonly fields dont have a setter anymore, except PK fields.

Frans Bouma | Lead developer LLBLGen Pro