Package ch.tatool.app.data

Examples of ch.tatool.app.data.ModuleSessionImpl


                  session.flush();
                 
                  // then delete the sessions
                  List<?> sessionIds = session.createQuery("select id from ModuleSessionImpl session where session.module.id = :id").setParameter("id", moduleInfo.getId()).list();
                  for (Object o : sessionIds) {
                    ModuleSessionImpl s = new ModuleSessionImpl();
                    session.load(s, (Long)o);
                    session.delete(s);
                  }
                 
                  // finally delete the module
View Full Code Here


  public ModuleSession createSession(Module module) {
    final ModuleImpl moduleImpl = (ModuleImpl) module;
    ModuleSession moduleSession = (ModuleSession) moduleImpl
        .getTransactionTemplate().execute(new TransactionCallback() {
          public Object doInTransaction(TransactionStatus status) {
            ModuleSession moduleSession = new ModuleSessionImpl();
            moduleSession.setStartTime(new Date());
            moduleSession.setCompleted(0);
            moduleImpl.getSessionDAO().saveSession(moduleImpl, moduleSession);
            return moduleSession;
          }
        });
    return moduleSession;
View Full Code Here

    }
  }

  /** Persist a trial. */
  public void saveTrial(Module module, ModuleSession session, Trial trial) {
    ModuleSessionImpl sessionImpl = (ModuleSessionImpl) session;
    if (trial.getId() == null) {
      sessionFactory.getCurrentSession().update(session);
      trial.setSession(session);
      sessionImpl.getTrials().add(trial);
      trial.setIndex(sessionImpl.getTrials().indexOf(trial));
      sessionFactory.getCurrentSession().save(trial);
    } else {
      sessionFactory.getCurrentSession().update(trial);
    }
  }
View Full Code Here

                  session.flush();
                 
                  // then delete the sessions
                  List sessionIds = session.createQuery("select id from ModuleSessionImpl session where session.module.id = :id").setParameter("id", moduleInfo.getId()).list();
                  for (Object o : sessionIds) {
                    ModuleSessionImpl s = new ModuleSessionImpl();
                    session.load(s, (Long)o);
                    session.delete(s);
                  }
                 
                  // finally delete the module
View Full Code Here

      }
    }
   
    /** Persist a trial. */
    public void saveTrial(Module module, ModuleSession session, Trial trial) {
      ModuleSessionImpl sessionImpl = (ModuleSessionImpl) session;
        if (trial.getId() == null) {
            getHibernateTemplate().update(session);
            trial.setSession(session);
            sessionImpl.getTrials().add(trial);
            trial.setIndex(sessionImpl.getTrials().indexOf(trial));
            getHibernateTemplate().save(trial);
            //getHibernateTemplate().update(session);
            //session.getTrials().add(trial);
            //getHibernateTemplate().save(trial);
        } else {
View Full Code Here

    public ModuleSession createSession(Module module) {
        final ModuleImpl moduleImpl = (ModuleImpl) module;
        ModuleSession moduleSession = (ModuleSession) moduleImpl.getTransactionTemplate().execute(
            new TransactionCallback() {
                public Object doInTransaction(TransactionStatus status) {
                  ModuleSession moduleSession = new ModuleSessionImpl();
                    moduleSession.setStartTime(new Date());
                    moduleImpl.getSessionDAO().saveSession(moduleImpl, moduleSession);
                    return moduleSession;
                }
            }
        );
View Full Code Here

  public ModuleSession createSession(Module module) {
    final ModuleImpl moduleImpl = (ModuleImpl) module;
    ModuleSession moduleSession = (ModuleSession) moduleImpl
        .getTransactionTemplate().execute(new TransactionCallback() {
          public Object doInTransaction(TransactionStatus status) {
            ModuleSession moduleSession = new ModuleSessionImpl();
            moduleSession.setStartTime(new Date());
            moduleSession.setCompleted(0);
            moduleImpl.getSessionDAO().saveSession(moduleImpl, moduleSession);
            return moduleSession;
          }
        });
    return moduleSession;
View Full Code Here

        .getCurrentSession()
        .createQuery(
            "select id from ModuleSessionImpl session where session.module.id = :id")
        .setParameter("id", moduleInfo.getId()).list();
    for (Object o : sessionIds) {
      ModuleSessionImpl s = new ModuleSessionImpl();
      sessionFactory.getCurrentSession().load(s, (Long) o);
      sessionFactory.getCurrentSession().delete(s);
    }

    // and finally the module itself
View Full Code Here

TOP

Related Classes of ch.tatool.app.data.ModuleSessionImpl

Copyright © 2018 www.massapicom. 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.