I’m working with a legacy database that stores a boolean column as a string, where true is “Y” and false is an empty string. How would I map a property so that it’s able to convert this value to an actual boolean, but still save to the database as “Y” and empty string, for legacy purposes?
Share
I would take care of this with custom getters and setters. Just create your own
getPropertyandsetPropertymethods that will convert the value both directions. I don’t know that there’s any other way to programatically change the meaning of a value directly through the property mappings.