Bug in cayenne 1.2B1 and 1.2B2

From: Ayhan Kondoz (Ayhan.Kondo..reenet-ag.de)
Date: Thu Apr 20 2006 - 08:27:00 EDT

  • Next message: Andrus Adamchik: "Re: Bug in cayenne 1.2B1 and 1.2B2"

    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:28:31 EDT