I am building a prefetch path using a relations collection (so I can sort on another table's column). I am specifying the relation in the relationcollection and am trying to use a left join, but there are only inner joins in the generated SQL.
Does the prefetch path objects ignore the join hints? Here is the code i am using:
'-- Create Prefetch and relation object
Dim PrefetchPath As IPrefetchPath = New PrefetchPath(CType(EntityType.SbjctEntity, Integer))
Dim CCGCCGHeaderRelation As IRelationCollection = New RelationCollection
'-- Create relation between CCG and CCGHeader for use in sorting CCG's by CCGHdr.hdrsortid
CCGCCGHeaderRelation.Add(CcgEntity.Relations.CcghdrEntityUsingCcghdrId, JoinHint.Left)
'-- First prefetch element will traverse the graph from subject to strand to ccg
Dim pfElement As PrefetchPathElement = PrefetchPath.Add(SbjctEntity.PrefetchPathStrand, 0, StrandFilter, Nothing, StrandSortClause). _
SubPath.Add(StrandEntity.PrefetchPathCcg, 0, CCGFilter, CCGCCGHeaderRelation, CCGSortClause)
'-- Now we are at the ccg node in the graph, we add the ccgheader prefetch path
pfElement.SubPath.Add(CcgEntity.PrefetchPathCcghdr, 0, Nothing, CCGCCGHeaderRelation, CCGHeaderSortClause)
'-- Next we create the 2nd prefetch element that goes from ccg to standard
Dim pfElement2 As PrefetchPathElement = pfElement.SubPath.Add(CcgEntity.PrefetchPathStndrd, 0, StandardFilter, Nothing, StandardSortClause)
'-- Now we are at the standard node in the graph, so add prefetch paths for grade level and IO urls
pfElement2.SubPath.Add(StndrdEntity.PrefetchPathMstrCd, 0, Nothing, Nothing)
pfElement2.SubPath.Add(StndrdEntity.PrefetchPathInstrctObjectUrl, 0, InstructionalObjectFilter, Nothing, Nothing)
'-- Fetch the data
Subjects.GetMulti(SubjectFilter, 0, SubjectSortClause, Nothing, PrefetchPath)