Package com.dotmarketing.db

Examples of com.dotmarketing.db.HibernateUtil.load()


        try {
      dh.setQuery(
          "from inode in class com.dotmarketing.portlets.campaigns.model.Campaign where type='campaign' and inode = ? and user_id = ? order by "+orderby);
      dh.setParam(inode);
      dh.setParam(userId);
      campaign = (Campaign) dh.load();
    } catch (DotHibernateException e) {
      Logger.error(CampaignFactory.class, "getCampaign failed:" + e, e);
    }
        return campaign;
    }
View Full Code Here


        Campaign campaign = new Campaign();
        try {
      dh.setQuery(
          "from inode in class com.dotmarketing.portlets.campaigns.model.Campaign where type='campaign' and inode = ?");
      dh.setParam(inode);
      campaign = (Campaign) dh.load();
    } catch (DotHibernateException e) {
      Logger.error(CampaignFactory.class, "getCampaign failed:" + e ,e);
    }
        return campaign;
    }
View Full Code Here

    try {
      dh.setQuery(
          "from inode in class com.dotmarketing.portlets.communications.model.Communication where inode = ? and modified_by = ? order by "+orderby);
      dh.setParam(inode);
      dh.setParam(userId);
      commun = (Communication) dh.load();
    } catch (DotHibernateException e) {
      Logger.error(CommunicationsFactory.class, e.getMessage(), e);
    }
    return commun;
  }
View Full Code Here

    Communication communication = null;
    try {
      dh.setQuery(
      "from inode in class com.dotmarketing.portlets.communications.model.Communication where inode = ?");
      dh.setParam(inode);
      communication = (Communication) dh.load();
    } catch (DotHibernateException e) {
      Logger.error(CommunicationsFactory.class, e.getMessage(), e);
    }
    return communication;
  }
View Full Code Here

      dh.setQuery(query);
      dh.setParam(userId);
      dh.setParam(eventId);
      dh.setParam(eventId);
      dh.setParam(sendDate);
      returnValue = (CalendarReminder) dh.load();     
    } catch (Exception e) {
      Logger.warn(CalendarReminderFactoryImpl.class, "getCalendarReminder failed:" + e.getMessage(), e);
    }
    return returnValue;
  }
View Full Code Here

    r = rc.get(roleId);
    if(r == null){
      HibernateUtil hu = new HibernateUtil(Role.class);
      hu.setQuery("from com.dotmarketing.business.Role where id = ?");
      hu.setParam(roleId);
      r = (Role)hu.load();
      if(r == null)
        return null;
      rc.add(r);
      try {
        if(r != null && InodeUtils.isSet(r.getId())){
View Full Code Here

    Role r = null;
    if(InodeUtils.isSet(role.getId())) {
      hu.setQuery("from com.dotmarketing.business.Role where id = ?");
      hu.setParam(role.getId());
      r = (Role)hu.load();
      rc.remove(r.getId());
      if(UtilMethods.isSet(r.getParent())) {
        rc.remove(r.getParent());
      }
      try {
View Full Code Here

    while(roleIdsToProcess.size()>0) {
      String parentId = roleIdsToProcess.poll();
      hu = new HibernateUtil(Role.class);
      hu.setQuery("from com.dotmarketing.business.Role where id = ?");
      hu.setParam(parentId);
      Role parentRole = (Role)hu.load();
      rolesToUpdate.add(parentRole);
      List<Role> toPopulate = new ArrayList<Role>();
      toPopulate.add(parentRole);
      try {
        populatChildrenForRoles(toPopulate);
View Full Code Here

    dc.addParam(role.getId());
    dc.loadResult();
    HibernateUtil hu = new HibernateUtil(Role.class);
    hu.setQuery("from com.dotmarketing.business.Role where id = ?");
    hu.setParam(role.getId());
    Role r = (Role)hu.load();

    HibernateUtil.delete(r);
    if(r.getParent().equals(r.getId())){
      rc.clearRootRoleCache();
    }
View Full Code Here

      }

      HibernateUtil hu = new HibernateUtil(Role.class);
      hu.setQuery("from " + Role.class.getName() + " where db_fqn like ?");
      hu.setParam(rFQN);
      r = (Role)hu.load();
      translateFQNFromDB(r);
      rc.add(r);
      HibernateUtil.evict(r);
    }
    return r;
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.