Package org.apache.openjpa.enhance

Examples of org.apache.openjpa.enhance.DynamicStorage


            JavaTypes.FLOAT,
            JavaTypes.DOUBLE,
            JavaTypes.STRING,
            JavaTypes.OBJECT
        };
        DynamicStorage storage = gen.generateStorage(types,
            "org.apache.openjpa.enhance.Test");
        storage = storage.newInstance();

        storage.setBoolean(0, true);
        storage.setByte(1, (byte) 1);
        storage.setChar(2, 'f');
        storage.setInt(3, 3);
        storage.setShort(4, (short) 4);
        storage.setLong(5, 5);
        storage.setFloat(6, (float) 6.6);
        storage.setDouble(7, 7.7);
        storage.setObject(8, "field8");
        Date date = new Date();
        storage.setObject(9, date);

        assertTrue(storage.getBoolean(0));
        assertEquals(1, storage.getByte(1));
        assertEquals('f', storage.getChar(2));
        assertEquals(3, storage.getInt(3));
        assertEquals(4, storage.getShort(4));
        assertEquals(5, storage.getLong(5));
        assertTrue(6.59 < storage.getFloat(6) && 6.61 > storage.getFloat(6));
        assertTrue(7.69 < storage.getDouble(7)
            && 7.71 > storage.getDouble(7));
        assertEquals("field8", storage.getObject(8));
        assertEquals(date, storage.getObject(9));
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.enhance.DynamicStorage

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.