#NEWLINE# def test_joinedload( self ) : #NEWLINE# #INDENT# ( Root , Intermediate , Sub1 , Target ) = ( self . classes . Root , self . classes . Intermediate , self . classes . Sub1 , self . classes . Target ) #NEWLINE# sess = Session ( ) #NEWLINE# q = sess . query ( Root ) . options ( joinedload ( Root . sub1 ) . joinedload ( Sub1 . target ) , joinedload ( Root . intermediate ) . joinedload ( Intermediate . sub1 ) . joinedload ( Sub1 . target ) ) #NEWLINE# self . assert_compile ( q , 'SELECT root.id AS root_id, root.sub1_id AS root_sub1_id, target_1.id AS target_1_id, target_1.sub1_id AS target_1_sub1_id, sub1_1.id AS sub1_1_id, parent_1.id AS parent_1_id, intermediate_1.id AS intermediate_1_id, intermediate_1.sub1_id AS intermediate_1_sub1_id, intermediate_1.root_id AS intermediate_1_root_id, target_2.id AS target_2_id, target_2.sub1_id AS target_2_sub1_id, sub1_2.id AS sub1_2_id, parent_2.id AS parent_2_id FROM root LEFT OUTER JOIN intermediate AS intermediate_1 ON root.id = intermediate_1.root_id LEFT OUTER JOIN (parent AS parent_1 JOIN sub1 AS sub1_1 ON parent_1.id = sub1_1.id) ON sub1_1.id = intermediate_1.sub1_id LEFT OUTER JOIN target AS target_1 ON sub1_1.id = target_1.sub1_id LEFT OUTER JOIN (parent AS parent_2 JOIN sub1 AS sub1_2 ON parent_2.id = sub1_2.id) ON sub1_2.id = root.sub1_id LEFT OUTER JOIN target AS target_2 ON sub1_2.id = target_2.sub1_id' )