Package org.molgenis.framework.db

Examples of org.molgenis.framework.db.DatabaseException


      logger.debug("counted " + result + " " + this.create().getClass().getSimpleName() + " objects");
      return result;
    }
    catch (Exception e)
    {
      throw new DatabaseException(e);
    }
  }
View Full Code Here


      return entities;
    }
    catch (Exception e)
    {
      e.printStackTrace();
      throw new DatabaseException(e);
    }
  }
View Full Code Here

              where_clause.append(")");

            }
            catch (MolgenisModelException e)
            {
              throw new DatabaseException(e);
            }
          }
          else if (rule.getOperator() == QueryRule.Operator.NESTED)
          {
            QueryRule[] nestedrules = rule.getNestedRules();
            if (nestedrules.length > 0)
            {
              if (where_clause.length() > 0)
              {
                if (previousRule != null && Operator.OR.equals(previousRule.getOperator()))
                {
                  where_clause.append(" OR ");
                }
                else
                {
                  where_clause.append(" AND ");
                }
              }
              where_clause.append("(");
              where_clause.append(createWhereSql(true, false, nestedrules));
              where_clause.append(")");
            }
          }
          // experimental: subqery
          else if (rule.getOperator() == QueryRule.Operator.IN_SUBQUERY)
          {
            if (where_clause.length() > 0)
            {
              if (previousRule != null && Operator.OR.equals(previousRule.getOperator()))
              {
                where_clause.append(" OR ");
              }
              else
              {
                where_clause.append(" AND ");
              }
            }
            where_clause.append(rule.getField() + " IN(" + rule.getValue() + ")");
          }
          else if (rule.getOperator() == QueryRule.Operator.IN)
          {
            // only add if nonempty condition???
            if (rule.getValue() == null
                || (rule.getValue() instanceof List<?> && ((List<?>) rule.getValue()).size() == 0)
                || (rule.getValue() instanceof Object[] && ((Object[]) rule.getValue()).length == 0)) throw new DatabaseException(
                "empty 'in' clause for rule " + rule);
            {
              if (where_clause.length() > 0)
              {
                if (previousRule != null && Operator.OR.equals(previousRule.getOperator()))
View Full Code Here

        em.getTransaction().begin();
      }
    }
    catch (Exception e)
    {
      throw new DatabaseException(e);
    }
  }
View Full Code Here

        em.getTransaction().commit();
      }
    }
    catch (Exception e)
    {
      throw new DatabaseException(e);
    }
  }
View Full Code Here

        em.getTransaction().rollback();
      }
    }
    catch (Exception e)
    {
      throw new DatabaseException(e);
    }
  }
View Full Code Here

      }
    }
    catch (Exception e)
    {
      throw new DatabaseException(e);
    }
  }
View Full Code Here

    {
      PrintWriter out = response.getWriter();
      response.getWriter().print("{exception: '" + e.getMessage() + "'}");
      out.close();
      e.printStackTrace();
      throw new DatabaseException(e);
    }
  }
View Full Code Here

      q.limit(100);
      result = q.find();
    }
    catch (Exception ex)
    {
      throw new DatabaseException(ex);
    }
    finally
    {
      IOUtils.closeQuietly(db);
      return result;
View Full Code Here

    }
    catch (Exception e)
    {
      e.printStackTrace();
      throw new DatabaseException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.molgenis.framework.db.DatabaseException

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.