Package com.dotmarketing.db

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


    public static VirtualLink getVirtualLinkByURL(String url) throws DotHibernateException {
        HibernateUtil dh = new HibernateUtil(VirtualLink.class);
        dh.setQuery("from inode in class com.dotmarketing.portlets.virtuallinks.model.VirtualLink where url = ?");
        dh.setParam(url);
        return (VirtualLink) dh.load();
    }

    @SuppressWarnings("unchecked")
  public static java.util.List<VirtualLink> getVirtualLinks() {
        HibernateUtil dh = new HibernateUtil(VirtualLink.class);
View Full Code Here


    r = rc.get(key);
    if(r == null){
      HibernateUtil hu = new HibernateUtil(Role.class);
      hu.setQuery("from com.dotmarketing.business.Role where role_key = ?");
      hu.setParam(key);
      r = (Role)hu.load();
      try {
        if(r != null && InodeUtils.isSet(r.getId())){
          List<Role> roles = new ArrayList<Role>();
          roles.add(r);
          populatChildrenForRoles(roles);
View Full Code Here

        HibernateUtil dh = new HibernateUtil(Container.class);
        Container container = null ;
        try {
      dh.setQuery("from inode in class com.dotmarketing.portlets.containers.model.Container where type='containers' and friendly_name = ? and live=" + com.dotmarketing.db.DbConnectionFactory.getDBTrue());
      dh.setParam(friendlyName);
      container = (Container) dh.load();
    } catch (DotHibernateException e) {
      Logger.error(ContainerFactory.class, e.getMessage(), e);
    }
        return container;
    }
View Full Code Here

  public ChainLinkCode findChainLinkCodeByClassName(String fullyQualifiedClassName) throws DotDataException {
    HibernateUtil hu = new HibernateUtil(ChainLinkCode.class);
    String query = "from code in " + ChainLinkCode.class + " where code.className = ?";
    hu.setQuery(query);
    hu.setParam(fullyQualifiedClassName);
    return (ChainLinkCode) hu.load();
  }

  @SuppressWarnings("unchecked")
  public List<ChainLinkCode> findAllChainLinkCodes() throws DotDataException {
    HibernateUtil hu = new HibernateUtil(ChainLinkCode.class);
View Full Code Here

  public Chain findChainByKey(String chainKey) throws DotDataException {
    HibernateUtil hu = new HibernateUtil(Chain.class);
    String query = "from chain in " + Chain.class + " where key_name = ?";
    hu.setQuery(query);
    hu.setParam(chainKey);
    return (Chain) hu.load();
  }

  public Chain loadChainByKey(String chainKey) throws DotDataException, DotCacheException {
    ChainCache cache = CacheLocator.getChainCache();
View Full Code Here

              HibernateUtil dh = new HibernateUtil(Language.class);
              dh.setQuery(
                  "from language in class com.dotmarketing.portlets.languagesmanager.model.Language where language_code = ? and country_code = ?");
              dh.setParam(languageCode);
              dh.setParam(countryCode);
              lang = (Language) dh.load();
              if(lang != null){
                CacheLocator.getLanguageCache().addLanguage(lang);
              }
          }
View Full Code Here

    }
        try {
            HibernateUtil dh = new HibernateUtil(Language.class);
            dh.setQuery("from language in class com.dotmarketing.portlets.languagesmanager.model.Language where id = ? ");
            dh.setParam(id);
            lang = (Language) dh.load();
            if(lang != null){
              CacheLocator.getLanguageCache().addLanguage(lang);
            }
            return lang;
        } catch (DotHibernateException e) {
View Full Code Here

              HibernateUtil dh = new HibernateUtil(UserPreference.class);
              dh.setQuery("from user_preferences in class com.dotmarketing.portlets.user.model.UserPreference where user_id = ? and preference = ?");
              dh.setParam(userId);
              dh.setParam(preference);
 
              UserPreference up = (UserPreference) dh.load();
              preferences.put(preference, up);
              return up;
 
          } catch (Exception e) {
              Logger.warn(UserPreferencesFactory.class, "getUserPreferenceValue failed:" + e, e);
View Full Code Here

    if(host ==null){
        HibernateUtil hu=new HibernateUtil(ContentletVersionInfo.class);
        hu.setQuery("from "+ContentletVersionInfo.class.getName()+" where identifier=?");
        hu.setParam(id);
        ContentletVersionInfo vinfo=(ContentletVersionInfo) hu.load();
        if(vinfo!=null && UtilMethods.isSet(vinfo.getIdentifier())) {
            String hostInode=vinfo.getWorkingInode();
          Contentlet cont= APILocator.getContentletAPI().find(hostInode, APILocator.getUserAPI().getSystemUser(), respectFrontendRoles);
          Structure st = StructureCache.getStructureByVelocityVarName("Host");
          if(cont.getStructureInode().equals(st.getInode())) {
View Full Code Here

    Action myAction = null;
    try {
      dh.setQuery(
        "from action in class com.dotmarketing.portlets.workflowmessages.model.Action where id = ?");
      dh.setParam(actionId);
      myAction = (Action) dh.load();
    } catch (DotHibernateException e) {
      Logger.error(ActionFactory.class,e.getMessage(),e);
    }
    return myAction;
  }
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.