Package javax.jdo

Examples of javax.jdo.PersistenceManager.makePersistent()


      } catch (JDOObjectNotFoundException e) {
        LOGGER
            .debug("SpadgerConfig instance not found, creating one instead...");

        config = new SpadgerConfig();
        pm.makePersistent(config);
        pm.close();

        LOGGER.info("SpadgerConfig instance created and persisted");
      }
    } else {
View Full Code Here


    //pm = PMF.get().getPersistenceManager();
    pm =null;
    pm = PMF.get().getPersistenceManager();
        try {
          pm.currentTransaction().begin();
          pm.makePersistent(daoCommunityClan);
          pm.currentTransaction().commit();
        }
      catch(Exception e){
        e.printStackTrace();
        log.log(Level.SEVERE, "Exception while saving daoCommunityClan", e);
View Full Code Here

             
             
              //must transform before persist the objet
              pm.currentTransaction().begin();
             
              pm.makePersistent(myDaoRecruistation);
              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());
             
            }
          catch(Exception e){
View Full Code Here

                   
                    //pour eviter trop de donn�es en base 60 write OP
                    //daoCommunityAccount.getData().setAchievements(null);
                    daoCommunityAccount2.setDateCommunityAccount(date);
                    //
                    pm.makePersistent(daoCommunityAccount2);
                    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(String.valueOf(dataPlayerInfos.getAccount_id()));
                   
                  }
View Full Code Here

 
  private static Logger logger = Logger.getLogger(DatastoreHelper.class.getName());
 
  public static void persist(Object object) {
    PersistenceManager pm = PMF.get().getPersistenceManager();
    pm.makePersistent(object);
    pm.close();
  }
 
  public static Player verifyUsernameAndPassword(String nickname, String password) {
    nickname = removeSpaces(nickname);
View Full Code Here

  public static void validatePlayer(String nickname) {
    nickname = removeSpaces(nickname);
    PersistenceManager pm = PMF.get().getPersistenceManager();
    Player player = getPlayer(nickname);
    player.setActivated("true");
    pm.makePersistent(player);
    pm.close();
  }
 
  @SuppressWarnings("unchecked")
  public static String[] updateScore(String nickname, Long newScore) {
View Full Code Here

    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.getHighscore() < newScore) {
        player.setHighscore(newScore);
        pm.makePersistent(player);
        if (player.getFacebookUser().equals("true")) {
          try {
            logger.fine("posting score " + player.getHighscore() + " for " + player.getNickname());
            FacebookHelper.postScoreToWall(nickname, player.getHighscore() + "");
            logger.fine("publishing score " + player.getHighscore() + " for " + player.getNickname());
View Full Code Here

    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

    @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

      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

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.