Examples of externalName()


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

        NSDictionary dictionary = entity.userInfo();
        if (dictionary.valueForKey("Restrict") != null && ((String) dictionary.valueForKey("Restrict")).equals("true"))
          dropType = " RESTRICT";
      }

      EOSQLExpression expression = _expressionForString("DROP TABLE " + quoteTableName(entity.externalName()) + dropType);

      return new NSArray<EOSQLExpression>(expression);
    }

    @Override
View Full Code Here

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

        if(enableIdentifierQuoting()) {
            rightTable = rightEntity.valueForSQLExpression(this);
            leftTable = leftEntity.valueForSQLExpression(this);
        } else {
            rightTable = rightEntity.externalName();
            leftTable = leftEntity.externalName();
        }
        JoinClause jc = new JoinClause();
       
        jc.setTable1(leftTable, leftAlias);
       
View Full Code Here

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

     */
    @Override
  public void prepareConstraintStatementForRelationship(EORelationship relationship, NSArray sourceColumns, NSArray destinationColumns) {
   
      EOEntity entity = relationship.entity();
    String tableName = entity.externalName();
   
    int lastDot = tableName.lastIndexOf('.');
   
    if (lastDot >= 0) {
      tableName = tableName.substring(lastDot + 1);
View Full Code Here

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

        EOEntity entity = attribute.entity();
        EOEntity parentEntity = entity.parentEntity();
        String externalName = entity.externalName();
        if (externalName != null) {
          // If you have a parent entity and that parent entity shares your table name, then you're single table inheritance
          boolean singleTableInheritance = (parentEntity != null && externalName.equals(parentEntity.externalName()));
          if (singleTableInheritance) {
            EOAttribute parentAttribute = parentEntity.attributeNamed(attribute.name());
            if (parentAttribute == null) {
              // If this attribute is new in the subclass, you have to allow nulls
              shouldAllowNull = true;
View Full Code Here

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

        NSMutableArray result = new NSMutableArray();
        NSMutableSet generatedStatements = new NSMutableSet();
        int i = 0;
        for (int groupCount = group.count(); i < groupCount; i++) {
            EOEntity currentEntity = (EOEntity) group.objectAtIndex(i);
            if (currentEntity.externalName() != null) {
                NSArray relationships = currentEntity.relationships();
                int relCount = relationships.count();
                for (int j = 0; j < relCount; j++) {
                    EORelationship currentRelationship = ((EORelationship) relationships.objectAtIndex(j));
                    if (_shouldGenerateForeignKeyConstraints(currentRelationship)) {
View Full Code Here

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

        return result;
    }

    protected boolean _shouldGenerateForeignKeyConstraints(EORelationship rel) {
        EOEntity destinationEntity = rel.destinationEntity();
        return !rel.isFlattened() && destinationEntity.externalName() != null && rel.entity().model() == destinationEntity.model();
    }

    /**
     * <code>DB2Expression</code> factory method.
     *
 
View Full Code Here

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

        for (int i = 0; i < count; i++) {
            EOEntity entity = (EOEntity) entityGroup.objectAtIndex(i);
            // timc 2006-11-06 create result here so we can check for
            // enableIdentifierQuoting while building the statement
            DB2Expression result = new DB2Expression(entity);
            String tableName = result.sqlStringForSchemaObjectName(entity.externalName());
            if(entityUsesSeparateTable(entity)) {
                result.setStatement("DROP TABLE " + tableName );
                results.addObject(result);
            }
        }
View Full Code Here

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

    }
   
    @Override
    protected long createRow(Connection con, long increment) throws SQLException {
      EOEntity entity = ERXEOAccessUtilities.rootEntityForEntityNamed(_entityName);
      String tableName = entity.externalName();
      String colName = entity.primaryKeyAttributes().lastObject().columnName();
      String sql = "select max(" + colName + ") from " + tableName;

      ResultSet resultSet;
      resultSet = con.createStatement().executeQuery(sql);
View Full Code Here

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

                continue;
            // timc 2006-11-06 create result here so we can check for
            // enableIdentifierQuoting while building the statement
            DB2Expression result = new DB2Expression(entity);
            String constraintName = result.sqlStringForSchemaObjectName(externalNameForEntityWithoutSchema(entity) + "_pk");
            String tableName = result.sqlStringForSchemaObjectName(entity.externalName());

            StringBuilder statement = new StringBuilder("ALTER TABLE ");
            statement.append(tableName);
            statement.append(" ADD CONSTRAINT ");
            statement.append(constraintName);
View Full Code Here

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

    public static boolean entityUsesSeparateTable(EOEntity entity) {
        if (entity.parentEntity() == null)
            return true;
        EOEntity parent = entity.parentEntity();
        while (parent != null) {
            if (!entity.externalName().equals(parent.externalName()))
                return true;
            entity = parent;
            parent = entity.parentEntity();
        }
        return false;
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.