Package com.dotmarketing.common.db

Examples of com.dotmarketing.common.db.DotConnect.loadObjectResults()


            }

            dc.setSQL("select * from " + resultsTableName + " where endpoint_id = ?");
            dc.addParam(endpointId);

            return dc.loadObjectResults();

        } catch(Exception e) {
            throw new Exception("Error running the "+type.name()+" Integrity Check", e);
        }
    }
View Full Code Here


      DotConnect dc = new DotConnect();
      dc.setSQL(SELECTSQL);
     
      dc.addParam(bundleId);
     
      List<Map<String, Object>> res = dc.loadObjectResults();
      if(res.size() > 1)
        throw new DotPublisherException("Found duplicate bundle status");
      else {
        if(!res.isEmpty())
          return mapper.mapObject(res.get(0));
View Full Code Here

  public List<PublishAuditStatus> getAllPublishAuditStatus() throws DotPublisherException {
    try{
      DotConnect dc = new DotConnect();
      dc.setSQL(SELECTSQLALL);
     
      return mapper.mapRows(dc.loadObjectResults());
    }catch(Exception e){
      Logger.debug(PublisherUtil.class,e.getMessage(),e);
      throw new DotPublisherException("Unable to get list of elements with error:"+e.getMessage(), e);
    }finally{
      DbConnectionFactory.closeConnection();
View Full Code Here

      dc.setSQL(SELECTSQLALL);
     
      dc.setStartRow(offset);
      dc.setMaxRows(limit);
     
      return mapper.mapRows(dc.loadObjectResults());
    }catch(Exception e){
      Logger.debug(PublisherUtil.class,e.getMessage(),e);
      throw new DotPublisherException("Unable to get list of elements with error:"+e.getMessage(), e);
    }
  }
View Full Code Here

        DotConnect dc = new DotConnect();
        dc.setSQL("SELECT 1 FROM " + folderTable+ " where endpoint_id = ?");
        dc.addParam(endpointId);

        boolean isThereFolderData = !dc.loadObjectResults().isEmpty();

        dc.setSQL("SELECT 1 FROM " + structuresTable+ " where endpoint_id = ?");
        dc.addParam(endpointId);

        boolean isThereStructureData = !dc.loadObjectResults().isEmpty();
View Full Code Here

        boolean isThereFolderData = !dc.loadObjectResults().isEmpty();

        dc.setSQL("SELECT 1 FROM " + structuresTable+ " where endpoint_id = ?");
        dc.addParam(endpointId);

        boolean isThereStructureData = !dc.loadObjectResults().isEmpty();

        dc.setSQL("SELECT 1 FROM " + schemesTable+ " where endpoint_id = ?");
        dc.addParam(endpointId);

        boolean isThereSchemaData = !dc.loadObjectResults().isEmpty();
View Full Code Here

      DotConnect dc = new DotConnect();
      dc.setSQL(SELECTSQLMAXDATE);
     
      dc.addParam(Status.BUNDLING.getCode());
     
      List<Map<String, Object>> res = dc.loadObjectResults();
     
      if(!res.isEmpty())
        return (Date) res.get(0).get("max_date");
      return null;
     
View Full Code Here

        boolean isThereStructureData = !dc.loadObjectResults().isEmpty();

        dc.setSQL("SELECT 1 FROM " + schemesTable+ " where endpoint_id = ?");
        dc.addParam(endpointId);

        boolean isThereSchemaData = !dc.loadObjectResults().isEmpty();

        return isThereFolderData || isThereStructureData || isThereSchemaData;

    }
View Full Code Here

 
  public Integer countAllPublishAuditStatus() throws DotPublisherException {
    try{
      DotConnect dc = new DotConnect();
      dc.setSQL(SELECTSQLALLCOUNT);
      return Integer.parseInt(dc.loadObjectResults().get(0).get("count").toString());
    }catch(Exception e){
      Logger.debug(PublisherUtil.class,e.getMessage(),e);
      throw new DotPublisherException("Unable to get list of elements with error:"+e.getMessage(), e);
    }
  }
View Full Code Here

    private boolean doesTableExist(String tableName) throws DotDataException {
        DotConnect dc = new DotConnect();

        if(DbConnectionFactory.isOracle()) {
            dc.setSQL("SELECT COUNT(*) as exist FROM user_tables WHERE table_name='"+tableName.toUpperCase()+"'");
            BigDecimal existTable = (BigDecimal)dc.loadObjectResults().get(0).get("exist");
            return existTable.longValue() > 0;
        } else if(DbConnectionFactory.isPostgres() || DbConnectionFactory.isMySql()) {
            dc.setSQL("SELECT COUNT(table_name) as exist FROM information_schema.tables WHERE Table_Name = '"+tableName+"' ");
            long existTable = (Long)dc.loadObjectResults().get(0).get("exist");
            return existTable > 0;
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.