Examples of MathSample


Examples of org.apache.jdo.tck.pc.query.MathSample

        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();

            // Sample 1 : angle=PI (180 degrees)
            MathSample ms1 = new MathSample();
            ms1.setId(1);
            ms1.setAngle(new BigDecimal(Math.PI));
            pm.makePersistent(ms1);

            // Sample 2 : angle=PI/2 (90 degrees)
            MathSample ms2 = new MathSample();
            ms2.setId(2);
            ms2.setAngle(new BigDecimal(Math.PI/2.0));
            pm.makePersistent(ms2);

            // Sample 3 : angle=0 (0 degrees)
            MathSample ms3 = new MathSample();
            ms3.setId(3);
            ms3.setAngle(new BigDecimal(0));
            pm.makePersistent(ms3);

            tx.commit();
            oidOfMath1 = pm.getObjectId(ms1);
            oidOfMath2 = pm.getObjectId(ms2);
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.