Package org.ofbiz.sql

Examples of org.ofbiz.sql.AggregateFunction


                    new FieldAll("c", set("partyId"))
                ),
                GenericTestCaseBase.<String, FieldDef>map(
                    "roleTypeId", new FieldDef(new FieldValue("d", "roleTypeId"), null),
                    "roleDescription", new FieldDef(new FieldValue("d", "description"), "roleDescription"),
                    "SUM"new FieldDef(new AggregateFunction("SUM", false, new FieldValue("a", "partyId")), null),
                    "baz"new FieldDef(new FunctionCall("FOO", GenericTestCaseBase.<Value>list(new FieldValue("a", "partyId"), new NumberValue<Integer>(Integer.valueOf(1)))), "baz"),
                    "one"new FieldDef(new MathValue("||", list(new FieldValue("a", "partyId"), new StringValue("-"), new FieldValue("a", "partyTypeId"))), "one"),
                    "cnt1", new FieldDef(new AggregateFunction("COUNT", false, new FieldValue("a", "partyId")), "cnt1"),
                    "cnt2", new FieldDef(new AggregateFunction("COUNT", false, new FieldValue(null, "partyId")), "cnt2"),
                    "cnt3", new FieldDef(new AggregateFunction("COUNT", true, new FieldValue("a", "partyId")), "cnt3")
                ),
                new Table(
                    new TableName("Party", "a"),
                    new Joined(true, new TableName("Person", "b"), list(new KeyMap("partyId", "partyId")),
                        new Joined(true, new TableName("PartyGroup", "c"), list(new KeyMap("partyId", "partyId")),
View Full Code Here


        assertEquals(label + ":field-value", fv, v.getValue());
        basicTest(label, AggregateFunction.class, v, name, s, o, matches);
    }

    public void testAggregateFunction() {
        AggregateFunction v1 = new AggregateFunction("COUNT", false, fv2);
        aggregateFunctionTest("v1", v1, "COUNT", false, fv2, "COUNT(a.partyId)", null, false);
        AggregateFunction v2 = new AggregateFunction("COUNT", true, fv2);
        aggregateFunctionTest("v2", v2, "COUNT", true, fv2, "COUNT(DISTINCT a.partyId)", v1, false);
        AggregateFunction v3 = new AggregateFunction("COUNT", true, fv1);
        aggregateFunctionTest("v3", v3, "COUNT", true, fv1, "COUNT(DISTINCT partyId)", v1, false);
        AggregateFunction v4 = new AggregateFunction("COUNT", false, fv1);
        aggregateFunctionTest("v4", v4, "COUNT", false, fv1, "COUNT(partyId)", v1, false);
        AggregateFunction v5 = new AggregateFunction("MAX", false, fv2);
        aggregateFunctionTest("v5", v5, "MAX", false, fv2, "MAX(a.partyId)", v1, false);
        AggregateFunction v6 = new AggregateFunction("COUNT", false, fv2);
        aggregateFunctionTest("v6", v6, "COUNT", false, fv2, "COUNT(a.partyId)", v1, true);
    }
View Full Code Here

TOP

Related Classes of org.ofbiz.sql.AggregateFunction

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.