Examples of EOEntity


Examples of com.webobjects.eoaccess.EOEntity

    }
  }

  protected boolean isInherited(EOAttribute attribute) {
    boolean inherited = false;
    EOEntity parentEntity = attribute.entity().parentEntity();
    while (!inherited && parentEntity != null) {
      inherited = (parentEntity.attributeNamed(attribute.name()) != null);
      parentEntity = parentEntity.parentEntity();
    }
    return inherited;
  }
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity

  protected void fixDuplicateSingleTableInheritanceDropStatements(EOSynchronizationFactory syncFactory, NSMutableDictionary flags, StringBuffer sqlBuffer) {
    if ("YES".equals(flags.valueForKey(EOSchemaGeneration.DropTablesKey))) {
      NSMutableArray dropEntities = new NSMutableArray(_entities);
      for (int entityNum = dropEntities.count() - 1; entityNum >= 0; entityNum--) {
        EOEntity entity = (EOEntity) dropEntities.objectAtIndex(entityNum);
        if (isSingleTableInheritance(entity)) {
          dropEntities.removeObjectAtIndex(entityNum);
        }
      }
      if (dropEntities.count() != _entities.count()) {
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity

      findModelProcessor("org.objectstyle.wolips.eomodeler.EOModelProcessor", false);
    }
    if (entityNames == null || entityNames.size() == 0) {
      Enumeration entitiesEnum = _model.entities().objectEnumerator();
      while (entitiesEnum.hasMoreElements()) {
        EOEntity entity = (EOEntity) entitiesEnum.nextElement();
        if (!isPrototype(entity)) {// &&
          // entityUsesSeparateTable(entity))
          // {
          _entities.addObject(entity);
        }
      }
    } else {
      Iterator entityNamesIter = entityNames.iterator();
      while (entityNamesIter.hasNext()) {
        String entityName = (String) entityNamesIter.next();
        EOEntity entity = _model.entityNamed(entityName);
        if (entity != null) {
          _entities.addObject(entity);
        }
      }
    }
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity

    EOModel prototypesModel = null;
    Enumeration modelsEnum = modelGroup.models().objectEnumerator();
    while (modelsEnum.hasMoreElements()) {
      EOModel model = (EOModel) modelsEnum.nextElement();
      EOEntity eoAdaptorPrototypesEntity = _modelGroup.entityNamed("EO" + model.adaptorName() + "Prototypes");
      if (eoAdaptorPrototypesEntity != null) {
        prototypesModel = eoAdaptorPrototypesEntity.model();
        // System.out.println("EOFSQLGenerator.EOFSQLGenerator:
        // removing " + eoAdaptorPrototypesEntity.name() + " from "
        // + prototypesModel.name());
        prototypesModel.removeEntity(eoAdaptorPrototypesEntity);
        removedPrototypeEntities.takeValueForKey(eoAdaptorPrototypesEntity, eoAdaptorPrototypesEntity.name());
      }
    }

    EOEntity eoPrototypesEntity = _modelGroup.entityNamed("EOPrototypes");
    if (eoPrototypesEntity != null) {
      prototypesModel = eoPrototypesEntity.model();
      prototypesModel.removeEntity(eoPrototypesEntity);
      // System.out.println("EOFSQLGenerator.EOFSQLGenerator: removing
      // " + eoPrototypesEntity.name() + " from " +
      // prototypesModel.name());
      removedPrototypeEntities.takeValueForKey(eoPrototypesEntity, eoPrototypesEntity.name());
    }

    EOEntity prototypesEntity = _modelGroup.entityNamed(prototypeEntityName);
    if (prototypesEntity == null) {
      prototypesEntity = (EOEntity) removedPrototypeEntities.valueForKey(prototypeEntityName);
    } else {
      prototypesModel = prototypesEntity.model();
      prototypesModel.removeEntity(prototypesEntity);
    }
    if (prototypesEntity != null && prototypesModel != null) {
      // System.out.println("EOFSQLGenerator.EOFSQLGenerator: setting
      // " + prototypesEntity.name() + " to EOPrototypes in " +
      // prototypesModel.name());
      prototypesEntity.setName(replacementPrototypeName);
      prototypesModel.addEntity(prototypesEntity);
    }

    Enumeration resetModelsEnum = _modelGroup.models().objectEnumerator();
    while (resetModelsEnum.hasMoreElements()) {
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity

  }

  protected void localizeEntities() {
    Enumeration entitiesEnum = new NSArray(_entities).objectEnumerator();
    while (entitiesEnum.hasMoreElements()) {
      EOEntity entity = (EOEntity) entitiesEnum.nextElement();
      createLocalizedAttributes(entity);
    }
  }
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity

  }

  protected void fixAllowsNullOnSingleTableInheritance() {
    Enumeration entitiesEnum = new NSArray(_entities).objectEnumerator();
    while (entitiesEnum.hasMoreElements()) {
      EOEntity entity = (EOEntity) entitiesEnum.nextElement();
      if (isSingleTableInheritance(entity)) {
        Enumeration attributeEnum = entity.attributes().objectEnumerator();
        while (attributeEnum.hasMoreElements()) {
          EOAttribute attribute = (EOAttribute) attributeEnum.nextElement();
          if (!isInherited(attribute)) {
            attribute.setAllowsNull(true);
          }
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity

  }

  protected void ensureSingleTableInheritanceParentEntitiesAreIncluded() {
    Enumeration entitiesEnum = new NSArray(_entities).objectEnumerator();
    while (entitiesEnum.hasMoreElements()) {
      EOEntity entity = (EOEntity) entitiesEnum.nextElement();
      ensureSingleTableInheritanceParentEntitiesAreIncluded(entity);
    }
  }
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity

  }

  protected void ensureSingleTableInheritanceChildEntitiesAreIncluded() {
    Enumeration entitiesEnum = _model.entities().objectEnumerator();
    while (entitiesEnum.hasMoreElements()) {
      EOEntity entity = (EOEntity) entitiesEnum.nextElement();
      if (isSingleTableInheritance(entity)) {
        EOEntity parentEntity = entity.parentEntity();
        if (_entities.containsObject(parentEntity) && !_entities.containsObject(entity)) {
          _entities.addObject(entity);
        }
      }
    }
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity

    }
  }

  protected void ensureSingleTableInheritanceParentEntitiesAreIncluded(EOEntity entity) {
    if (isSingleTableInheritance(entity)) {
      EOEntity parentEntity = entity.parentEntity();
      if (!_entities.containsObject(parentEntity)) {
        _entities.addObject(parentEntity);
        ensureSingleTableInheritanceParentEntitiesAreIncluded(entity);
      }
    }
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity

    boolean isPrototype = (entityName.startsWith("EO") && entityName.endsWith("Prototypes"));
    return isPrototype;
  }

  protected boolean isSingleTableInheritance(EOEntity entity) {
    EOEntity parentEntity = entity.parentEntity();
    return parentEntity != null && entity.externalName() != null && entity.externalName().equalsIgnoreCase(parentEntity.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.