db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <Fisc...@seitenbau.net>
Subject AW: Can't handle same column name twice - possibly a bug in village?
Date Wed, 15 Dec 2004 08:45:00 GMT




Hi Daniel,

I cannot reproduce this error, see appended test case against the tutorial
database schema. I suppose you use your JoinHelper. Are you sure it is not
a bug in there ?

"Vitzethum, Daniel" <Daniel.Vitzethum@gigatronik.com> schrieb am 14.12.2004
17:21:38:

> Hi Thomas,
>
> >> In addition, where is the home of the village project?
> > http://wiki.apache.org/db-torque/FrequentlyAskedQuestions
>
> I admit, it was the obvious again. A workaround for my problem
> certainly is to have unique column names in the whole data model,
> what means some work for us.
>
> Indeed it seems to be a bug in village (or at least not a feature)
> that the same column name twice leads to wrong results.
>
>
> Thank you anyway,
>
> Daniel
>

   public void testSameColumnName()
    {
        try
        {
            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");
            }
        }
        catch( Exception e)
        {
            e.printStackTrace();
            fail("Exception caught : "
                     + e.getClass().getName()
                     + " : " + e.getMessage());
        }
    }


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message