Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSDictionary.objectForKey()


     */
    public static NSMutableArray updatedObjects(EOEditingContext editingContext, NSArray<String> entityNames, EOQualifier qualifier) {
      NSMutableArray result = new NSMutableArray();
      NSDictionary updatedObjects = ERXArrayUtilities.arrayGroupedByKeyPath(editingContext.updatedObjects(), "entityName");
      for (String entityName : entityNames) {
        NSArray updatedObjectsForEntity = (NSArray) updatedObjects.objectForKey(entityName);
        if (updatedObjectsForEntity != null && updatedObjectsForEntity.count() > 0) {
          NSArray inMemory = EOQualifier.filteredArrayWithQualifier(updatedObjectsForEntity, qualifier);
          if (inMemory.count() > 0) {
            result.addObjectsFromArray(inMemory);
          }
View Full Code Here


     */
    public static NSMutableArray deletedObjects(EOEditingContext editingContext, NSArray<String> entityNames, EOQualifier qualifier) {
      NSMutableArray result = new NSMutableArray();
      NSDictionary deletedObjects = ERXArrayUtilities.arrayGroupedByKeyPath(editingContext.deletedObjects(), "entityName");
      for (String entityName : entityNames) {
        NSArray deletedObjectsForEntity = (NSArray) deletedObjects.objectForKey(entityName);
        if (deletedObjectsForEntity != null && deletedObjectsForEntity.count() > 0) {
          NSArray inMemory = EOQualifier.filteredArrayWithQualifier(deletedObjectsForEntity, qualifier);
          if (inMemory.count() > 0) {
            result.addObjectsFromArray(inMemory);
          }
View Full Code Here

       NSMutableDictionary gidful = new NSMutableDictionary();
       Enumeration keyEnum = eoful.keyEnumerator();
       while (keyEnum.hasMoreElements()) {
         Object eofulKey = keyEnum.nextElement();
         Object gidfulKey = ERXEOControlUtilities.convertEOtoGID(eofulKey);
         Object gidfulValue = ERXEOControlUtilities.convertEOtoGID(eoful.objectForKey(eofulKey));
         gidful.setObjectForKey(gidfulValue, gidfulKey);
       }
       result = gidful;
     }
     else {
View Full Code Here

       NSMutableDictionary eoful = new NSMutableDictionary();
       Enumeration keyEnum = gidful.keyEnumerator();
       while (keyEnum.hasMoreElements()) {
         Object gidfulKey = keyEnum.nextElement();
         Object eofulKey = ERXEOControlUtilities.convertGIDtoEO(editingContext, gidfulKey);
         Object eofulValue = ERXEOControlUtilities.convertGIDtoEO(editingContext, gidful.objectForKey(gidfulKey));
         eoful.setObjectForKey(eofulValue, eofulKey);
       }
       result = eoful;
     }
     else {
View Full Code Here

            } catch (EOObjectNotAvailableException e) {
                exception = ERXValidationFactory.defaultFactory().createCustomException(object(), "EOObjectNotAvailableException");
            } catch (EOGeneralAdaptorException e) {
              @SuppressWarnings("unchecked") NSDictionary userInfo = e.userInfo();
              if(userInfo != null) {
                EODatabaseOperation op = (EODatabaseOperation)userInfo.objectForKey(EODatabaseContext.FailedDatabaseOperationKey);
                if(op.databaseOperator() == EODatabaseOperation.DatabaseDeleteOperator) {
                  exception = ERXValidationFactory.defaultFactory().createCustomException(object(), "EOObjectNotAvailableException");
                }
              }
              if(exception == null) {
View Full Code Here

  @SuppressWarnings( { "cast", "unchecked" })
  public String urlForQualifier(EOEntity entity, EOQualifier qualifier, NSMutableDictionary<String, Object> attributesFromQualifier) {
    StringBuffer urlBuffer = new StringBuffer();

    NSDictionary connectionDictionary = adaptorContext().adaptor().connectionDictionary();
    String url = (String) connectionDictionary.objectForKey("URL");
    if (url == null || url.length() == 0) {
      throw new IllegalArgumentException("There is no URL specified for the connection dictionary " + connectionDictionary + ".");
    }

    if (url.endsWith("/")) {
View Full Code Here

    Integer cachedValue = (Integer) cache.get(entity);
    if (cachedValue == null) {
      NSDictionary d = entity.userInfo();
      if (d == null)
        d = NSDictionary.EmptyDictionary;
      Object o = d.objectForKey("entityCode");
      cachedValue = o == null ? null : Integer.valueOf(o.toString());
      if (cachedValue == null) {
        cachedValue = Integer.valueOf(0);
      }
      cache.put(entity, cachedValue);
View Full Code Here

    Enumeration modelsEnum = model.modelGroup().models().objectEnumerator();
    while (modelsEnum.hasMoreElements()) {
      EOModel otherModel = (EOModel)modelsEnum.nextElement();
      if (otherModel != model) {
        NSDictionary otherConnectionDictionary = otherModel.connectionDictionary();
        if (otherConnectionDictionary != null && ObjectUtils.equals(newConnectionDictionary.objectForKey("adaptorName"), otherConnectionDictionary.objectForKey("adaptorName"))) {
          boolean valuesThatMatterMatch = true;
          for (int keyNum = 0; valuesThatMatterMatch && keyNum < keysThatMatter.length; keyNum ++) {
            String thisValue = (String)newConnectionDictionary.objectForKey(keysThatMatter[keyNum]);
            String otherValue = (String)otherConnectionDictionary.objectForKey(keysThatMatter[keyNum]);
            valuesThatMatterMatch = ERXStringUtilities.stringEqualsString(thisValue, otherValue);
View Full Code Here

        NSDictionary otherConnectionDictionary = otherModel.connectionDictionary();
        if (otherConnectionDictionary != null && ObjectUtils.equals(newConnectionDictionary.objectForKey("adaptorName"), otherConnectionDictionary.objectForKey("adaptorName"))) {
          boolean valuesThatMatterMatch = true;
          for (int keyNum = 0; valuesThatMatterMatch && keyNum < keysThatMatter.length; keyNum ++) {
            String thisValue = (String)newConnectionDictionary.objectForKey(keysThatMatter[keyNum]);
            String otherValue = (String)otherConnectionDictionary.objectForKey(keysThatMatter[keyNum]);
            valuesThatMatterMatch = ERXStringUtilities.stringEqualsString(thisValue, otherValue);
          }
          if (valuesThatMatterMatch && !newConnectionDictionary.equals(otherConnectionDictionary)) {
            if (!isPrototypeModel(model) && !isPrototypeModel(otherModel)) {
              String message = "The connection dictionaries for " + model.name() + " and " + otherModel.name() + " have the same URL and username, but the connection dictionaries are not equal. Check your connection dictionaries carefully! This problem is often caused by jdbc2Info not matching between the two.  One fix for this is to set " + model.name() + ".removeJdbc2Info=true and " + otherModel.name() + ".removeJdbc2Info=true in your Properties file. (" + model.name() + "=" + newConnectionDictionary + "; and " + otherModel.name() + "=" + otherConnectionDictionary + ").";
View Full Code Here

  public static String prototypeEntityNameForModel(EOModel model) {
    String modelName = model.name();
    String prototypeEntityName = getProperty(modelName + ".EOPrototypesEntity", "dbEOPrototypesEntityGLOBAL");
    NSDictionary databaseConfig = databaseConfigForModel(model);
    if (prototypeEntityName == null && databaseConfig != null) {
      prototypeEntityName = (String) databaseConfig.objectForKey("prototypeEntityName");
    }

    if (prototypeEntityName == null && !(ERXModelGroup.patchModelsOnLoad())) {
      String pluginName = ERXEOAccessUtilities.guessPluginName(model);
      if (pluginName != null) {
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.