*
* @throws Exception if the test fails.
*/
public void testPartialSelectForeignColumns() throws Exception
{
Criteria criteria = new Criteria();
Book bookToSelect = authorList.get(0).getBooks().get(0);
criteria.where(BookPeer.BOOK_ID, bookToSelect.getBookId());
criteria.addSelectColumn(AuthorPeer.AUTHOR_ID);
criteria.addSelectColumn(BookPeer.BOOK_ID);
criteria.addSelectColumn(AuthorPeer.NAME);
criteria.addSelectColumn(BookPeer.TITLE);
criteria.addJoin(BookPeer.AUTHOR_ID, AuthorPeer.AUTHOR_ID);
List<Book> books = BookPeer.doSelect(criteria);
assertEquals(1, books.size());
Book selectedBook = books.get(0);
assertEquals(bookToSelect.getBookId(), selectedBook.getBookId());