Package org.openmeetings.app.persistence.beans.calendar

Examples of org.openmeetings.app.persistence.beans.calendar.AppointmentReminderTyps


  final public void testAppointmentReminderTypDaoImpl() throws Exception {
   
    Long id = AppointmentReminderTypDaoImpl.getInstance().addAppointmentReminderTyps(1L, "Reminder", "comment");
    assertNotNull("Cann't add Reminder Typ", id);
   
    AppointmentReminderTyps reminderTyps =   AppointmentReminderTypDaoImpl.getInstance().getAppointmentReminderTypById(id)
    assertNotNull("Cann't get Reminder Typ", reminderTyps);
   
    id = AppointmentReminderTypDaoImpl.getInstance().deleteAppointmentReminderTyp(id);
    assertNotNull("Cann't delete Reminder Typ", id);
  }
View Full Code Here


      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("deleted", "true");
      query.setParameter("typId",typId);
     
      AppointmentReminderTyps appointmentReminderTyps = null;
      try {
        appointmentReminderTyps = (AppointmentReminderTyps) query.getSingleResult();
        } catch (NoResultException ex) {
        }
      tx.commit();
View Full Code Here

 
  public Long updateAppointmentReminderTyps(Long typId, String name) {
    try {
     
     
      AppointmentReminderTyps ac = this.getAppointmentReminderTypById(typId);
                 
      ac.setName(name);
      ac.setUpdatetime(new Date());
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
     
      if (ac.getTypId() == null) {
        session.persist(ac);
          } else {
            if (!session.contains(ac)) {
              session.merge(ac);
          }
View Full Code Here

  }
 
  public Long addAppointmentReminderTyps( Long user_id, String name, String comment) {
    try {
     
      AppointmentReminderTyps ac = new AppointmentReminderTyps();
     
      ac.setName(name);
      ac.setStarttime(new Date());
      ac.setDeleted("false");
      ac.setUser(UsersDaoImpl.getInstance().getUser(user_id));
      ac.setComment(comment);
     
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
     
      ac = session.merge(ac);
      Long category_id = ac.getTypId();

      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      return category_id;
View Full Code Here

  }
 
  public Long deleteAppointmentReminderTyp(Long typId) {
    try {
     
      AppointmentReminderTyps ac = this.getAppointmentReminderTypById(typId);
     
      log.debug("ac: "+ac);
     
      if (ac == null) {
        log.debug("Already deleted / Could not find: "+typId);
        return typId;
      }
      ac.setUpdatetime(new Date());
      ac.setDeleted("true");
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      if (ac.getTypId() == null) {
        session.persist(ac);
          } else {
            if (!session.contains(ac)) {
              session.merge(ac);
          }
View Full Code Here

    try {
     
     
      Appointment ap = this.getAppointmentById(appointmentId);
     
      AppointmentReminderTyps appointmentReminderTyps = AppointmentReminderTypDaoImpl.getInstance().getAppointmentReminderTypById(remind);
      AppointmentCategory appointmentCategory = AppointmentCategoryDaoImpl.getInstance().getAppointmentCategoryById(categoryId);
     
      Calendar cal = Calendar.getInstance();
      cal.setTimeZone(TimeZone.getTimeZone(iCalTimeZone));
      int offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
View Full Code Here

    log.debug("AppointmentDAOImpl.updateAppointment");
    try {

      Appointment ap = this.getAppointmentById(appointmentId);

      AppointmentReminderTyps appointmentReminderTyps = appointmentReminderTypDaoImpl
          .getAppointmentReminderTypById(remind);
      AppointmentCategory appointmentCategory = appointmentCategoryDaoImpl
          .getAppointmentCategoryById(categoryId);

      // change connected events of other participants
View Full Code Here

      TypedQuery<AppointmentReminderTyps> query = em.createQuery(hql, AppointmentReminderTyps.class);
      query.setParameter("deleted", "true");
      query.setParameter("typId", typId);

      AppointmentReminderTyps appointmentReminderTyps = null;
      try {
        appointmentReminderTyps = query.getSingleResult();
      } catch (NoResultException ex) {
      }
View Full Code Here

  }

  public Long updateAppointmentReminderTyps(Long typId, String name) {
    try {

      AppointmentReminderTyps ac = this
          .getAppointmentReminderTypById(typId);

      ac.setName(name);
      ac.setUpdatetime(new Date());

      if (ac.getTypId() == null) {
        em.persist(ac);
      } else {
        if (!em.contains(ac)) {
          em.merge(ac);
        }
View Full Code Here

  }

  public Long addAppointmentReminderTyps(Long user_id, String name) {
    try {

      AppointmentReminderTyps ac = new AppointmentReminderTyps();

      ac.setName(name);
      ac.setStarttime(new Date());
      ac.setDeleted("false");
      ac.setUser(usersDao.getUser(user_id));

      ac = em.merge(ac);
      Long category_id = ac.getTypId();

      return category_id;
    } catch (Exception ex2) {
      log.error("[addAppointmentReminderTyps]: ", ex2);
    }
View Full Code Here

TOP

Related Classes of org.openmeetings.app.persistence.beans.calendar.AppointmentReminderTyps

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.