Package co.nubetech.crux.util

Examples of co.nubetech.crux.util.CruxException


              isAggregate = true;
            } else {
              isRow = true;
            }
            if (isAggregate && isRow) {
              throw new CruxException(
                  "Aggregator functions should be applied to all Alias");
            }
          }
        }
      }
View Full Code Here


    for (Report report : reportList) {
      if (report.getDashboard() != null) {
        if (id != report.getId()) {
          if (count >= 3) {
            result = true;
            throw new CruxException(
                "Dashboard already have four reports.");
          } else {
            count++;
          }
        }
View Full Code Here

        } else if (valuetypeClassName.equals("java.lang.Double")) {
          Double.parseDouble(value);
        }
        result = true;
      } catch (Exception e) {
        throw new CruxException("Parse exception for fiterType value "
            + e.getMessage());
      }
    }
    return result;
  }
View Full Code Here

        } else if (valuetypeClassName.equals("java.lang.Double")) {
          Double.parseDouble(value);
        }
        result = true;
      } catch (Exception e) {
        throw new CruxException("Parse exception for fiterType value "
            + e.getMessage());
      }
    }
    return result;
  }
View Full Code Here

  public long delete(Report report) throws CruxException {
    long id = 0;
    try {
      id = report.getId();
    } catch (NullPointerException e) {
      throw new CruxException(
          "Selected Report does not exists in the database.", e);
    }
    try {
      transaction.begin();
      session.delete(report);
      transaction.commit();
    } catch (JDBCException e) {
      transaction.rollback();
      throw new CruxException(e.getSQLException().getMessage(), e);
    }
    return id;
  }
View Full Code Here

  public Report findById(long id) throws CruxException {

    Report report = (Report) session.get(Report.class, id);
    if (report == null) {
      throw new CruxException(
          "Selected Report does not exists in the database.",
          new Throwable());
    }
    return report;
  }
View Full Code Here

      ArrayList<ColumnFilter> oldColumnFilter = null;
      if (id != 0) {
        try {
          foundReport = this.findById(id);
        } catch (CruxException e) {
          throw new CruxException(
              "Report you are trying to edit does not exists in database",
              e);
        }
        oldDesignList = new ArrayList<ReportDesign>(
            foundReport.getDesigns());
        oldRowFilter = new ArrayList<RowAliasFilter>(
            foundReport.getRowAliasFilters());
        oldColumnFilter = new ArrayList<ColumnFilter>(
            foundReport.getColumnFilters());

        foundReport.getDesigns().clear();
        foundReport.getRowAliasFilters().clear();
        foundReport.getColumnFilters().clear();

        for (ReportDesign design : oldDesignList) {
          try {
            transaction.begin();
            session.delete(design);
            transaction.commit();
          } catch (JDBCException e) {
            transaction.rollback();
            throw new CruxException(e.getSQLException()
                .getMessage(), e);
          }
        }

        for (RowAliasFilter rowFilter : oldRowFilter) {
          try {
            transaction.begin();
            session.delete(rowFilter);
            transaction.commit();
          } catch (JDBCException e) {
            transaction.rollback();
            throw new CruxException(e.getSQLException()
                .getMessage(), e);
          }
        }

        for (ColumnFilter columnFilter : oldColumnFilter) {
          try {
            transaction.begin();
            session.delete(columnFilter);
            transaction.commit();
          } catch (JDBCException e) {
            transaction.rollback();
            throw new CruxException(e.getSQLException()
                .getMessage(), e);
          }
        }

        ArrayList<ReportDesign> newDesignList = new ArrayList<ReportDesign>(
View Full Code Here

      transaction.begin();
      session.saveOrUpdate(report);
      transaction.commit();
    } catch (JDBCException e) {
      transaction.rollback();
      throw new CruxException(e.getSQLException().getMessage(), e);
    }
    return report.getId();
  }
View Full Code Here

        //now lets get final aggregated values and populate
        returnList.add(FunctionUtil.getSemiAggregatedFunctionValueList(report, functions));
      }
      else {
        //handle group bys
        throw new CruxException("Unsupported stuff so far..to come soon :")
      }     
    }
    catch(Exception e) {
      e.printStackTrace();
      throw new CruxException("Error processing aggregates " + e);
    }
    finally {
          if (scanner != null) {
            try {
              scanner.close();
            }
            catch(IOException io) {
              throw new CruxException("Error closing scanner", io);
            }
          }
    }
    logger.info("Value from this region is "
            + ((RegionCoprocessorEnvironment) getEnvironment()).getRegion()
View Full Code Here

    Mapping mapping;
    try {
      mapping = (Mapping) session.get(Mapping.class, id);
      mapping.getId();
    } catch (NullPointerException e) {
      throw new CruxException(
          "Selected mapping does not exists in the database.", e);
    }
    return mapping;
  }
View Full Code Here

TOP

Related Classes of co.nubetech.crux.util.CruxException

Copyright © 2018 www.massapicom. 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.