Package org.objectweb.speedo.pobjects.inheritance.horizontal

Examples of org.objectweb.speedo.pobjects.inheritance.horizontal.Worker


        for (int i = 0; i < NB_WORKER; i++) {
            Address a = new Address("w_street_" + i,
                    "w_city_" + i,
                    "w_state_" + i,
                    "w_zipcode_" + i);
            Worker w = new Worker("worker_fn_" + i, "worker_ln_" + i, a, d,
                    "jobName_" + i, "company_" + i, (float) (i * 2000.0));
            pm.makePersistent(w);
        }
        pm.currentTransaction().commit();
        pm.evictAll();
        pm.close();
       
        //find worker only
        pm = pmf.getPersistenceManager();
        pm.currentTransaction().begin();
        Query q = pm.newQuery(Worker.class);
        q.setOrdering("firstname ascending");
        Collection c = (Collection) q.execute();
        int cpt = 0;
        try {
            for (Iterator it = c.iterator(); it.hasNext();) {
                Worker w = (Worker) it.next();
                assertEquals("Bad worker first name",
                        "worker_fn_" + cpt, w.getFirstname());
                cpt ++;
            }
            assertEquals("Bad worker number", NB_WORKER, cpt);
        } finally {
            q.closeAll();
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.pobjects.inheritance.horizontal.Worker

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.