Booleans mapped to VARCHAR2 Y/N column

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
jkohlhepp
Posts: 3
Joined: Fri 07 May 2010 14:30

Booleans mapped to VARCHAR2 Y/N column

Post by jkohlhepp » Fri 07 May 2010 14:34

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.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 07 May 2010 14:51

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

jkohlhepp
Posts: 3
Joined: Fri 07 May 2010 14:30

Post by jkohlhepp » Fri 07 May 2010 17:51

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?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 12 May 2010 14:13

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.

Alladin
Posts: 149
Joined: Mon 27 Nov 2006 16:18
Contact:

Post by Alladin » Thu 13 May 2010 18:19

Wrapper approach is not DB queryable, since wrapper property is not available in DB context.

Real support would be really appreciated

jkohlhepp
Posts: 3
Joined: Fri 07 May 2010 14:30

Post by jkohlhepp » Fri 14 May 2010 11:46

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.

crazypit
Posts: 163
Joined: Wed 15 Apr 2009 08:43

Post by crazypit » Fri 14 May 2010 14:48

For us, boolean values are represented by a CHAR(1) type. It would be nice to have the same support with NUMBER(1).

Post Reply