Package com.google.appengine.api.datastore

Examples of com.google.appengine.api.datastore.Rating


        super.setUp();

        values = asList(
            asSet((Object) null),
            asSet((short) -10, -10, -10L),
            asSet((short) 10, 10, 10L, new Rating(10)),
            asSet((short) 20, 20, 20L, new Rating(20)),
            asSet(createDate(2013, 1, 1)),
            asSet(createDate(2013, 5, 5)),
            asSet(1381363199999999L),   // 1 microsecond before 2013-10-10
            asSet(new Date(1381363200000L), 1381363200000000L), // 2013-10-10
            asSet(1381363200000001L),   // 1 microsecond after 2013-10-10
View Full Code Here


        Integer[] intDat = {456, 987, 123};
        Long[] longDat = {Long.MAX_VALUE, new Long(456), Long.MIN_VALUE};
        Double[] doubleDat = {456.456, 123.123, 987.987};
        Short[] shortDat = {Short.MIN_VALUE, Short.MAX_VALUE, 456};
        Float[] floatDat = {Float.MAX_VALUE, Float.MIN_VALUE, new Float(456.456)};
        Rating[] ratingDat = {new Rating(11), new Rating(55), new Rating(99)};

        Query q = new Query(kindName, rootKey);
        if (service.prepare(q).countEntities(FetchOptions.Builder.withDefaults()) == 0) {
            List<Entity> eList = new ArrayList<Entity>();
            for (int i = 0; i < 3; i++) {
View Full Code Here

        doAllFilters(kindName, "intProp", 456);
        doAllFilters(kindName, "longProp", 456);
        doNonEqFilters(kindName, "doubleProp", 456.456);
        doAllFilters(kindName, "shortProp", 456);
        doNonEqFilters(kindName, "floatProp", new Float(456.456));
        doAllFilters(kindName, "ratingProp", new Rating(55));
    }
View Full Code Here

        doSort(kindName, "longProp", Long.MAX_VALUE, Query.SortDirection.DESCENDING);
        doSort(kindName, "doubleProp", new Double("123.123"), Query.SortDirection.ASCENDING);
        doSort(kindName, "doubleProp", new Double("987.987"), Query.SortDirection.DESCENDING);
        doSort(kindName, "shortProp", new Integer(Short.MIN_VALUE), Query.SortDirection.ASCENDING);
        doSort(kindName, "shortProp", new Integer(Short.MAX_VALUE), Query.SortDirection.DESCENDING);
        doSort(kindName, "ratingProp", new Rating(11), Query.SortDirection.ASCENDING);
        doSort(kindName, "ratingProp", new Rating(99), Query.SortDirection.DESCENDING);
    }
View Full Code Here

    @Test
    public void testRatingType() {
        String propertyName = "ratingProp";
        List<Entity> elist = doQuery(kindName, propertyName, Rating.class, true);
        Rating rate = (Rating) elist.get(0).getProperty(propertyName);
        Rating sameDat = (Rating) elist.get(0).getProperty(propertyName);
        Rating diffDat = (Rating) elist.get(1).getProperty(propertyName);
        assertTrue(rate.equals(sameDat));
        assertFalse(rate.equals(diffDat));
        assertEquals(11, rate.getRating());
        assertEquals(0, rate.compareTo(sameDat));
        assertTrue(rate.compareTo(diffDat) != 0);
View Full Code Here

            newRec.setProperty("booleanData", true);
            newRec.setProperty("urlData", new Link("http://www.google.com"));
            newRec.setProperty("emailData", new Email("somebody123" + i + "@google.com"));
            newRec.setProperty("phoneData", new PhoneNumber("408-123-000" + i));
            newRec.setProperty("adressData", new PostalAddress("123 st. CA 12345" + i));
            newRec.setProperty("ratingData", new Rating(10 * i));
            newRec.setProperty("geoptData", new GeoPt((float) (i + 0.12), (float) (i + 0.98)));
            newRec.setProperty("categoryData", new Category("category" + i));
            newRec.setProperty("intList", Arrays.asList(i, 50 + i, 90 + i));
            elist.add(newRec);
        }
View Full Code Here

    @Test
    public void testSetFilterRating() {
        Query query = new Query(kindName, rootKey);
        List<Filter> filterList = new ArrayList<>();
        filterList.add(Query.FilterOperator.LESS_THAN.of("ratingData", new Rating(30)));
        filterList.add(Query.FilterOperator.GREATER_THAN.of("ratingData", new Rating(0)));
        Filter filter1 = Query.CompositeFilterOperator.or(filterList);
        Filter filter2 = Query.FilterOperator.EQUAL.of("ratingData", new Rating(20));
        query.setFilter(Query.CompositeFilterOperator.and(filter1, filter2));
        assertEquals(1, service.prepare(query).countEntities(fo));
    }
View Full Code Here

                newRec.setProperty("intData", 10 * i);
                newRec.setProperty("stringList", Arrays.asList("abc" + i, "xyz" + i, "abc" + i));
                newRec.setProperty("intList", Arrays.asList(i, 50 + i, 90 + i));
                newRec.setProperty("timestamp", new Date());
                newRec.setProperty("floatData", new Float(i + 0.1));
                newRec.setProperty("ratingData", new Rating(i + 20));
                newRec.setProperty("booleanData", true);
                newRec.setProperty("geoptData", new GeoPt((float) (i * 20 - 90), new Float(i * 30 - 179.1)));
                newRec.setProperty("byteStrProp", new ShortBlob(("shortblob" + (i * 30)).getBytes()));
                elist.add(newRec);
            }
View Full Code Here

                        newRec.setProperty("booleanData", true);
                        newRec.setProperty("urlData", new Link("http://www.google.com"));
                        newRec.setProperty("emailData", new Email("somebody123@google.com"));
                        newRec.setProperty("phoneData", new PhoneNumber("408-123-4567"));
                        newRec.setProperty("adressData", new PostalAddress("123 st. CA 12345"));
                        newRec.setProperty("ratingData", new Rating(55));
                        newRec.setProperty("geoptData", new GeoPt((float) 12.12, (float) 98.98));
                        newRec.setProperty("categoryData", new Category("abc"));
                        eList.add(newRec);
                    }
                }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.datastore.Rating

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.