Package org.jongo.model

Examples of org.jongo.model.Coordinate


    }

    @Test
    public void distinctWithParameterizedQuery() throws Exception {
        /* given */
        collection.save(new Friend("John", new Coordinate(1, 2)));
        collection.save(new Friend("Peter", new Coordinate(3, 4)));

        /* when */
        Iterator<Coordinate> coordinates = collection.distinct("coordinate").query("{name:#}", "Peter").as(Coordinate.class).iterator();

        /* then */
        Coordinate first = coordinates.next();
        assertThat(first.lat).isEqualTo(3);
        assertThat(first.lng).isEqualTo(4);
        assertThat(coordinates.hasNext()).isFalse();
    }
View Full Code Here


    }

    @Test
    public void canFindUsingSubProperty() throws Exception {
        /* given */
        collection.save(new Friend("John", new Coordinate(2, 31)));

        /* when */
        Iterator<Friend> results = collection.find("{'coordinate.lat':2}").as(Friend.class).iterator();

        /* then */
 
View Full Code Here

        for (int i = 0; i < reps; i++) {

            DBObject dbo = decode(DefaultDBDecoder.FACTORY);
            DBObject coord = (DBObject) dbo.get("coordinate");
            Coordinate coordinate = new Coordinate((Integer) coord.get("lat"), (Integer) coord.get("lng"));
            Friend f = new Friend((String) dbo.get("name"), (String) dbo.get("address"), coordinate);
        }
    }
View Full Code Here

import java.net.UnknownHostException;

class BenchUtil {

    public static Friend createFriend(int id) {
        return new Friend("John" + id, "Address" + id, new Coordinate(1, id));
    }
View Full Code Here

TOP

Related Classes of org.jongo.model.Coordinate

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.