Examples of BinaryPK


Examples of testsuite.clusterj.model.BinaryPK

    /** Find all instances.
     */
    protected void find() {
        for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) {
            byte[] key = getStoragePK(i);
            BinaryPK result = session.find(BinaryPK.class, key);
            verifyResult("find ", result, i, false);
        }
    }
View Full Code Here

Examples of testsuite.clusterj.model.BinaryPK

     */
    protected void update() {
        // update the instances
        for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) {
            if (0 == i % 4) {
                BinaryPK instance = createInstance(i);
                instance.setName(getValue(NUMBER_OF_INSTANCES - i));
                session.updatePersistent(instance);
                verifyStorage("update ", instance, i, true);
            }
        }
        // verify the updated instances
        for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) {
            if (0 == i % 4) {
                byte[] key = getStoragePK(i);
                BinaryPK instance = session.find(BinaryPK.class, key);
                verifyResult("update verify", instance, i, true);
            }
        }
    }
View Full Code Here

Examples of testsuite.clusterj.model.BinaryPK

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

Examples of testsuite.clusterj.model.BinaryPK

    /** The strategy for instances is for the "instance number" to create
     * the keys by creating a byte[] with the encoded number.
     */
    protected void createInstances() {
        for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) {
            BinaryPK instance = createInstance(i);
            if (getDebug()) System.out.println(toString(instance));
            instances.add(instance);
        }
    }
View Full Code Here

Examples of testsuite.clusterj.model.BinaryPK

    /** Create an instance of BinaryPK.
     * @param index the index to use to generate data
     * @return the instance
     */
    protected BinaryPK createInstance(int index) {
        BinaryPK instance = session.newInstance(BinaryPK.class);
        instance.setId(getStoragePK(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.