Wrong relations on "Varchar not null" keys

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
lasseschou
Posts: 13
Joined: Mon 23 Nov 2009 08:59

Wrong relations on "Varchar not null" keys

Post by lasseschou » Mon 25 Jan 2010 11:01

Hi,

I have two tables that both contain the field WALLET_PROMOTION_ID, VARCHAR2(10) NOT NULL.

I have mapped them in Entity Developer and created a OneToMany relation between them. The relation uses the "WalletPromotionId" on both tables.

When I query the child table and try to access a property from the parent table, the generated SQL makes this join:

Code: Select all

INNER JOIN WALLET_PROMOTION t4 ON (t3.WALLET_PROMOTION_ID = t4.WALLET_PROMOTION_ID) OR ((t3.WALLET_PROMOTION_ID IS NULL) AND (t4.WALLET_PROMOTION_ID IS NULL))
This is wrong since the fields cannot be null, and thus the "IS NULL" should not be checked. The result is a very load-heavy query. The correct join should be:

Code: Select all

INNER JOIN WALLET_PROMOTION t4 ON t3.WALLET_PROMOTION_ID = t4.WALLET_PROMOTION_ID
I have made sure that the "Nullable" property is false on both properties.

Can you reproduce this error, and let me know what I am doing wrong?

Thanks,

Lasse

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

Post by AndreyR » Tue 26 Jan 2010 17:47

Could you please send me (andreyr * devart * com) the model generated for the two tables causing the issue?
If possible, please add the script of these tables.

lasseschou
Posts: 13
Joined: Mon 23 Nov 2009 08:59

Post by lasseschou » Thu 28 Jan 2010 14:52

I've sent you a mail with all requested files. Please let me know if you haven't received it.

Post Reply