summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/qe
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2007-04-29 17:47:50 +0000
committerBrian S. O'Neill <bronee@gmail.com>2007-04-29 17:47:50 +0000
commit97af4be638e371a2f693bde2798fc233a143f3f9 (patch)
tree533f5d02f91eaf1db500ed4480be23b1712d214d /src/main/java/com/amazon/carbonado/qe
parent1f04eea48231dbc29ed39c100a9d4a7c7f8a8b37 (diff)
Merged in support for derived properties.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/qe')
-rw-r--r--src/main/java/com/amazon/carbonado/qe/AbstractQuery.java6
-rw-r--r--src/main/java/com/amazon/carbonado/qe/EmptyQuery.java18
2 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/com/amazon/carbonado/qe/AbstractQuery.java b/src/main/java/com/amazon/carbonado/qe/AbstractQuery.java
index 436c2c2..7639348 100644
--- a/src/main/java/com/amazon/carbonado/qe/AbstractQuery.java
+++ b/src/main/java/com/amazon/carbonado/qe/AbstractQuery.java
@@ -123,4 +123,10 @@ public abstract class AbstractQuery<S extends Storable> implements Query<S>, App
}
return b.toString();
}
+
+ @Override
+ public abstract int hashCode();
+
+ @Override
+ public abstract boolean equals(Object obj);
}
diff --git a/src/main/java/com/amazon/carbonado/qe/EmptyQuery.java b/src/main/java/com/amazon/carbonado/qe/EmptyQuery.java
index 161ad90..d9969c5 100644
--- a/src/main/java/com/amazon/carbonado/qe/EmptyQuery.java
+++ b/src/main/java/com/amazon/carbonado/qe/EmptyQuery.java
@@ -273,6 +273,24 @@ public final class EmptyQuery<S extends Storable> extends AbstractQuery<S> {
return false;
}
+ @Override
+ public int hashCode() {
+ return mFactory.hashCode() * 31 + mOrdering.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj instanceof EmptyQuery) {
+ EmptyQuery<?> other = (EmptyQuery<?>) obj;
+ return mFactory.equals(other.mFactory)
+ && mOrdering.equals(other.mOrdering);
+ }
+ return false;
+ }
+
private IllegalStateException error() {
return new IllegalStateException("Query doesn't have any parameters");
}