Package org.objectweb.speedo.pobjects.ref

Examples of org.objectweb.speedo.pobjects.ref.Department


        return prop;
    }

    public void testCreationOfPersistentObject() {
        PersistenceManager pm = pmf.getPersistenceManager();
        Department d = new Department(depName);
        pm.makePersistent(d);
        for(int i=0; i<depNames.length; i++) {
            pm.makePersistent(new Department(depNames[i]));
        }

        //Creation of Employee
        for(int i=0; i<names.length; i++) {
            pm.makePersistent(new Employee(names[i], d, salaries[i]));
View Full Code Here


  }
  public void test1() {
    String eName = "seb";
    String dName = "ASR";
    PersistenceManager pm = pmf.getPersistenceManager();
    Employee e = new Employee(eName, new Department(dName));
    pm.makePersistent(e);
    Object eId = pm.getObjectId(e);
    Assert.assertNotNull("null object identifier", eId);
    pm.close();
View Full Code Here

    public void testDeleteReferencedObject(boolean withEvict) {
        PersistenceManager pm = pmf.getPersistenceManager();

        pm.currentTransaction().begin();
        Employee e = new Employee("employee testDeleteReferencedObject",
                new Department("department testDeleteReferencedObject"));
        pm.makePersistent(e);
        long eid = e.getOid();
        Long did = e.getDept().getOid();
        e= null;
        pm.currentTransaction().commit();

        pm.currentTransaction().begin();
        Department d = (Department) pm.getObjectById(
                pm.newObjectIdInstance(Department.class, "" + did), true);
        pm.deletePersistent(d);
        d = null;
        pm.currentTransaction().commit();
       
View Full Code Here

            String filter = "(this.name == \"" + POBuilder.depName + "\")";
            query.setFilter(filter);
            Collection col = (Collection) query.execute();
            Iterator iter = col.iterator();
            Assert.assertTrue("", iter.hasNext());
            Department d = (Department) iter.next();
            query.closeAll();

      query = pm.newQuery(Employee.class);
      filter = "(this.dept == d)";
      String param = "Department d";
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.pobjects.ref.Department

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.