Examples of externalName()


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>PostgresqlExpression</code> factory method.
     *
 
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

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

                result.append(',');

                lastStopPKeyPath.removeLastObject();
                String tableAliasForJoinTable=(String)e.aliasesByRelationshipPath().
                    objectForKey(lastStopPKeyPath.componentsJoinedByString("."));//"j"; //+random#
                result.append(endOfFirstHopEntity.externalName());
                result.append(' ');
                result.append(tableAliasForJoinTable);

                result.append(" WHERE ");
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()

    }
   
    @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);
      }
      String constraintName = null;
View Full Code Here

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

      EOModel destModel = relationship.destinationEntity().model();
      if (sourceModel != destModel && !sourceModel.connectionDictionary().equals(destModel.connectionDictionary())) {
        throw new IllegalArgumentException("prepareConstraintStatementForRelationship unable to create a constraint for " + relationship.name() + " because the source and destination entities reside in different databases");
      }
      else {
        setStatement("ALTER TABLE " + entity.externalName() + " ADD CONSTRAINT " + constraintName + " FOREIGN KEY (" + sourceKeyList + ") REFERENCES " + relationship.destinationEntity().externalName() + " (" + destinationKeyList + ") DEFERRABLE INITIALLY DEFERRED");
      }
    }

    /**
     * Overriden to handle correct placements of join conditions and to handle
View Full Code Here

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

            }
            oldIndexName = indexName;
            StringBuilder localBuf = new StringBuilder();
            StringBuilder columnBuf = new StringBuilder();
            boolean validIndex = false;
            localBuf.append("create index " + indexName + " on " + entity.externalName() + "(");
            for (Enumeration<String> attributes = NSArray.componentsSeparatedByString(attributeNames, ",").objectEnumerator(); attributes.hasMoreElements();) {
              String attributeName = attributes.nextElement();
              attributeName = attributeName.trim();
              EOAttribute attribute = entity.attributeNamed(attributeName);
              if (attribute == null) {
View Full Code Here

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

            oldIndexName = indexName;

            StringBuffer localBuf = new StringBuffer();
            StringBuffer columnBuf = new StringBuffer();
            boolean validIndex = false;
            localBuf.append("create index " + indexName + " on " + entity.externalName() + "(");
            for (Enumeration e = NSArray.componentsSeparatedByString(indexValues, ",").objectEnumerator(); e.hasMoreElements();) {
              String attributeName = (String) e.nextElement();
              attributeName = attributeName.trim();
              EOAttribute attribute = entity.attributeNamed(attributeName);
View Full Code Here

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

    return constraintName;
  }

  public String constraintStatementForRelationship(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);
    }
    return constraintName(tableName, relationship.name());
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
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.