Author: batosai
Date: 2008-08-05 14:22:16 +0000 (Tue, 05 Aug 2008)
New Revision: 21615
Modified:
trunk/apps/WoT/src/plugins/WoT/Identity.java
Log:
Cleanup, thanks to toad.
Modified: trunk/apps/WoT/src/plugins/WoT/Identity.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/Identity.java 2008-08-05 13:45:56 UTC
(rev 21614)
+++ trunk/apps/WoT/src/plugins/WoT/Identity.java 2008-08-05 14:22:16 UTC
(rev 21615)
@@ -75,19 +75,10 @@
}
public Score getScore(OwnIdentity treeOwner, ObjectContainer db) {
-
- Query query = db.query();
- query.constrain(Score.class);
- query.descend("treeOwner").constrain(treeOwner);
- query.descend("target").constrain(this);
- ObjectSet<Score> score = query.execute();
-
- if(score.size() == 1) {
- return score.next();
- }
- else {
- return new Score(treeOwner, this, 0, -1, 0);
- }
+
+ ObjectSet<Score> score = db.queryByExample(new Score(treeOwner,
this, 0, 0, 0));
+ if(score.hasNext()) return score.next();
+ else return new Score(treeOwner, this, 0, -1, 0);
}
/**