Examples of makePersistent()


Examples of javax.jdo.PersistenceManager.makePersistent()

     */
    public void setActivity(Date activity) {
      this.activity = activity;
      PersistenceManager pm = PMF.get().getPersistenceManager();
      try {
      pm.makePersistent(this);
      } catch (JDOObjectNotFoundException e) {
      } finally {
        pm.close();
      }
    }
View Full Code Here

Examples of javax.jdo.PersistenceManager.makePersistent()

        } catch (Exception x) {
          Logger.getLogger(AuthenticationToken.class.getName()).log(Level.SEVERE, "Token encryption error: "  + x.getMessage(), x);
          x.printStackTrace();
        }
          at = new AuthenticationToken(email, token, publicToken, new Date(), new Date());
          pm.makePersistent(at);
        }
      } finally {
        pm.close();
      }
      return at;
View Full Code Here

Examples of javax.jdo.PersistenceManager.makePersistent()

      user = pm.getObjectById(SpadgerUser.class, id);
    } catch (JDOObjectNotFoundException e) {
      user = new SpadgerUser();
      user.id = id;
      user.email = id;
      user = pm.makePersistent(user);
      user = pm.detachCopy(user);
    } finally {
      tx.commit();
      pm.close();
    }
View Full Code Here

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

Examples of javax.jdo.PersistenceManager.makePersistent()

    //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

Examples of javax.jdo.PersistenceManager.makePersistent()

             
             
              //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

Examples of javax.jdo.PersistenceManager.makePersistent()

                   
                    //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

Examples of javax.jdo.PersistenceManager.makePersistent()

 
  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

Examples of javax.jdo.PersistenceManager.makePersistent()

  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

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.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
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.