and is only used to populate the ``User.addresses`` collection, for those ``User`` objects
that are returned.
-By changing the usage of ``joinedload`` to another style of loading, we can change
+By changing the usage of :func:`.joinedload` to another style of loading, we can change
how the collection is loaded completely independently of SQL used to retrieve
-the actual ``User`` rows we want:
+the actual ``User`` rows we want. Below we change :func:`.joinedload` into
+:func:`.subqueryload`:
.. sourcecode:: python+sql
Querying with Joins
====================
-While :func:`~sqlalchemy.orm.joinedload` created a JOIN specifically to
+While :func:`~sqlalchemy.orm.joinedload` created an anonymous, non-accessible JOIN
+specifically to
populate a collection, we can also work explicitly with joins in many ways.
For example, to construct a simple inner join between ``User`` and
``Address``, we can just :meth:`~sqlalchemy.orm.query.Query.filter()` their
# join from Company entities to the "employees" collection,
# using "people JOIN engineers" as the target. Then join
# to the "computers" collection on the Engineer entity.
- session.query(Company).\
+ session.query(Company).\\
join(people.join(engineers), 'employees').\\
join(Engineer.computers)
query.join(a).\\
join(b, from_joinpoint=True).\\
join(c, from_joinpoint=True)
-
+
+ See also :ref:`ormtutorial_joins` in the ORM tutorial.
+
"""
aliased, from_joinpoint = kwargs.pop('aliased', False),\
kwargs.pop('from_joinpoint', False)