Re: Bug in cayenne 1.2B1 and 1.2B2

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Apr 20 2006 - 08:32:21 EDT

  • Next message: WONDER: "PK problem with Postgre"

    Hi Ayhan,

    Could you possibly log this bug to Jira? Someone will take a look.

    http://objectstyle.org/cayenne/bugs-features.html

    Thanks,
    Andrus

    On Apr 20, 2006, at 4:27 PM, Ayhan Kondoz wrote:

    > Hello,
    >
    >
    >
    > i found following bug in cayenne 1.2B1 and B2. I know that cayenne 1.1
    > did not have this bug.
    >
    >
    >
    > I have 2 databases and in each database I have a table with the same
    > name. The java classes for the nodes have different packages so the
    > created java classes work fine and there is no conflict with multiple
    > classes that have the same name. However when use a SelectQuery to
    > get a
    > list of objects from the database the returned list always contains
    > objects from the same package so I get a ClassCastException when I try
    > to cast them into the correct object. For Example
    >
    >
    >
    > Database 1:
    >
    > Table: mandant
    >
    > Class: x.y.Mandant
    >
    >
    >
    >
    >
    > Database 2:
    >
    > Table: mandant
    >
    > Class: x.z.Mandant
    >
    >
    >
    >
    >
    > SelectQuery query = new SelectQuery(x.z.Mandant.class)
    >
    > List list = context.performQuery(query);
    >
    >
    >
    > Iterator iter = list.iterator();
    >
    > while ( iter.hasNext() ) {
    >
    > x.z.Mandant m = (x.z.Mandant)iter.next(); // ClassCastException
    >
    > ....
    >
    > }
    >
    >
    >
    > Further tests showed that the object within the list is an instance of
    > x.y.Mandant instead of x.z.Mandant, hence the ClassCastException.
    >
    >
    >
    >
    >
    > Cheers
    >
    > Ayhan Kondoz
    >



    This archive was generated by hypermail 2.0.0 : Thu Apr 20 2006 - 08:32:49 EDT