Page 1 of 1

Booleans mapped to VARCHAR2 Y/N column

Posted: Fri 07 May 2010 14:34
by jkohlhepp
I am a new user to dotConnect for Oracle, so I apologize if there is an obvious solution to this issue. My organization uses VARCHAR2(1) columns to represent boolean values, with the data being either a 'Y' for true or a 'N' for false.

When I use dotConnect with Entity Framework I would like to have these Y/N fields automatically translated to boolean on the model side. I don't want consumers of the entities to deal with this. What is the best way to resolve this? I see that dotConnect automagically converts Number(1) to boolean but it doesn't seem to do the same for VARCHAR booleans.

Thanks.

Posted: Fri 07 May 2010 14:51
by AndreyR
Take a look at our answer at StackOverflow:
http://stackoverflow.com/questions/2788 ... 11#2789411
As an example of the boolean wrapper, take a look at this post:
http://www.devart.com/forums/viewtopic.php?p=44654

Posted: Fri 07 May 2010 17:51
by jkohlhepp
I responded on the SO forum. Good to see you guys are monitoring that forum as well. Unfortunate that we can't get the same magic for VARCHAR(1) as we get for NUMBER(1).

There's no way to affect the internal processing to add a conversion? No extensibility points for that?

Posted: Wed 12 May 2010 14:13
by AndreyR
In fact, the extensibility point is the wrapper I have mentioned.
We are not aware of any other possibility except the ones we have described at StackOverflow at the moment.

Posted: Thu 13 May 2010 18:19
by Alladin
Wrapper approach is not DB queryable, since wrapper property is not available in DB context.

Real support would be really appreciated

Posted: Fri 14 May 2010 11:46
by jkohlhepp
Agreed. Having to patch every instance of a Y/N column with a wrapper property is not, in my mind, an extensibility point. It is a workaround. An extensibility point is if you allowed for custom converters to be added in to your driver so I could tell it that when it encounters my column, it can use my converter to massage from Y/N to bool and back again.

Posted: Fri 14 May 2010 14:48
by crazypit
For us, boolean values are represented by a CHAR(1) type. It would be nice to have the same support with NUMBER(1).