Package com.webobjects.eoaccess

Examples of com.webobjects.eoaccess.EOSQLExpression.statement()


    if (limit > 0) {
      // MS: This is lame, but the dynamic attribute is not properly resolved
      // inside of EOSQLExpression because it's not actually part of the entity,
      // so you can't order-by one of these attributes.  So we just have to stick
      // it on the end and hope for the best.
      StringBuilder sqlBuffer = new StringBuilder(sqlExpression.statement());
      int orderByIndex = sqlHelper._orderByIndex(sqlExpression);
      sqlBuffer.insert(orderByIndex, " ORDER BY tagCount DESC");
      sqlExpression.setStatement(sqlBuffer.toString());
    }
View Full Code Here


    // MS: This is lame, but the dynamic attribute is not properly resolved
    // inside of EOSQLExpression because it's not actually part of the entity,
    // so you can't order-by one of these attributes.  So we just have to stick
    // it on the end and hope for the best.
    tagsSqlExpression.setStatement(tagsSqlExpression.statement() + " ORDER BY tagCount DESC");

    for (EOAttribute attribute : _entity.primaryKeyAttributes()) {
      sqlHelper.removeSelectFromExpression(attribute, tagsSqlExpression);
      tagsFetchAttributes.removeObject(attribute);
    }
View Full Code Here

      e.addBindVariableDictionary((NSDictionary) bindEnumeration.nextElement());
    }

    // sb.append(ERXStringUtilities.replaceStringByStringInString("t0.",
    // "t1.", subExpression.statement()));
    sb.append(subExpression.statement());
    sb.append(" ) ");
    return sb.toString();
  }

  /**
 
View Full Code Here

            for (Enumeration bindEnumeration = subExpression.bindVariableDictionaries().objectEnumerator(); bindEnumeration.hasMoreElements();) {
                expression.addBindVariableDictionary((NSDictionary)bindEnumeration.nextElement());
            }

            String subExprStr = subExpression.statement();

        Matcher matcher = PATTERN.matcher(subExprStr);
        if (matcher.find()) {
          subExprStr = matcher.replaceAll("$1" + EXISTS_ALIAS + "$3$4");
        }
View Full Code Here

    spec = ERXEOAccessUtilities.localizeFetchSpecification(ec, spec);
    if (attributes == null) {
      attributes = attributesToFetchForEntity(spec, entity);
    }
    EOSQLExpression sqlExpr = sqlFactory.selectStatementForAttributes(attributes, false, spec, entity);
    String sql = sqlExpr.statement();
    if (spec.hints() != null && !spec.hints().isEmpty() && spec.hints().valueForKey(EODatabaseContext.CustomQueryExpressionHintKey) != null) {
      Object hint = spec.hints().valueForKey(EODatabaseContext.CustomQueryExpressionHintKey);
      sql = customQueryExpressionHintAsString(hint);
    }
    if (end >= 0) {
View Full Code Here

        spec = new EOFetchSpecification(spec.entityName(), spec.qualifier(), null);
        spec.setUsesDistinct(usesDistinct);
      }

      EOSQLExpression sqlExpression = sqlExpressionForFetchSpecification(ec, spec, 0, -1);
      String statement = sqlExpression.statement();
      String listString = sqlExpression.listString();

      String countExpression;
      if (spec.usesDistinct()) {
        countExpression = sqlForCountDistinct(entity);
View Full Code Here

      NSArray primaryKeyExpressions = this.primaryKeyConstraintStatementsForEntityGroups(entityGroups);
      NSMutableArray createStatements = new NSMutableArray();
      NSMutableArray otherStatements = new NSMutableArray();
      for (Enumeration enumerator = primaryKeyExpressions.objectEnumerator(); enumerator.hasMoreElements(); ) {
        EOSQLExpression expression = (EOSQLExpression)enumerator.nextElement();
        String statement = expression.statement();
        if(statement.startsWith("create")) {
          createStatements.addObject(expression);
        } else if( ! statement.startsWith("delete from _SYS_RELATIONSHIP") ) {
          otherStatements.addObject(expression);
        }
View Full Code Here

        superResults = super.foreignKeyConstraintStatementsForRelationship(relationship);

        count = superResults.count();
        for (i = 0; i < count; i++) {
            expression = (EOSQLExpression) superResults.objectAtIndex(i);
            String s = expression.statement();
            s = replaceStringByStringInString(") INITIALLY DEFERRED", ") ENFORCED", s);
            expression.setStatement(s);
            results.addObject(expression);
            // timc 2006-11-06 check for enableIdentifierQuoting
            String tableName = expression.sqlStringForSchemaObjectName(expression.entity().externalName());
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.