Prevent a field from being serialized

Posts   
 
    
ww
User
Posts: 83
Joined: 01-Oct-2004
# Posted on: 05-May-2009 19:46:01   

I have a table that stores an encrypted password in one of its columns. I'm using an Adapter scenario, with a server that handles data fetches and sends the data to the client using fast binary serialization.

The password needs to be accessible in the server application (so I need to include the column in my entity), but I don't want to send the field to the client, since the client does not need it.

I'm trying to figure out the best way to accomplish this with the llblgen entities. I thought about using a field filter to exclude this field whenever I do fetches on behalf of the client, but it seems like it would be difficult to enforce the use of the filter everywhere a fetch might load the object.

Is there a way to prevent llblgen from serializing this one field? Would I need to override SerializeOwnedData and DeserializeOwnedData to write/read all values except the password, without calling the base's methods?

Or does someone have a better idea on how to accomplish this goal?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 06-May-2009 07:21:28   

The way yo do (exclude fields at fetch) is ok. You also could make a routine that clear the field before send it. Or you can send custom DTOs objects.

David Elizondo | LLBLGen Support Team