Examples of NSMutableDictionary


Examples of com.webobjects.foundation.NSMutableDictionary

    }

    // MS: Remove jdbc2Info prior to SQL generation
    NSDictionary connectionDictionary = _model.connectionDictionary();
    if (connectionDictionary != null) {
      NSMutableDictionary mutableConnectionDictionary = connectionDictionary.mutableClone();
      mutableConnectionDictionary.removeObjectForKey("jdbc2Info");
      _model.setConnectionDictionary(mutableConnectionDictionary);
    }

    // MS: Add the "inEntityModeler" flag so that plugins can adjust their
    // behavior
    // if they need to.
    if (runInEntityModeler) {
      NSMutableDictionary modelUserInfo = _model.userInfo().mutableClone();
      NSDictionary entityModelerDict = (NSDictionary) modelUserInfo.valueForKey("_EntityModeler");
      NSMutableDictionary mutableEntityModelerDict;
      if (entityModelerDict == null) {
        mutableEntityModelerDict = new NSMutableDictionary();
      } else {
        mutableEntityModelerDict = entityModelerDict.mutableClone();
      }
      mutableEntityModelerDict.takeValueForKey(Boolean.TRUE, "inEntityModeler");
      modelUserInfo.takeValueForKey(mutableEntityModelerDict, "_EntityModeler");
      _model.setUserInfo(modelUserInfo);
    }

    ensureSingleTableInheritanceParentEntitiesAreIncluded();
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

    // Don't replace prototypes if you're already just using "EOPrototypes"
    if (replacementPrototypeName.equals(prototypeEntityName)) {
      return;
    }

    NSMutableDictionary removedPrototypeEntities = new NSMutableDictionary();

    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) {
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

        if (isSingleTableInheritance(entity)) {
          dropEntities.removeObjectAtIndex(entityNum);
        }
      }
      if (dropEntities.count() != _entities.count()) {
        NSMutableDictionary dropFlags = new NSMutableDictionary();
        dropFlags.takeValueForKey("YES", EOSchemaGeneration.DropTablesKey);
        dropFlags.takeValueForKey("NO", EOSchemaGeneration.DropPrimaryKeySupportKey);
        dropFlags.takeValueForKey("NO", EOSchemaGeneration.CreateTablesKey);
        dropFlags.takeValueForKey("NO", EOSchemaGeneration.CreatePrimaryKeySupportKey);
        dropFlags.takeValueForKey("NO", EOSchemaGeneration.PrimaryKeyConstraintsKey);
        dropFlags.takeValueForKey("NO", EOSchemaGeneration.ForeignKeyConstraintsKey);
        dropFlags.takeValueForKey("NO", EOSchemaGeneration.CreateDatabaseKey);
        dropFlags.takeValueForKey("NO", EOSchemaGeneration.DropDatabaseKey);
        flags.takeValueForKey("NO", EOSchemaGeneration.DropTablesKey);
        String dropSql = syncFactory.schemaCreationScriptForEntities(dropEntities, dropFlags);
        sqlBuffer.append(dropSql);
        sqlBuffer.append("\n");
      }
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

    System.setProperty("com.webobjects.classpath", classPath);
  }

  public String generateSchemaCreationScript(Map flagsMap) {
    fixClassPath();
    NSMutableDictionary flags = new NSMutableDictionary();
    if (flagsMap != null) {
      Iterator entriesIter = flagsMap.entrySet().iterator();
      while (entriesIter.hasNext()) {
        Map.Entry flag = (Map.Entry) entriesIter.next();
        flags.takeValueForKey(flag.getValue(), (String) flag.getKey());
      }
    }

    callModelProcessorMethodIfExists("processModel", new Object[] { _model, _entities, flags });
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

public class EOFSQLUtils56 {

  public static Object toWOCollections(Object obj) {
    Object result;
    if (obj instanceof Map) {
      NSMutableDictionary nsDict = new NSMutableDictionary();
      Map map = (Map) obj;
      Iterator entriesIter = map.entrySet().iterator();
      while (entriesIter.hasNext()) {
        Map.Entry entry = (Map.Entry) entriesIter.next();
        Object key = entry.getKey();
        Object value = entry.getValue();
        if (key != null && value != null) {
          key = toWOCollections(key);
          value = toWOCollections(value);
          nsDict.setObjectForKey(value, key);
        }
      }
      result = nsDict;
    } else if (obj instanceof List) {
      NSMutableArray nsArray = new NSMutableArray();
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

    }

    // MS: Remove jdbc2Info prior to SQL generation
    NSDictionary connectionDictionary = _model.connectionDictionary();
    if (connectionDictionary != null) {
      NSMutableDictionary mutableConnectionDictionary = connectionDictionary.mutableClone();
      mutableConnectionDictionary.removeObjectForKey("jdbc2Info");
      _model.setConnectionDictionary(mutableConnectionDictionary);
    }

    // MS: Add the "inEntityModeler" flag so that plugins can adjust their
    // behavior
    // if they need to.
    if (runInEntityModeler) {
      NSMutableDictionary modelUserInfo = _model.userInfo().mutableClone();
      NSDictionary entityModelerDict = (NSDictionary) modelUserInfo.valueForKey("_EntityModeler");
      NSMutableDictionary mutableEntityModelerDict;
      if (entityModelerDict == null) {
        mutableEntityModelerDict = new NSMutableDictionary();
      } else {
        mutableEntityModelerDict = entityModelerDict.mutableClone();
      }
      mutableEntityModelerDict.takeValueForKey(Boolean.TRUE, "inEntityModeler");
      modelUserInfo.takeValueForKey(mutableEntityModelerDict, "_EntityModeler");
      _model.setUserInfo(modelUserInfo);
    }

    ensureSingleTableInheritanceParentEntitiesAreIncluded();
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

    // Don't replace prototypes if you're already just using "EOPrototypes"
    if (replacementPrototypeName.equals(prototypeEntityName)) {
      return;
    }

    NSMutableDictionary removedPrototypeEntities = new NSMutableDictionary();

    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) {
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

        if (isSingleTableInheritance(entity)) {
          dropEntities.removeObjectAtIndex(entityNum);
        }
      }
      if (dropEntities.count() != _entities.count()) {
        NSMutableDictionary dropFlags = new NSMutableDictionary();
        dropFlags.takeValueForKey("YES", EOSchemaGeneration.DropTablesKey);
        dropFlags.takeValueForKey("NO", EOSchemaGeneration.DropPrimaryKeySupportKey);
        dropFlags.takeValueForKey("NO", EOSchemaGeneration.CreateTablesKey);
        dropFlags.takeValueForKey("NO", EOSchemaGeneration.CreatePrimaryKeySupportKey);
        dropFlags.takeValueForKey("NO", EOSchemaGeneration.PrimaryKeyConstraintsKey);
        dropFlags.takeValueForKey("NO", EOSchemaGeneration.ForeignKeyConstraintsKey);
        dropFlags.takeValueForKey("NO", EOSchemaGeneration.CreateDatabaseKey);
        dropFlags.takeValueForKey("NO", EOSchemaGeneration.DropDatabaseKey);
        flags.takeValueForKey("NO", EOSchemaGeneration.DropTablesKey);
        String dropSql = syncFactory.schemaCreationScriptForEntities(dropEntities, dropFlags);
        sqlBuffer.append(dropSql);
        sqlBuffer.append("\n");
      }
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

    System.setProperty("com.webobjects.classpath", classPath);
  }

  public String generateSchemaCreationScript(Map flagsMap) {
    fixClassPath();
    NSMutableDictionary flags = new NSMutableDictionary();
    if (flagsMap != null) {
      Iterator entriesIter = flagsMap.entrySet().iterator();
      while (entriesIter.hasNext()) {
        Map.Entry flag = (Map.Entry) entriesIter.next();
        flags.takeValueForKey(flag.getValue(), (String) flag.getKey());
      }
    }

    callModelProcessorMethodIfExists("processModel", new Object[] { _model, _entities, flags });
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

public class EOFSQLUtils53 {

  public static Object toWOCollections(Object obj) {
    Object result;
    if (obj instanceof Map) {
      NSMutableDictionary nsDict = new NSMutableDictionary();
      Map map = (Map) obj;
      Iterator entriesIter = map.entrySet().iterator();
      while (entriesIter.hasNext()) {
        Map.Entry entry = (Map.Entry) entriesIter.next();
        Object key = entry.getKey();
        Object value = entry.getValue();
        if (key != null && value != null) {
          key = toWOCollections(key);
          value = toWOCollections(value);
          nsDict.setObjectForKey(value, key);
        }
      }
      result = nsDict;
    } else if (obj instanceof List) {
      NSMutableArray nsArray = new NSMutableArray();
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.