on 08-09-2005 10:47 PM
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
Hi,
Then what do u mean by :-
When I execute the query I retrieve more than 2 000 000 000 results what is definitly too much for an empty table?
U r saying table is empty then how coem u get 2 000 000 000 results or data set?DO u get any SQL exception since ur reading from an empty table?
Rdgs,
Guru
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jan,
You can have "where" constraints in ur query accessing your primary key with foreign key of the other table.
More over if still ur query returns more results,write a java function which flushes the results say only 100 entries per page.
Rdgs,
Guru
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guru,
first of all in that certain method of the DAO I'm not able to use the primary key because I implement a check if an entity with the given attributes allready exists.
Second I don't want (and as I think don't have) to write the mentioned java function for the following reason: There must be max one result for the given query. Thats a constraint implied by our business logic.
In fact at the given moment there must not be a single result because the table IS EMPTY!!!
Any other ideas?
Thx and regards,
Jan
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.