Wrong relations on "Varchar not null" keys
Posted: 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:
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:
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
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))
Code: Select all
INNER JOIN WALLET_PROMOTION t4 ON t3.WALLET_PROMOTION_ID = t4.WALLET_PROMOTION_ID
Can you reproduce this error, and let me know what I am doing wrong?
Thanks,
Lasse