Examples of DynamicPK


Examples of testsuite.clusterj.model.DynamicPK

     */
    protected void find(Class<? extends DynamicPK> cls) {
        String where = "find " + cls.getName();
        for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) {
            byte[] key = getPK(i);
            DynamicPK result = session.find(cls, key);
            verify(where, result, i, false);
        }
    }
View Full Code Here

Examples of testsuite.clusterj.model.DynamicPK

    protected void update(Class<? extends DynamicPK> cls) {
        // update the instances
        String where = "update before " + cls.getName();
        for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) {
            if (0 == i % 4) {
                DynamicPK instance = createInstance(cls, i);
                instance.setName(getValue(NUMBER_OF_INSTANCES - i));
                session.updatePersistent(instance);
                verify(where, instance, i, true);
            }
        }
        // verify the updated instances
        where = "update after " + cls.getName();
        for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) {
            if (0 == i % 4) {
                byte[] key = getPK(i);
                DynamicPK instance = session.find(cls, key);
                verify(where, instance, i, true);
            }
        }
    }
View Full Code Here

Examples of testsuite.clusterj.model.DynamicPK

     */
    protected void delete(Class<? extends DynamicPK> cls) {
        // delete the instances
        for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) {
            if (0 == i % 5) {
                DynamicPK instance = createInstance(cls, i);
                session.deletePersistent(instance);
            }
        }
        // verify they have been deleted
        for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) {
            if (0 == i % 5) {
                byte[] key = getPK(i);
                DynamicPK instance = session.find(cls, key);
                errorIfNotEqual("Failed to delete instance: " + i, null, instance);
            }
        }
    }
View Full Code Here

Examples of testsuite.clusterj.model.DynamicPK

     * the keys by creating a byte[] with the encoded number.
     */
    protected void createInstances(Class<? extends DynamicPK> cls) {
        instances.clear();
        for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) {
            DynamicPK instance = createInstance(cls, i);
            if (getDebug()) System.out.println(toString(instance));
            instances.add(instance);
        }
    }
View Full Code Here

Examples of testsuite.clusterj.model.DynamicPK

    /** Create an instance of DynamicPK.
     * @param index the index to use to generate data
     * @return the instance
     */
    protected DynamicPK createInstance(Class<?extends DynamicPK> cls, int index) {
        DynamicPK instance = session.newInstance(cls);
        instance.setId(getPK(index));
        instance.setNumber(index);
        instance.setName(getValue(index));
        return instance;
    }
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.