moremore0812 / cqengine

Automatically exported from code.google.com/p/cqengine
0 stars 0 forks source link

Allow queries to be printed #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
From forum: https://groups.google.com/forum/#!topic/cqengine-discuss/xhpeTIH0uh0

It should be possible to print queries for debugging purposes.

toString should be implemented consistently across all Query objects.

Original issue reported on code.google.com by ni...@npgall.com on 27 Aug 2013 at 11:03

GoogleCodeExporter commented 9 years ago
Fixed in trunk.

The code:

    Query<Car> query = and(
        equal(Car.MANUFACTURER, "Toyota"),
        equal(Car.COLOR, Car.Color.BLUE),
        equal(Car.DOORS, 3)
    );

    System.out.println(query);

Now prints:

    and(equal(Car.manufacturer, Toyota), equal(Car.color, BLUE), equal(Car.doors, 3))

The toString representation of queries, now resembles the representation of 
those queries in code (i.e. as constructed using QueryFactory). There is still 
some work to be done for toString representation of JOINs.

I'll leave this ticket open until this fix has been released to Maven central.

Original comment by ni...@npgall.com on 27 Aug 2013 at 11:20

GoogleCodeExporter commented 9 years ago
Implemented the remaining changes to support toString for JOINs.

Released in CQEngine 1.2.1.

Original comment by ni...@npgall.com on 10 Sep 2013 at 9:26