Package com.dotmarketing.db

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


       HibernateUtil dh = new HibernateUtil(ContentletVersionInfo.class);
         dh.setQuery("from "+ContentletVersionInfo.class.getName()+" where identifier=? and lang=?");
         dh.setParam(identifier);
         dh.setParam(lang);
         Logger.debug(this.getClass(), "getContentletVersionInfo query: "+dh.getQuery());
         contv = (ContentletVersionInfo)dh.load();
         return contv;
    }

    @Override
    protected void saveContentletVersionInfo(ContentletVersionInfo cvInfo, boolean updateVersionTS) throws DotDataException, DotStateException {
View Full Code Here


    HibernateUtil dh = new HibernateUtil(ContentletVersionInfo.class);
        dh.setQuery("from "+ContentletVersionInfo.class.getName()+" where identifier=? and lang=?");
        dh.setParam(id);
        dh.setParam(lang);
        Logger.debug(this.getClass(), "getContentletVersionInfo query: "+dh.getQuery());
        ContentletVersionInfo contv = (ContentletVersionInfo)dh.load();

        if(UtilMethods.isSet(contv.getIdentifier())) {
          HibernateUtil.delete(contv);
          icache.removeContentletVersionInfoToCache(id, lang);
        }
View Full Code Here

      persistanceService.setQuery("from inode in class com.dotmarketing.beans.Permission where inode_id = ? and roleid = ? " +
          "and permission_type = ?");
      persistanceService.setParam(inode);
      persistanceService.setParam(roleId);
      persistanceService.setParam(permissionType);
      return (Permission) persistanceService.load();
    } catch (DotHibernateException e) {
      throw new DataAccessException(e.getMessage(), e);
    }

  }
View Full Code Here

   */
  private boolean permissionExists(Permission p) {
    HibernateUtil persistanceService = new HibernateUtil(Permission.class);
    try {
      if (p.isBitPermission()) {
        Permission permission = (Permission) persistanceService.load(p.getId());
        if (permission != null) {
          return true;
        }
      } else {
        Permission permission = findPermissionByInodeAndRole(p.getInode(), p.getRoleId(), p.getType());
View Full Code Here

          persistenceService.setQuery("from inode in class com.dotmarketing.beans.Permission where inode_id = ? and roleid = ? and " +
              "permission_type = ?");
          persistenceService.setParam(p.getInode());
          persistenceService.setParam(p.getRoleId());
          persistenceService.setParam(p.getType());
          Permission bitPermission = (Permission) persistenceService.load();
          if (bitPermission != null) {
            bitPermission.setPermission((bitPermission.getPermission() ^ p.getPermission()) & bitPermission.getPermission());
            if (bitPermission.getPermission() == 0)
              HibernateUtil.delete(bitPermission);
            else
View Full Code Here

  @Override
  public Link load(String inode) throws DotHibernateException{
   
    HibernateUtil dh = new HibernateUtil(Link.class);

    return (Link) dh.load(inode);
   
   
  }
 
  public void save(Link menuLink) throws DotDataException, DotStateException, DotSecurityException {
View Full Code Here

        dh.setSQLQuery("select {folder.*} from folder, inode folder_1_, identifier identifier where asset_name = ? and parent_path = ? and "
            + "folder_1_.type = 'folder' and folder.inode = folder_1_.inode and folder.identifier = identifier.id and host_inode = ?");
        dh.setParam(assetName);
        dh.setParam(parentPath);
        dh.setParam(hostId);
        folder = (Folder) dh.load();
        if(UtilMethods.isSet(folder) && UtilMethods.isSet(folder.getInode())) {
          // if it is found add it to folder cache
          Identifier id = APILocator.getIdentifierAPI().find(folder.getIdentifier());
          fc.addFolder(folder, id);
        }
View Full Code Here

    dh.setQuery("from identifier in class com.dotmarketing.beans.Identifier where parent_path=? and asset_name = ? and host_inode = ?");
    dh.setParam(parentPath);
    dh.setParam(assetName);
    dh.setParam(hostId);
    identifier = (Identifier) dh.load();
   
    if(identifier==null || !InodeUtils.isSet(identifier.getId())) {
        identifier = build404(hostId,uri);
    }
View Full Code Here

    if (identifier == null) {
      throw new DotStateException("identifier is null");
    }

    HibernateUtil hu = new HibernateUtil(Identifier.class);
    return (Identifier) hu.load(identifier);

  }

  protected Identifier loadFromDb(Versionable versionable) throws DotDataException {
    if (versionable == null) {
View Full Code Here

    MailingList ml =null;
    try {
      dh.setQuery(
      "from inode in class com.dotmarketing.portlets.mailinglists.model.MailingList where type='mailing_list' and inode = ? ");
      dh.setParam(inode);
      ml = (MailingList)dh.load();
    } catch (DotHibernateException e) {
      Logger.error(MailingListFactory.class, "getMailingListsByInode failed:" + e, e);
    }
    return ml;
  }
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.