Package org.objectweb.speedo.tutorial.pobjects.basics

Examples of org.objectweb.speedo.tutorial.pobjects.basics.Country


   * Make objects persistent
   */
  public static void makePersistent() {
    System.out.println("***************makePersistent*****************");
    //create a country and 3 addresses
    Country france = new Country("fr", "France");
    Address address1 = new Address("rue de Mons", "Avignon", france);
    Address address2 = new Address("impasse St Jacques", "Clermont", france);
    Address address3 = new Address("rue Laffiteau", "Paris", france);
   
    PersistenceManager pm = pmf.getPersistenceManager();
View Full Code Here


   * Create a persistent object
   * @return the id of the object created
   */
  public static Object createAddress(PersistenceManager pm){
    //create a country and an address
    Country uk = new Country("uk", "United Kingdom");
    Address address = new Address("Sharrow Street", "Sheffield", uk);
    //make persistent
    //all the references reachable from this object will be made persistent
    pm.currentTransaction().begin();
    System.out.println( "make persistent the address " + address.toString());
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.tutorial.pobjects.basics.Country

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.