Package org.mongodb.morphia.query.Shape

Examples of org.mongodb.morphia.query.Shape.Point


        getDs().ensureIndexes();
        final Place place1 = new Place("place1", new double[]{1, 1});
        getDs().save(place1);
        final Place found = getDs().find(Place.class)
                                   .field("loc")
                                   .within(Shape.centerSphere(new Point(0, 1), 1))
                                   .get();
        Assert.assertNotNull(found);
    }
View Full Code Here


        getDs().ensureIndexes();
        final Place place1 = new Place("place1", new double[]{1, 1});
        getDs().save(place1);
        final Place found = getDs().find(Place.class)
                                   .field("loc")
                                   .within(Shape.centerSphere(new Point(0, 1), 1))
                                   .get();
        Assert.assertNotNull(found);
    }
View Full Code Here

        getDs().ensureIndexes();
        final Place place1 = new Place("place1", new double[]{1, 1});
        getDs().save(place1);
        final Place found = getDs().find(Place.class)
                                   .field("loc")
                                   .within(Shape.center(new Point(2, 2), .4))
                                   .get();
        Assert.assertNull(found);
    }
View Full Code Here

        getDs().ensureIndexes();
        final Place place1 = new Place("place1", new double[]{1, 1});
        getDs().save(place1);
        final Place found = getDs().find(Place.class)
                                   .field("loc")
                                   .within(Shape.box(new Point(0, 0), new Point(2, 2)))
                                   .get();
        Assert.assertNotNull(found);
    }
View Full Code Here

        getDs().ensureIndexes();
        final Place place1 = new Place("place1", new double[]{1, 1});
        getDs().save(place1);
        final Place found = getDs().find(Place.class)
                                   .field("loc")
                                   .within(Shape.box(new Point(0, 0), new Point(.4, .5)))
                                   .get();
        Assert.assertNull(found);
    }
View Full Code Here

        getDs().ensureIndexes();
        final Place place1 = new Place("place1", new double[]{1, 1});
        getDs().save(place1);
        final Place found = getDs().find(Place.class)
                                   .field("loc")
                                   .within(Shape.box(new Point(0, 0), new Point(2, 2)))
                                   .get();
        Assert.assertNotNull(found);
    }
View Full Code Here

        getDs().ensureIndexes();
        final Place place1 = new Place("place1", new double[]{1, 1});
        getDs().save(place1);
        final Place found = getDs().find(Place.class)
                                   .field("loc")
                                   .within(Shape.box(new Point(0, 0), new Point(.4, .5)))
                                   .get();
        Assert.assertNull(found);
    }
View Full Code Here

        getDs().ensureIndexes();
        final Place place1 = new Place("place1", new double[]{0, 1});
        getDs().save(place1);
        final Place found = getDs().find(Place.class)
                                   .field("loc")
                                   .within(Shape.polygon(new Point(0, 0), new Point(0, 5), new Point(2, 3), new Point(2, 0)))
                                   .get();
        Assert.assertNotNull(found);
    }
View Full Code Here

        getDs().ensureIndexes();
        final Place place1 = new Place("place1", new double[]{10, 1});
        getDs().save(place1);
        final Place found = getDs().find(Place.class)
                                   .field("loc")
                                   .within(Shape.polygon(new Point(0, 0), new Point(0, 5), new Point(2, 3), new Point(2, 0)))
                                   .get();
        Assert.assertNull(found);
    }
View Full Code Here

TOP

Related Classes of org.mongodb.morphia.query.Shape.Point

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.