Examples of saveObject()


Examples of org.evolizer.core.hibernate.session.api.IEvolizerSession.saveObject()

  private void save(Object... objects) {
    try {
      IEvolizerSession s = fSessionHandler.getCurrentSession(fDBUrl);
      s.startTransaction();
      for(Object o : objects) {
        s.saveObject(o);
      }
      s.endTransaction();
      s.close();
    } catch (EvolizerException e) {
      fail(e.getMessage());
View Full Code Here

Examples of org.evolizer.core.hibernate.session.api.IEvolizerSession.saveObject()

  private <T>T saveAndReloadUniqueFromDB(Object object, String reloadQuery, Class<T> resultType) {
    try {
      IEvolizerSession s = fSessionHandler.getCurrentSession(fDBUrl);
      s.startTransaction();
      s.saveObject(object);
      s.endTransaction();

      s.close();

      s = fSessionHandler.getCurrentSession(fDBUrl);
View Full Code Here

Examples of org.olat.core.commons.persistence.DB.saveObject()

    // direct DB calls have to be made here because the
    // user manager is not available in the core
    DB db = DBFactory.getInstance();
    currUser = (User) db.loadObject(currUser);
    currUser.getPreferences().setLanguage(localeKey);
    db.saveObject(currUser);
    DispatcherAction.redirectToDefaultDispatcher(ureq.getHttpResp());
  }

  @Override
  protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
View Full Code Here

Examples of org.olat.core.commons.persistence.DB.saveObject()

    return fo;
  }

  private Forum saveForum(Forum forum) {
    DB db = DBFactory.getInstance();
    db.saveObject(forum);
    return forum;
  }

  /**
   * @param forumKey
View Full Code Here

Examples of org.olat.core.commons.persistence.DB.saveObject()

      DB db = DBFactory.getInstance();
      OLATResourceManager rm = OLATResourceManager.getInstance();
      // create course and persist as OLATResourceImpl
      OLATResourceable resourceable = OresHelper.createOLATResourceableInstance("junitcourse",new Long(456));
      course1 =  rm.createOLATResourceInstance(resourceable);
      db.saveObject(course1);
     
     
      DBFactory.getInstance().closeSession();
    } catch (Exception e) {
      log.error("Exception in setUp(): " + e);
View Full Code Here

Examples of org.olat.core.commons.persistence.DB.saveObject()

  /**
   * @param newBookmark
   */
  public void createAndPersistBookmark(Bookmark newBookmark) {
    DB db = DBFactory.getInstance();
    db.saveObject(newBookmark);
    if (log.isDebug()){
      log.debug("Bookmark has been created: " + newBookmark.getTitle());
    }
    fireBookmarkEvent(newBookmark.getOwner());   
  }
View Full Code Here

Examples of org.olat.core.commons.persistence.DB.saveObject()

   */
  public void testUpdateNewUser() throws Exception {
    UserManager um1 = UserManager.getInstance();
    DB db = DBFactory.getInstance();
    UserImpl u5 = new UserImpl("newuser", "newuser", "new@user.com");
    db.saveObject(u5);
    u5.setProperty(UserConstants.EMAIL, "updated@email.com");
    um1.updateUser(u5);
    um1.loadUserByKey(u5.getKey());
    assertTrue(u5.getProperty(UserConstants.EMAIL, null).equals("updated@email.com"));
  }
View Full Code Here

Examples of org.olat.core.commons.persistence.DB.saveObject()

      DB db = DBFactory.getInstance();
      OLATResourceManager rm = OLATResourceManager.getInstance();
      // create course and persist as OLATResourceImpl
      OLATResourceable resourceable = OresHelper.createOLATResourceableInstance("junitcourse", new Long(456));
      course1 = rm.createOLATResourceInstance(resourceable);
      db.saveObject(course1);

      DBFactory.getInstance().closeSession();
    } catch (Exception e) {
      log.error("Exception in setUp(): " + e);
      e.printStackTrace();
View Full Code Here

Examples of org.olat.core.commons.persistence.DB.saveObject()

      OLATResourceable resourceable = new OLATResourceable() {
          public String getResourceableTypeName() {  return "Course";}
          public Long getResourceableId() {return new Long(456);}
      };
      OLATResource r =  rm.createOLATResourceInstance(resourceable);
      db.saveObject(r);
 
      // now make a repository entry for this course
      RepositoryEntry d = new RepositoryEntry();
      d.setOlatResource(r);
      d.setResourcename("Lernen mit OLAT");
View Full Code Here

Examples of org.olat.core.commons.persistence.DB.saveObject()

  //    d.getMetaDataElements().add(v1);
  //    v2 = new MetaDataElement("duration", "2h");
  //    d.getMetaDataElements().add(v2);
  //    v3 = new MetaDataElement("path", "/UNIZH/ID/MELS/");
  //    d.getMetaDataElements().add(v3);
      db.saveObject(d);
    } catch(Exception ex) {
      fail("No Exception allowed. ex=" + ex.getMessage());
    }

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