Package com.dotmarketing.db

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


    Class clazz = UtilMethods.getVersionInfoType(type);
    HibernateUtil dh = new HibernateUtil(clazz);
    dh.setQuery("from "+clazz.getName()+" where identifier=?");
    dh.setParam(identifier);
    Logger.debug(BaseWebAssetAPI.class, "getVersionInfo query: "+dh.getQuery());
    auxVersionInfo=(VersionInfo)dh.load();

    if(UtilMethods.isSet(auxVersionInfo) && UtilMethods.isSet(auxVersionInfo.getIdentifier())) {
        clazz = InodeUtils.getClassByDBType(type);
        dh = new HibernateUtil(clazz);
      dh.setQuery("from inode in class " + clazz.getName() + " where inode.identifier = ? and inode.type='"+type+"' order by mod_date desc");
View Full Code Here


   
    if(template==null){
   
   
      HibernateUtil hu = new HibernateUtil(Template.class);
      template = (Template) hu.load(inode);
      if(template != null && template.getInode() != null)
        templateCache.add(inode, template);
    }
    return template;
  }
View Full Code Here

  public Template findWorkingTemplateByName(String name, Host host) throws DotDataException {
    HibernateUtil hu = new HibernateUtil(Template.class);
    hu.setSQLQuery(templateWithNameSQL);
    hu.setParam(host.getIdentifier());
    hu.setParam(name);
    return (Template) hu.load();

  }

  @Override
  public List<Template> findTemplates(User user, boolean includeArchived,
View Full Code Here

    * @param    reportId
    * @return    Report
    */
  public static Report getReport(String reportId)throws DotHibernateException{
    HibernateUtil hu = new HibernateUtil(Report.class);
    return (Report)hu.load(reportId);
  }
 
  /**
    * Delete a specific report
    * @param    reportId
 
View Full Code Here

      hu.setSQLQuery(workingFileByName);
      hu.setParam(id.getPath());
      hu.setParam(id.getHostId());
      hu.setParam(fileName);

      return (File) hu.load();


  }

  public File getLiveFileByFileName(String fileName, Folder folder) throws DotDataException{
View Full Code Here

      HibernateUtil hu = new HibernateUtil(File.class);
      hu.setSQLQuery(liveFileByName);
      hu.setParam(id.getPath());
      hu.setParam(fileName);

      return (File) hu.load();


  }

  @SuppressWarnings("unchecked")
View Full Code Here

    hu.setSQLQuery("select {folder.*} from folder,identifier,inode folder_1_ where folder.identifier = identifier.id and "
        + "folder_1_.inode = folder.inode and host_inode = ? and path =(select parent_path from identifier where id=?)");

    hu.setParam(hostId);
    hu.setParam(file.getIdentifier());
    return (Folder) hu.load();
  }

  public List<File> findFiles(User user, boolean includeArchived, Map<String, Object> params, String hostId, String inode,
      String identifier, String parent, int offset, int limit, String orderBy) throws DotSecurityException, DotDataException {

View Full Code Here

        Logger.debug(this, "contentlet inode:  " + contentlet.getInode() + "\n");

        dh.setParam(contentlet.getInode());
        dh.setParam(relationshipType);

        return (Identifier)dh.load();
  }

  @Override
  protected List<Link> getRelatedLinks(Contentlet contentlet) throws DotDataException {
      HibernateUtil dh = new HibernateUtil(Link.class);
View Full Code Here

        Tag tag =null;
        try {
      dh.setQuery("from tag in class com.dotmarketing.tag.model.Tag where lower(tagName) = ?");
      dh.setParam(name.toLowerCase());

      tag = (Tag) dh.load();
    } catch (DotHibernateException e) {
      Logger.error(TagFactory.class,"getTag failed:" + e, e);
    }
        // if doesn't exists then the tag is created
        if (tag.getTagName() == null) {
View Full Code Here

      dh.setQuery("from multi_tree in class com.dotmarketing.beans.MultiTree where parent1 = ? and parent2 = ? and child = ?");
      dh.setParam(parent1.getInode());
      dh.setParam(parent2.getInode());
      dh.setParam(child.getInode());

      return (MultiTree) dh.load();
    } catch (Exception e) {
            Logger.warn(MultiTreeFactory.class, "getMultiTree failed:" + e, e);
    }
    return new MultiTree();
  }
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.