Package javax.jdo

Examples of javax.jdo.PersistenceManager.makePersistent()


        mgr.currentTransaction().begin();
        ManySide m1 = (ManySide) XORM.newInstance(mgr, ManySide.class);
        OneSide one = (OneSide) XORM.newInstance(mgr, OneSide.class);
        m1.setOne(one);
        one.getMany().add(m1)// shouldn't have to do both of these, but..
        mgr.makePersistent(m1);
        mgr.makePersistent(one);
        mgr.currentTransaction().commit();
    }

    public void testJDOImplHelper() {
View Full Code Here


        ManySide m1 = (ManySide) XORM.newInstance(mgr, ManySide.class);
        OneSide one = (OneSide) XORM.newInstance(mgr, OneSide.class);
        m1.setOne(one);
        one.getMany().add(m1)// shouldn't have to do both of these, but..
        mgr.makePersistent(m1);
        mgr.makePersistent(one);
        mgr.currentTransaction().commit();
    }

    public void testJDOImplHelper() {
        Object obj = JDOImplHelper.getInstance().newInstance(EmptyInterface.class, null);
View Full Code Here

    public void testObjectId() {
  PersistenceManager mgr = factory.getPersistenceManager();
  mgr.currentTransaction().begin();
  StringInterface pc = (StringInterface) XORM.newInstance(mgr, StringInterface.class);
  mgr.makePersistent(pc);
  testObjectIdImpl(mgr, pc);
  mgr.currentTransaction().commit();

  // Test again now that it's got a "real" primary key
  mgr.currentTransaction().begin();
View Full Code Here

      ProcessDefinition processDefinitionOfferVendor;
      try {
        processDefinitionOfferVendor = (ProcessDefinition) pm.getObjectById(processDefinitionOfferVendorID);
      } catch (JDOObjectNotFoundException e) {
        processDefinitionOfferVendor = recurringTrader.storeProcessDefinitionRecurringOffer(TradeSide.vendor, ProcessDefinitionAssignment.class.getResource("recurring/offer/vendor/"));
        pm.makePersistent(new ProcessDefinitionAssignment(RecurringOffer.class, TradeSide.vendor, processDefinitionOfferVendor));
      }
      // TODO: Need process definitions for customer side later

    } finally {
      pm.close();
View Full Code Here

  lib.setName("Nonfiction");
  Book b = (Book) XORM.newInstance(mgr, Book.class);
  b.setTitle("The Three Musketeers");
  b.setAuthor("Alexandre Dumas");
  b.setDescription("French men on adventures.");
  mgr.makePersistent(b);

  // Add it to the library
  lib.getBooks().add(b);
  b.setLibrary(lib);
View Full Code Here

    public void testPersistent() {
  PersistenceManager mgr = factory.getPersistenceManager();
  mgr.currentTransaction().begin();

  JDOEnhanced pc = (JDOEnhanced) XORM.newInstance(mgr, JDOEnhanced.class);
  mgr.makePersistent(pc);
  assertNotNull("Object ID should not be null",
       JDOHelper.getObjectId(pc));
  assertNotNull("PersistenceManager should not be null",
       JDOHelper.getPersistenceManager(pc));
View Full Code Here

    public void testPersistent() {
        PersistenceManager mgr = factory.getPersistenceManager();
        mgr.currentTransaction().begin();

        StringInterface pc = (StringInterface) XORM.newInstance(mgr, StringInterface.class);
        mgr.makePersistent(pc);
        assertNotNull("Object ID should not be null",
                      JDOHelper.getObjectId(pc));
        assertNotNull("PersistenceManager should not be null",
                      JDOHelper.getPersistenceManager(pc));
View Full Code Here

    PersistenceManager pm = pmf.getPersistenceManager();
    //store the graph defined above in the datastore
    pm.currentTransaction().begin();
    //make persistent the competition
    // all the references reachable from this object will be made persistent
        pm.makePersistent(competition);
        pm.currentTransaction().commit();
  }
 
  public void testGetTrackpoints() {
    logger.log(BasicLevel.DEBUG, "**************testGetTrackpoints***********");
 
View Full Code Here

    PersistenceManager pm = pmf.getPersistenceManager();
    //store the graph defined above in the datastore
    pm.currentTransaction().begin();
    //make persistent the competition
    // all the references reachable from this object will be made persistent
        pm.makePersistent(competition);
        pm.currentTransaction().commit();
       
        //get the id of competition
        Object idCompetition = pm.getObjectId(competition);
       
View Full Code Here

        e2.setMyA(new D("d2"));
        e2.setMyC(new D("d3"));
        e2.setMyD(new D("d4"));
        PersistenceManager pm = pmf.getPersistenceManager();
        pm.currentTransaction().begin();
        pm.makePersistent(e1);
        Object oide1 = pm.getObjectId(e1);
        pm.makePersistent(e2);
        Object oide2 = pm.getObjectId(e2);
        e1 = null;
        e2 = null;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.