Package org.apache.art

Examples of org.apache.art.BigDecimalEntity


    }

    public void testABS() {
        ObjectContext context = createDataContext();

        BigDecimalEntity o1 = context
                .newObject(BigDecimalEntity.class);
        o1.setBigDecimalField(new BigDecimal("4.1"));

        BigDecimalEntity o2 = context
                .newObject(BigDecimalEntity.class);
        o2.setBigDecimalField(new BigDecimal("-5.1"));

        context.commitChanges();

        EJBQLQuery query = new EJBQLQuery(
                "SELECT d FROM BigDecimalEntity d WHERE ABS(d.bigDecimalField) > 4.5");
View Full Code Here


    }

    public void testSQRT() {
        ObjectContext context = createDataContext();

        BigDecimalEntity o1 = context
                .newObject(BigDecimalEntity.class);
        o1.setBigDecimalField(new BigDecimal("9"));

        BigDecimalEntity o2 = context
                .newObject(BigDecimalEntity.class);
        o2.setBigDecimalField(new BigDecimal("16"));

        context.commitChanges();

        EJBQLQuery query = new EJBQLQuery(
                "SELECT d FROM BigDecimalEntity d WHERE SQRT(d.bigDecimalField) > 3.1");
View Full Code Here

        context.commitChanges();
    }

    public void testBigDecimal() throws Exception {

        BigDecimalEntity test = context
                .newObject(BigDecimalEntity.class);

        BigDecimal i = new BigDecimal("1234567890.44");
        test.setBigDecimalField(i);
        context.commitChanges();

        SelectQuery q = new SelectQuery(BigDecimalEntity.class);
        BigDecimalEntity testRead = (BigDecimalEntity) context.performQuery(q).get(0);
        assertNotNull(testRead.getBigDecimalField());
        assertEquals(i, testRead.getBigDecimalField());

        test.setBigDecimalField(null);
        context.commitChanges();
    }
View Full Code Here

TOP

Related Classes of org.apache.art.BigDecimalEntity

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.