Package com.dotmarketing.db

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


    try {
      HibernateUtil dh = new HibernateUtil(ChallengeQuestion.class);
      dh.setQuery("from challenge_question in class com.dotmarketing.beans.ChallengeQuestion where cquestionid = ?");
      dh.setParam(challengeQuestionId);
      result = (ChallengeQuestion) dh.load();
    } catch (Exception e) {
      Logger.error(ChallengeQuestionFactory.class, e.toString());
    }

    return result;
View Full Code Here


    Rating r = null ;
    try {
      HibernateUtil dh = new HibernateUtil();
      dh.setClass(Rating.class);
      dh.setQuery("from content_rating in class com.dotmarketing.beans.Rating where user_id = '" + userId + "' and identifier = '" + identifier +"'" );
      r = (Rating) dh.load();
    } catch (DotHibernateException e) {
      Logger.error(RatingsFactory.class, "getRatingByUserId failed:"+e, e);
    }
    return r;
  }
View Full Code Here

    Rating r = null ;
    try {
      HibernateUtil dh = new HibernateUtil();
      dh.setClass(Rating.class);
      dh.setQuery("from content_rating in class com.dotmarketing.beans.Rating where session_id = '" + sessionId + "' and identifier = '" + identifier + "'");
      r = (Rating) dh.load();
    } catch (DotHibernateException e) {
      Logger.error(RatingsFactory.class, "getRatingBySessionId failed:" + e, e);
    }
    return r;
  }
View Full Code Here

    Rating r = null ;
    try {
      HibernateUtil dh = new HibernateUtil();
      dh.setClass(Rating.class);
      dh.setQuery("from content_rating in class com.dotmarketing.beans.Rating where long_live_cookie_id = '" + longCookieId + "' and identifier = '" + identifier + "'");
      r = (Rating) dh.load();
    } catch (DotHibernateException e) {
      Logger.error(RatingsFactory.class, "getRatingByLongCookieId failed:" + e, e);
    }
    return r;
  }
View Full Code Here

    HibernateUtil dh = new HibernateUtil(WebAsset.class);
    WebAsset webAsset = null ;
    try {
      dh.setQuery("from inode in class " + WebAsset.class.getName() + " where ? in inode.children.elements");
      dh.setParam(i.getInode());
      webAsset = (WebAsset) dh.load();
    } catch (DotHibernateException e) {
      Logger.error(WebAssetFactory.class,"getParentWebAsset failed:" + e,e);
    }
    return webAsset;
  }
View Full Code Here

    HibernateUtil dh = new HibernateUtil(Clickstream.class);
    Clickstream clickStream = new Clickstream();
    try {
      dh.setQuery("from clickstream in class " + Clickstream.class.getName() + " where clickstream_id = ?");
      dh.setParam(Integer.parseInt(clickstreamId));
      clickStream = (Clickstream) dh.load();
    } catch (NumberFormatException e) {
      Logger.error(ClickstreamFactory.class, e.getMessage(), e);
    } catch (DotHibernateException e) {
      Logger.error(ClickstreamFactory.class, "getClickstream failed:" + e, e);
    }
View Full Code Here

      Logger.debug(InodeFactory.class, "inode:  " + inode.getInode() + "\n");

      dh.setSQLQuery(sql);
      dh.setParam(inode.getInode());

      return dh.load();
    } catch (Exception e) {
      Logger.warn(InodeFactory.class, "getParentOfClassbyCondition failed:" + e, e);
      throw new DotRuntimeException(e.toString());
    }
View Full Code Here

    try {
      HibernateUtil dh = new HibernateUtil(Link.class);
      dh.setQuery("from inode in class com.dotmarketing.portlets.links.model.Link where ? in inode.parents.elements and title =  ? and live = " + com.dotmarketing.db.DbConnectionFactory.getDBTrue());
      dh.setParam(parent.getInode());
      dh.setParam(title);
      return (Link) dh.load();
    } catch (Exception e) {
      Logger.error(LinkFactory.class, "getLinkByLiveAndFolderAndTitle failed:" + e, e);
    }

    return new Link();
View Full Code Here

        HibernateUtil dh = new HibernateUtil(Link.class);
        Link link =null;
        try {
      dh.setQuery("from inode in class com.dotmarketing.portlets.links.model.Link where friendly_name = ? and type='links' and live=" + com.dotmarketing.db.DbConnectionFactory.getDBTrue());
      dh.setParam(friendlyName);
      link = (Link) dh.load();
    } catch (DotHibernateException e) {
      Logger.error(LinkFactory.class, "getLinkByFriendlyName failed:" + e, e);
    }
        return link;
    }
View Full Code Here

      try {
        HibernateUtil dh = new HibernateUtil(UserProxy.class);
        dh.setQuery("from user_proxy in class com.dotmarketing.beans.UserProxy where user_id = ?");
        dh.setParam(userId);
 
        up = (UserProxy) dh.load();
        upc.addToUserProxyCache(up);
      } catch (Exception e) {
        throw new DotRuntimeException(e.getMessage(),e);
      }
     
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.