--
-- You received this message because you are subscribed to the "cqengine-discuss" group.
http://groups.google.com/group/cqengine-discuss
---
You received this message because you are subscribed to the Google Groups "cqengine-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cqengine-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
public static void main(String[] args) {
SQLParser<Car> parser = SQLParser.forPojoWithAttributes(Car.class, createAttributes(Car.class));
IndexedCollection<Car> cars = new ConcurrentIndexedCollection<Car>();
cars.addAll(CarFactory.createCollectionOfCars(10));
ResultSet<Car> results = parser.retrieve(cars, "SELECT * FROM cars WHERE (" +
"(manufacturer = 'Ford' OR manufacturer = 'Honda') " +
"AND price <= 5000.0 " +
"AND color NOT IN ('GREEN', 'WHITE')) " +
"ORDER BY manufacturer DESC, price ASC");
for (Car car : results) {
System.out.println(car); // Prints: Honda Accord, Ford Fusion, Ford Focus
}
}
public static void main(String[] args) {
CQNParser<Car> parser = CQNParser.forPojoWithAttributes(Car.class, createAttributes(Car.class));
IndexedCollection<Car> cars = new ConcurrentIndexedCollection<Car>();
cars.addAll(CarFactory.createCollectionOfCars(10));
ResultSet<Car> results = parser.retrieve(cars,
"and(" +
"or(equal(\"manufacturer\", \"Ford\"), equal(\"manufacturer\", \"Honda\")), " +
"lessThanOrEqualTo(\"price\", 5000.0), " +
"not(in(\"color\", GREEN, WHITE))" +
")");
for (Car car : results) {
System.out.println(car); // Prints: Ford Focus, Ford Fusion, Honda Accord
}
}
Niall,I am trying to execute the test CQNQueryDemo.java from your samples and its giving me the below error. I have included the below jars in my classpath. Can you please advise whether I am missing any thing here?cqengine-2.1.1-all.jarequalsverifier-1.7.2.jarguava-testlib-18.0.jarjunit-dataprovider-1.9.3.jarmockito-core-1.9.5.jarjavassist-3.18.2-GA.jar
Looks like you are using the cqengine shaded jar whose name ends with "-all.jar". That is a fat-jar build of cqengine which already includes all dependencies.
Either: use the normal cqengine jar and make sure you include all of cqengine's dependency jars on your classpath too OR continue to use that shaded jar but don't include any cqengine dependency jars on your classpath.
Right now I guess you have duplicate classes on your classpath.
Or better yet, just use maven. Managing jars by hand is error prone and so "2004" :)
Sent from my Android