* @throws Exception if the test fails
*/
public void testSameColumnName() throws Exception
{
cleanBookstore();
Author author = new Author();
author.setName("Name");
author.save();
author = new Author();
author.setName("NotCorrespondingName");
author.save();
Book book = new Book();
book.setTitle("Name");
book.setAuthor(author);
book.setIsbn("unknown");
book.save();
Criteria criteria = new Criteria();
criteria.addJoin(BookPeer.TITLE, AuthorPeer.NAME);
BookPeer.addSelectColumns(criteria);
AuthorPeer.addSelectColumns(criteria);
// basically a BaseBookPeer.setDbName(criteria);
// and BasePeer.doSelect(criteria);
List villageRecords = BookPeer.doSelectVillageRecords(criteria);
Record record = (Record) villageRecords.get(0);
book = new Book();
BookPeer.populateObject(record, 1, book);
author = new Author();
AuthorPeer.populateObject(record, BookPeer.numColumns + 1, author);
if (book.getAuthorId() == author.getAuthorId()) {
fail("wrong Ids read");
}
}