Examples of makePersistent()


Examples of javax.jdo.PersistenceManager.makePersistent()

    Query query = pm.newQuery("SELECT FROM " + Player.class.getName());
    List<Player> players = (List<Player>)query.execute();
    for (Player player : players) {
      if (player.getNickname().equals(nickname)) {
        player.setAccessToken(accessToken);
        pm.makePersistent(player);
      }
    }
    pm.close();
    return;
  }
View Full Code Here

Examples of javax.jdo.PersistenceManager.makePersistent()

    @Test
    public void testPersistEvent() {
     
      PersistenceManager pm = PMF.get().getPersistenceManager();
    Event e1 = new Event("Test event", DateUtils.getDate(2011, 1, 1), DateUtils.getDate(2011, 1, 10), true, RegisteredPricingStrategy.COCAMP);
    pm.makePersistent(e1);
   
    Event retrieved = (Event) pm.getObjectById(Event.class, e1.getKey() );
    assertEquals(e1, retrieved);
   
    Extent<Event> extent = pm.getExtent(Event.class, false);
View Full Code Here

Examples of javax.jdo.PersistenceManager.makePersistent()

      pm.makePersistentAll(user1, user2, user3, user4, user5);
   
     
      // Application settings
      AppSetting defaultEventSetting = new AppSetting(AppSetting.DEFAULT_EVENT, event1.getWebKey());
      pm.makePersistent(defaultEventSetting);
     
      //tx.commit();
    } catch(Exception e) {
      //tx.rollback();
      throw new RuntimeException(e);
View Full Code Here

Examples of javax.jdo.PersistenceManager.makePersistent()

                 
                  //pour eviter trop de donn�es en base 60 write OP
                  //daoCommunityAccount.getData().setAchievements(null);
                  daoCommunityAccount.setDateCommunityAccount(date);
                  //
                  pm.makePersistent(daoCommunityAccount);
                  pm.currentTransaction().commit();
                  //log.warning("vehicules daoCommunityAccount " + daoCommunityAccount.getData().statsVehicules.get(0).getName() + ":"+  daoCommunityAccount.getData().statsVehicules.get(0).getBattle_count() + ":"+  daoCommunityAccount.getData().statsVehicules.get(0).getWin_count());
                  listUsersPersisted.add(communityAccount.getIdUser());
                 
                }
View Full Code Here

Examples of javax.jdo.PersistenceManager.makePersistent()

    sum.setScholarScore(con.getScholarScore());
    sum.setCraftsmanScore(con.getCraftsmanScore());
    PersistenceManagerFactory pmf = PMF.get();
    PersistenceManager pm = pmf.getPersistenceManager();
    try{
      pm.makePersistent(sum);
      //log.info("Result:" +sum.toString());
    }finally{
      pm.close();
    }
  }
View Full Code Here

Examples of javax.jdo.PersistenceManager.makePersistent()

            c.setScholar(c.getScholar() + 1);
          }else if(con.getScholarScore()<con.getCraftsmanScore()){
            c.setCraftsman(c.getCraftsman() + 1);
          }
        }
        pm.makePersistent(c);
       
        tx.commit();
        log.info("Count:" + c.toString());
        return c;
      }finally{
View Full Code Here

Examples of javax.jdo.PersistenceManager.makePersistent()

  public static void createCoreData()
  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    // Annoyingly datanucleus won't let us use the copy up above...
    pm.makePersistent(new User(SYSTEM_USER_EMAIL, "System User", "", Accesslevel.NO_LOGIN));
   
    pm.close();
  }
 
}
View Full Code Here

Examples of javax.jdo.PersistenceManager.makePersistent()

                 
                  //pour eviter trop de données en base 60 write OP
                  //daoCommunityAccount.getData().setAchievements(null);
                  daoCommunityAccount.setDateCommunityAccount(date);
                  //
                  pm.makePersistent(daoCommunityAccount);
                  pm.currentTransaction().commit();
                  //log.warning("vehicules daoCommunityAccount " + daoCommunityAccount.getData().statsVehicules.get(0).getName() + ":"+  daoCommunityAccount.getData().statsVehicules.get(0).getBattle_count() + ":"+  daoCommunityAccount.getData().statsVehicules.get(0).getWin_count());
                  listUsersPersisted.add(communityAccount.getIdUser());
                 
                }
View Full Code Here

Examples of javax.jdo.PersistenceManager.makePersistent()

    try{
      pm = pmf.getPersistenceManager();
      Transaction tx = pm.currentTransaction();
      try{
        tx.begin();
        pm.makePersistent(sum);
        tx.commit();
        log.info("[SummaryCronService#execute()] save summary: " + sum);
      }finally{
        if(tx!=null&&tx.isActive()) tx.rollback();
      }
View Full Code Here

Examples of javax.jdo.PersistenceManager.makePersistent()

            if ( result.size() != 0 )
            {
                for ( Profile profile : result )
                {
                    profile.setJdk( null );
                    pm.makePersistent( profile );
                }
            }

            // removing linked builder
            query = pm.newQuery( extent );
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.