I figured our discussion on Jira [1] may be of general interest, so I
am posting the description here. Cayenne 1.2 uses ObjEntity name as a
key inside ObjectId, while Cayenne 1.1 used the Java class. So if
anyone has a similar mapping, you will need to ensure that the entity
names are unique across DataMaps in the same DataDomain.
[1] http://issues.apache.org/cayenne/browse/CAY-521
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 - 11:14:16 EDT