Page 1 of 1

LoadWith<T> - Eager Loading

Posted: Tue 04 Oct 2011 19:42
by kboeckm
If I have entity A and attempt to use LoadWith to eager load a child entity. The sql that is generated is wrong.

Code: Select all

DataLoadOptions dataLoadOptions = new DataLoadOptions();
dataLoadOptions.LoadWith(b => b.Categories, FetchMode.Join);

context.LoadOptions = dataLoadOptions;

return (from b in db.Banks where b.Bankkey == bankKey select b).FirstOrDefault();
The sql generated looks like this:
SELECT t1.NAME, t1.AWARDTYPE, t1.BANKKEY, t1.COMPANYKEY, t1.PERIODKEY, t1.FAMILYTYPE, t1.ISDISPLAYED, t1.ISNOVALUE, t1.CHECKDATE, t1.LOCKEDBY, t1.CREATEDBY, t1.CREATEDDATE, t1.UPDATEDBY, t1.UPDATEDDATE, t1.COMPLETEDATETYPE, t1.LOCKEXPIRATION, t3.CATEGORYKEY, t3.BANKKEY AS BANKKEY1, t3.MINAWARD, t3.MAXAWARD, t3.ISACTIVE, t3.ISREQUIRED, t3.ISNOVALUE AS ISNOVALUE1, t3.SEQUENCE, t3.CREATEDBY AS CREATEDBY1, t3.CREATEDDATE AS CREATEDDATE1, t3.UPDATEDBY AS UPDATEDBY1, t3.UPDATEDDATE AS UPDATEDDATE1, t3.NAME AS NAME1
FROM (
SELECT t2.NAME, t2.AWARDTYPE, t2.BANKKEY, t2.COMPANYKEY, t2.PERIODKEY, t2.FAMILYTYPE, t2.ISDISPLAYED, t2.ISNOVALUE, t2.CHECKDATE, t2.LOCKEDBY, t2.CREATEDBY, t2.CREATEDDATE, t2.UPDATEDBY, t2.UPDATEDDATE, t2.COMPLETEDATETYPE, t2.LOCKEXPIRATION
FROM INCENTIVE.BANK t2
WHERE (t2.BANKKEY = :p0) AND (ROWNUM <= 1)
ORDER BY t1.BANKKEY ) t1
LEFT OUTER JOIN INCENTIVE.CATEGORY t3 ON t1.BANKKEY = t3.BANKKEY

I receive the following Oracle error:
ORA-00904: "T1"."BANKKEY": invalid identifier.

I thought this was fixed.

Visual Studio 2010
dotConnect for Oracle v6.50.228
LinqConnect v3.0.5

Posted: Wed 05 Oct 2011 15:46
by StanislavK
We have fixed this bug, and plan to release the build with the fix in a couple of days. We will post here when this build is available.

Posted: Fri 07 Oct 2011 12:12
by StanislavK
We have uploaded the builds of dotConnect for Oracle Professional and LinqConnect Professional that include this fix. Please try downloading either of these builds from Registered Users' Area, and tell us if this helps.