Examples of externalName()


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

    return isPrototype;
  }

  protected boolean isSingleTableInheritance(EOEntity entity) {
    EOEntity parentEntity = entity.parentEntity();
    return parentEntity != null && entity.externalName() != null && entity.externalName().equalsIgnoreCase(parentEntity.externalName());
  }

  protected void createLocalizedAttributes(EOEntity entity) {
    NSArray attributes = entity.attributes().immutableClone();
    NSArray classProperties = entity.classProperties().immutableClone();
View Full Code Here

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

    return isPrototype;
  }

  protected boolean isSingleTableInheritance(EOEntity entity) {
    EOEntity parentEntity = entity.parentEntity();
    return parentEntity != null && entity.externalName() != null && entity.externalName().equalsIgnoreCase(parentEntity.externalName());
  }

  protected void createLocalizedAttributes(EOEntity entity) {
    NSArray attributes = entity.attributes().immutableClone();
    NSArray classProperties = entity.classProperties().immutableClone();
View Full Code Here

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

   * @param ename
   */
  private long maxIdFromTable(String ename) {
    EOEntity entity = EOModelGroup.defaultGroup().entityNamed(ename);
    if (entity == null) throw new NullPointerException("could not find an entity named " + ename);
    String tableName = entity.externalName();
    String colName = entity.primaryKeyAttributes().lastObject().columnName();
    String sql = "select max(" + colName + ") from " + tableName;

    ERXJDBCConnectionBroker broker = ERXJDBCConnectionBroker.connectionBrokerForEntityNamed(ename);
    Connection con = broker.getConnection();
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()

    @SuppressWarnings("unchecked")
    @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()

    if (sourceModel != destModel && !sourceModel.connectionDictionary().equals(destModel.connectionDictionary())) {
      throw new IllegalArgumentException(new StringBuilder().append("prepareConstraintStatementForRelationship unable to create a constraint for ").append(relationship.name()).append(" because the source and destination entities reside in different databases").toString());
    }
    setStatement(new StringBuilder()
        .append("ALTER TABLE ")
        .append(sqlStringForSchemaObjectName(entity.externalName()))
        .append(" ADD CONSTRAINT ")
        .append(quoteIdentifier(constraintName))
        .append(" FOREIGN KEY (")
        .append(sourceKeyList)
        .append(") REFERENCES ")
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 && parentEntity != null) {
          // If you have a parent entity and that parent entity shares your table name, then you're single table inheritance
          boolean singleTableInheritance = 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()

            NSArray entities = ERXUtilities.entitiesForModelGroup(modelGroup(ec));
            tableName = tableName.toLowerCase();

            for (Enumeration e = entities.objectEnumerator(); e.hasMoreElements();) {
              EOEntity entity = (EOEntity)e.nextElement();
              if (entity.externalName() != null)
              {
                  String lowercaseTableName = entity.externalName().toLowerCase();
                    if (tableName.equals(lowercaseTableName))
                  {
                      // Prefer the parent entity as long as it is using the same table
View Full Code Here

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

            for (Enumeration e = entities.objectEnumerator(); e.hasMoreElements();) {
              EOEntity entity = (EOEntity)e.nextElement();
              if (entity.externalName() != null)
              {
                  String lowercaseTableName = entity.externalName().toLowerCase();
                    if (tableName.equals(lowercaseTableName))
                  {
                      // Prefer the parent entity as long as it is using the same table
                        EOEntity root = entity;
                        while (root.parentEntity() != null &&
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.