StrataFrame Forum

Changing data type coming in and out of the object

http://forum.strataframe.net/Topic10496.aspx

By Keith Harvey - 7/20/2007

In our Oracle (cough.. gag..) database, we are using a CHAR(1) to store boolean values (1 = true, 0 = false).

I would like to have my business object take the CHAR(1) and convert it to a .NET bool, and then when I am saving back to the database, convert the .NET bool to a CHAR(1).

Is there a way to do that?

Cheers!

By Greg McGuffey - 7/20/2007

When you are in the BO Mapper, you might have noticed that large area at the bottom, the Custom Code area. If you check the Custom Code button, you can put in the code that the strongly typed property will use (I think you just put in the Get/Set, not the entire property). I'm guessing that you'd also need to set the type in the Custom Data Type (set that to boolean). Then in the custom code area you'd write the code that would do the translation. I haven't done this, so see the help file for more details. However, it should be pretty straight forward.
By Keith Harvey - 7/21/2007

Thanks for the help!
By Greg McGuffey - 7/23/2007

So you got the custom code to work?