Changes between Version 6 and Version 7 of Documentation/1.3/Relationships
- Timestamp:
- 07.03.2008 03:40:55 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Documentation/1.3/Relationships
v6 v7 92 92 1. n x SELECT * FROM author WHERE author_id = ''$book->getAuthorId()'' 93 93 94 While clearly this method works, it is not optimal to execute that second query for each iteration. Propel also generates methods in your base peer class to fetch both book and author information in a single query .94 While clearly this method works, it is not optimal to execute that second query for each iteration. Propel also generates methods in your base peer class to fetch both book and author information in a single query using a left join^*^. 95 95 96 96 {{{ … … 106 106 In the above case only a single query is performed: 107 107 108 1. SELECT * FROM book INNERJOIN author ON author.author_id = book.author_id108 1. SELECT * FROM book LEFT JOIN author ON author.author_id = book.author_id 109 109 110 110 Continue reading the [wiki:Documentation/1.3/ManyToManyRelationships Many-to-Many Relationships] page for a treatment of this more-advanced realtionship topic. 111 112 ^*^ Note that in Propel 1.3 the behavior changed from performing INNER JOIN to using LEFT JOIN by default. Please see wiki:Documentation/1.3/Upgrading for more information and instructions on how to keep the original INNER JOIN behavior if your application depends on this. 111 113 112 114 == Using Relationships in Criteria ==