Skip to Content
0
Former Member
Aug 09, 2005 at 09:47 PM

JDO: Query returns too many results.

42 Views

Hello,

I want to get some DO-Entities from an empty table. When I execute the query I retrieve more than 2 000 000 000 results what is definitly too much for an empty table. The DO has an one-to-many relationship to another class and a many-to-one relationship to another one.

The .map and .jdo files of the class and the classes in relation made accordng to the explanations in the Development Manual chapter "Mapping Persistent Classes to Database Tables" (so including DFG- and embedded- attributes). Enhancing is successfull and the work with the classes that doesn't have relationships also.

The query looks like this:

manager = getPersistenceFactory().getPersistenceManager();

String filter = "version == \"" + version + "\" && postingLevel == \"" + postingLevel +

"\" && closingPeriod == " + closingPeriod + " && bunit== \"" + bunit + "\"";

Query query = manager.newQuery(AD_DO_Protocol.class, filter);

Collection col = (Collection) query.execute();

I also tried to use the extent with the same result.

Any ideas?

Regards,

Jan