Examples of QueryCantBeHandled


Examples of org.persvr.data.QueryCantBeHandled

    if (expression.getType() == Token.GETPROP && expression.getFirstChild().getType() == Token.GETPROP && expression.getFirstChild().getFirstChild().getType() == Token.THIS
          && "id".equals(expression.getLastChild().getString())) {
      name = expression.getFirstChild().getLastChild().getString();
      sql.append("field='" + makeStringSQLSafe(name) + "'");
      if (valueNode.getType() != Token.STRING || (conditionType != Token.EQ && conditionType != Token.SHEQ))
        throw new QueryCantBeHandled("The id must be a string");
      Identification id = Identification.idForString(valueNode.getString());
      if (!(id instanceof ObjectId)){
        throw new QueryCantBeHandled("The id must be an object id");
      }
      if(!(id.source instanceof DynaObjectDBSource)){
        throw new QueryCantBeHandled("The id must be an object id of the object db");
      }
      sql.append(" AND value_type=" + OBJECT_TYPE + " AND value=" + ((DynaObjectDBSource)id.source).convertId(id.subObjectId));
      return sql.toString();
     
    }
    if (expression.getType() == Token.GETPROP && expression.getFirstChild().getType() == Token.THIS
        && "id".equals(expression.getLastChild().getString())) {
      Identification id = Identification.idForString(valueNode.getString());
      if (!(id instanceof ObjectId)){
        throw new QueryCantBeHandled("The id must be an object id");
      }
      if(!(id.source instanceof DynaObjectDBSource)){
        throw new QueryCantBeHandled("The id must be an object id of the object db");
      }
      sql.append("id=" +  + ((DynaObjectDBSource)id.source).convertId(id.subObjectId));
      return sql.toString();
    }
    return super.comparison(expression, valueNode, conditionType);
View Full Code Here

Examples of org.persvr.data.QueryCantBeHandled

  public Collection<Object> query(Query query) throws Exception {
    String fullSql = "select " + columnsString + "," + idColumn;
    String countSql = "select count(" + idColumn + ")";
    String from;
    if (query.getSort() != null)
      throw new QueryCantBeHandled();

    if (query.getCondition() == null) {
      // this is the root object access, so we return the list of rows in the table
      from = " from " + table;
    }
View Full Code Here

Examples of org.persvr.data.QueryCantBeHandled

    this.id = id;
  }

  public Collection<Object> query(Query query) throws Exception {
    if (query.getCondition() != null || query.getSort() != null)
      throw new QueryCantBeHandled();
    List tables = new ArrayList();
    for (String sourceName : DataSourceManager.getDataSourceNames()) {
      tables.add(ObjectId.idForObject(this, sourceName));
    }
   
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.