Examples of externalName()


Examples of com.webobjects.eoaccess.EOEntity.externalName()

     *
     */
    protected boolean isSinglePrimaryKeyAttribute(EOAttribute attribute) {
      if (attribute == null) return false;
      EOEntity entity = (EOEntity)attribute.entity();
      if ( (entity == null) || entity.isAbstractEntity() || (entity.externalName() == null) ) return false;
      NSArray primaryKeyAttributes = entity.primaryKeyAttributes();
      if (primaryKeyAttributes.count() != 1) return false;
      return attribute.name().equals(((EOAttribute)primaryKeyAttributes.lastObject()).name());
    }
   
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.externalName()

      NSMutableDictionary columnNameDictionary = new NSMutableDictionary();
      NSMutableArray primaryKeyConstraintExpressions = new NSMutableArray();
     
      for (Enumeration enumerator = entityGroup.objectEnumerator(); enumerator.hasMoreElements(); ) {
        EOEntity entity = (EOEntity)enumerator.nextElement();
        String tableName = entity.externalName();
        NSArray primaryKeyAttributes = entity.primaryKeyAttributes();
        boolean singlePrimaryKey = primaryKeyAttributes.count() == 1;
        if( (tableName != null) && ( ! "".equals(tableName) ) && (primaryKeyAttributes.count() > 0) ) {
          NSArray expressions = super.primaryKeyConstraintStatementsForEntityGroup(entityGroup);
          if( (expressions != null) && (expressions.count() > 0) ) primaryKeyConstraintExpressions.addObjectsFromArray(expressions);
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.externalName()

        if( (tableName != null) && ( ! "".equals(tableName) ) && (primaryKeyAttributes.count() > 0) ) {
          NSArray expressions = super.primaryKeyConstraintStatementsForEntityGroup(entityGroup);
          if( (expressions != null) && (expressions.count() > 0) ) primaryKeyConstraintExpressions.addObjectsFromArray(expressions);
          for (Enumeration attributeEnumerator = primaryKeyAttributes.objectEnumerator(); attributeEnumerator.hasMoreElements(); ) {
            String columnName = ((EOAttribute)attributeEnumerator.nextElement()).columnName();
            columnNameDictionary.setObjectForKey(columnName, entity.externalName() + "." + columnName);
            EOSQLExpression expression = this._expressionForString("create " + ( singlePrimaryKey ? "unique" : "" ) + " index " + entity.externalName() + " " + columnName);
            if(expression != null) primaryKeyConstraintExpressions.addObject( expression );
          }
        }
      }
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.externalName()

          NSArray expressions = super.primaryKeyConstraintStatementsForEntityGroup(entityGroup);
          if( (expressions != null) && (expressions.count() > 0) ) primaryKeyConstraintExpressions.addObjectsFromArray(expressions);
          for (Enumeration attributeEnumerator = primaryKeyAttributes.objectEnumerator(); attributeEnumerator.hasMoreElements(); ) {
            String columnName = ((EOAttribute)attributeEnumerator.nextElement()).columnName();
            columnNameDictionary.setObjectForKey(columnName, entity.externalName() + "." + columnName);
            EOSQLExpression expression = this._expressionForString("create " + ( singlePrimaryKey ? "unique" : "" ) + " index " + entity.externalName() + " " + columnName);
            if(expression != null) primaryKeyConstraintExpressions.addObject( expression );
          }
        }
      }
     
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.externalName()

        }
      }
     
      for (Enumeration enumerator = entityGroup.objectEnumerator(); enumerator.hasMoreElements(); ) {
        EOEntity entity = (EOEntity)enumerator.nextElement();
        String tableName = entity.externalName();
        if( (tableName != null) && ( ! "".equals(tableName) ) ) {
          for (Enumeration relationshipEnumerator = entity.relationships().objectEnumerator(); relationshipEnumerator.hasMoreElements(); ) {
            EORelationship relationship = (EORelationship)relationshipEnumerator.nextElement();
            if( ! relationship.isFlattened() ) {
              NSArray destinationAttributes = relationship.destinationAttributes();
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.externalName()

     
      NSMutableArray expressions = new NSMutableArray();
      for (Enumeration enumerator = entityGroups.objectEnumerator(); enumerator.hasMoreElements(); ) {
        NSArray entities = (NSArray)enumerator.nextElement();
        EOEntity _last = (EOEntity)entities.lastObject(); //only need entity to get the table name for the group
        String nameInObjectStore = _nameInObjectStoreForEntityGroupWithChangeDictionary(entities, changes.changesForTableNamed(_last.externalName()));
        if ( (nameInObjectStore != null) && ( ! "".equals(nameInObjectStore) ) ) {
          expressions.addObject(this._expressionForString("delete from _SYS_RELATIONSHIP where source_table = '" + nameInObjectStore + "' or dest_table = '" + nameInObjectStore + "'"));
        }
      }
      return expressions.immutableClone();
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.externalName()

      NSMutableArray<EOSQLExpression> result = new NSMutableArray<EOSQLExpression>();

      for (int i = entityGroup.count() - 1; i >= 0; i--) {
        EOEntity eoentity = entityGroup.objectAtIndex(i);
        String externalName = eoentity.externalName();
        NSArray<EOAttribute> priKeyAttributes = eoentity.primaryKeyAttributes();

        if (priKeyAttributes.count() == 1 && externalName != null && externalName.length() > 0) {
          EOAttribute priKeyAttribute = priKeyAttributes.objectAtIndex(0);
         
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.externalName()

        }
      }

      StringBuilder sql = new StringBuilder();
      sql.append("CREATE TABLE ");
      sql.append(quoteTableName(eoentity.externalName()));
      sql.append(" (\n\t");
      sql.append(columns.toString());
      sql.append("\n)");

      eosqlexpression.setStatement(sql.toString());
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.externalName()

    @Override
    public NSArray<EOSQLExpression> primaryKeyConstraintStatementsForEntityGroup(NSArray<EOEntity> entityGroup) {
      if (entityGroup.count() != 0) {
        EOEntity entity = entityGroup.objectAtIndex(0);
        String tableName = entity.externalName();
        NSArray<String> keys = entity.primaryKeyAttributeNames();
        StringBuilder sql = new StringBuilder();

        if (tableName != null && keys.count() > 0) {
          sql.append("ALTER TABLE ");
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.externalName()

      if (CONFIG.ENABLE_IDENTIFIER_QUOTING) {
        rightTable = rightEntity.valueForSQLExpression(this);
        leftTable = leftEntity.valueForSQLExpression(this);
      } else {
        rightTable = rightEntity.externalName();
        leftTable = leftEntity.externalName();
      }

      // We need the numeric table by removing the leading 't' or 'T' from the table alias
      int leftTableID = Integer.parseInt(leftAlias.substring(1));
     
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.