Package com.jengine.orm.model.cluster

Examples of com.jengine.orm.model.cluster.Cluster.max()


        check( new Cluster("(Transaction << Book) >> Author_books, Author").restriction(0, "Transaction.book", "Book.id").fields("Transaction.id").select().list().equals(list(1l, 1l, 1l)) );
        Cluster cluster1 = new Cluster("Transaction << Book", list("Book.title"));
        check( cluster1.select().distinct("Book.title").order("Book.title").list().equals(list("The Dark Tower", "The Shining")) );
        check( cluster1.select().distinct("Book.title").order("Book.title", "DESC").page(0, 2).list().equals(list("The Shining", "The Dark Tower")));
        check( cluster1.select().distinct("Book.title").order("Book.title", "DESC").page(0, 1).list().equals(list("The Shining")));
        check( cluster1.<Long>max("Book.id") == 2l);
        check( cluster1.<Long>min("Transaction.id") == 1l);
        check( cluster1.<Double>avg("Transaction.id") == 2.0);
        check( cluster1.<Long>sum("Transaction.id") == 6);
        check( cluster1.count() == 3);
        check( cluster1.count("Book.id") == 3);
View Full Code Here


        check( new Cluster("(Transaction << Book) >> Author_books, Author").restriction(0, "Transaction.book", "Book.id").fields("Transaction.id").select().list().equals(list(1l, 1l, 1l)) );
        Cluster cluster1 = new Cluster("Transaction << Book", list("Book.title"));
        check( cluster1.select().distinct("Book.title").order("Book.title").list().equals(list("The Dark Tower", "The Shining")) );
        check( cluster1.select().distinct("Book.title").order("Book.title", "DESC").page(0, 2).list().equals(list("The Shining", "The Dark Tower")));
        check( cluster1.select().distinct("Book.title").order("Book.title", "DESC").page(0, 1).list().equals(list("The Shining")));
        check( cluster1.<Long>max("Book.id") == 2l);
        check( cluster1.<Long>min("Transaction.id") == 1l);
        check( cluster1.<Double>avg("Transaction.id") == 2.0);
        check( cluster1.<Long>sum("Transaction.id") == 6);
        check( cluster1.count() == 3);
        check( cluster1.count("Book.id") == 3);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.