Package testsuite.clusterj.model

Examples of testsuite.clusterj.model.LongIntStringPK


    /** Find all instances.
     */
    protected void find() {
        for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) {
            Object[] key = new Object[]{getPK1(i), getPK2(i), getPK3(i)};
            LongIntStringPK result = session.find(LongIntStringPK.class, key);
            verify(result, i, false);
        }
    }
View Full Code Here


     */
    protected void update() {
        // update the instances
        for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) {
            if (0 == i % 4) {
                LongIntStringPK instance = createInstance(i);
                instance.setStringvalue(getValue(NUMBER_OF_INSTANCES - i));
                session.updatePersistent(instance);
                verify(instance, i, true);
            }
        }
        // verify the updated instances
        for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) {
            if (0 == i % 4) {
                Object[] key = new Object[]{getPK1(i), getPK2(i), getPK3(i)};
                LongIntStringPK instance = session.find(LongIntStringPK.class, key);
                verify(instance, i, true);
            }
        }
    }
View Full Code Here

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

     * pk1 * PK_MODULUS^2 + pk2 * PK_MODULUS + pk3
     *
     */
    protected void createInstances() {
        for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) {
            LongIntStringPK instance = createInstance(i);
//            System.out.println(toString(instance));
            instances.add(instance);
        }
    }
View Full Code Here

    /** Create an instance of LongIntStringPK.
     * @param index the index to use to generate data
     * @return the instance
     */
    protected LongIntStringPK createInstance(int index) {
        LongIntStringPK instance = session.newInstance(LongIntStringPK.class);
        instance.setLongpk(getPK1(index));
        instance.setIntpk(getPK2(index));
        instance.setStringpk(getPK3(index));
        instance.setStringvalue(getValue(index));
        return instance;
    }
View Full Code Here

        try {
            session = sessionFactory.getSession();
            session.deletePersistentAll(LongIntStringPK.class);
            // key can contain nulls if not part of partition key
            Object[] key = new Object[] { 1000L, 1000, null};
            LongIntStringPK instance = session
                    .newInstance(LongIntStringPK.class);
            instance.setLongpk(1000L);
            instance.setIntpk(1000);
            instance.setStringpk("1 Thousand");
            session.setPartitionKey(LongIntStringPK.class, key);
            session.makePersistent(instance);
        } finally {
            session.close();
            session = null;
View Full Code Here

TOP

Related Classes of testsuite.clusterj.model.LongIntStringPK

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.