Package com.jengine.orm.model.multi.field.aggregation

Examples of com.jengine.orm.model.multi.field.aggregation.Max


        check( Author.cls.<Long>max(Author.id) == 3l );
        check( Author.cls.<Long>sum(Author.id) == 6l );
        check( Author.cls.<Long>min(Author.id) == 1l );
        check( Book.cls.count() == 3l );
        check( Book.cls.select(new Calc("counter", Long.class, "id + 1", "id")).filter("id = ?", 1l).<Long>one() == 2l );
        Book.cls.select("id", new Max("id")).filter("id = ?", 1l).group("id").one();
        check( Book.cls.<Long>calc("sum", Long.class, "max(%s) + 2", Book.id) == 5l );
        Transaction.cls.select("id", new Max("book.id")).filter("book.id = ?", 1l).group("id").one();
    }
View Full Code Here


        check( cluster1.count("Book.id") == 3);
//        check( cluster1.<Long>calc("%s + 10", "Transaction.id") > 0);
//        check( new Cluster("Transaction >> Book").fields("Transaction.id", new Calc("calc_field", Long.class, "%s + 10", "Transaction.id")).select().list() != null );
        check( new Cluster("Transaction >> Book").fields("Transaction.id", new Calc("calc_field", Long.class, "%s + 10", "Transaction.id")).select().list()
                .equals(list(list(1l, 11l), list(2l, 12l), list(3l, 13l), list(null, null))) );
        check( new Cluster("Transaction >> Book").fields("Transaction.id""Book.id", "Book.title", new Max("Transaction.id")).select().group("Book.title").list()
                .equals(list(list(1l, 1l, "The Dark Tower", 1l), list(2l, 2l, "The Shining", 3l), list(null, 3l, "Vingt mille lieues sous les mers", null))) );
        check( new Cluster("Transaction >> Book").fields("Transaction.id""Book.id", "Book.title", new Max("Transaction.id")).groupCluster("Book.title").select().list()
                .equals(list(list(1l, 1l, "The Dark Tower", 1l), list(2l, 2l, "The Shining", 3l), list(null, 3l, "Vingt mille lieues sous les mers", null))) );
        check( new Cluster("Transaction << Book").select().filter("Book.id > 1").list().size() == 2);
    }
View Full Code Here

        check( Author.cls.<Long>max(Author.id) == 3l );
        check( Author.cls.<Long>sum(Author.id) == 6l );
        check( Author.cls.<Long>min(Author.id) == 1l );
        check( Book.cls.count() == 3l );
        check( Book.cls.select(new Calc("counter", Long.class, "id + 1", "id")).filter("id = ?", 1l).<Long>one() == 2l );
        Book.cls.select("id", new Max("id")).filter("id = ?", 1l).group("id").one();
        check( Book.cls.<Long>calc("sum", Long.class, "max(%s) + 2", Book.id) == 5l );
        Transaction.cls.select("id", new Max("book.id")).filter("book.id = ?", 1l).group("id").one();
    }
View Full Code Here

        check( cluster1.count("Book.id") == 3);
//        check( cluster1.<Long>calc("%s + 10", "Transaction.id") > 0);
//        check( new Cluster("Transaction >> Book").fields("Transaction.id", new Calc("calc_field", Long.class, "%s + 10", "Transaction.id")).select().list() != null );
        check( new Cluster("Transaction >> Book").fields("Transaction.id", new Calc("calc_field", Long.class, "%s + 10", "Transaction.id")).select().list()
                .equals(list(list(1l, 11l), list(2l, 12l), list(3l, 13l), list(null, null))) );
        check( new Cluster("Transaction >> Book").fields("Transaction.id""Book.id", "Book.title", new Max("Transaction.id")).select().group("Book.title").list()
                .equals(list(list(1l, 1l, "The Dark Tower", 1l), list(2l, 2l, "The Shining", 3l), list(null, 3l, "Vingt mille lieues sous les mers", null))) );
        check( new Cluster("Transaction >> Book").fields("Transaction.id""Book.id", "Book.title", new Max("Transaction.id")).groupCluster("Book.title").select().list()
                .equals(list(list(1l, 1l, "The Dark Tower", 1l), list(2l, 2l, "The Shining", 3l), list(null, 3l, "Vingt mille lieues sous les mers", null))) );
        check( new Cluster("Transaction << Book").select().filter("Book.id > 1").list().size() == 2);
    }
View Full Code Here

TOP

Related Classes of com.jengine.orm.model.multi.field.aggregation.Max

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.