Package org.objectweb.speedo.tutorial.pobjects.mapping

Examples of org.objectweb.speedo.tutorial.pobjects.mapping.Project


    Employee employee2 = new Employee("Serio Laura", manager);
    Employee employee3 = new Employee("Burley Keith", manager);
    Employee employee4 = new Employee("Stern Jan", manager);
   
    //create projects
    Project project1 = new Project("Iris");
    Project project2 = new Project("Platine");
   
    //assign projects to employees
    employee1.addProject(project1);
    employee2.addProject(project1);
    employee3.addProject(project1);
   
    employee1.addProject(project2);
    employee4.addProject(project2);
   
    PersistenceManager pm = pmf.getPersistenceManager();
    //store the graph defined above in the datastore
    pm.currentTransaction().begin();
    //make persistent the 2 projects:
    // all the references reachable from these objects will be made persistent
    System.out.println( "make persistent the project1 " + project1.toString());
        pm.makePersistent(project1);
        System.out.println( "make persistent the project2 " + project2.toString());
        pm.makePersistent(project2);
        pm.currentTransaction().commit();
        pm.close();
   
  }
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.tutorial.pobjects.mapping.Project

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.