Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSArray


    {
        if(log.isDebugEnabled()){
            log.debug("browserSelection ="+browserSelection());
        }
        if(browserSelection()!=null){
            NSArray sortedObjects=relationshipDisplayGroup.displayedObjects();
           int selectedIndex = ((Integer)browserSelection().valueForKey(indexKey())).intValue();
           if(log.isDebugEnabled()){
               log.debug("sortedObjects ="+sortedObjects);
               log.debug("selectedIndex = "+selectedIndex);
               log.debug("indexKey = "+indexKey());
View Full Code Here


    }

    public WOComponent moveObjectDown()
    {
        if(browserSelection()!=null){
            NSArray sortedObjects=relationshipDisplayGroup.displayedObjects();
            // make the compiler happy
            sortedObjects.count();
            int selectedIndex = ((Integer)browserSelection().valueForKey(indexKey())).intValue();
            EOEnterpriseObject lastObject =
                (EOEnterpriseObject)relationshipDisplayGroup.displayedObjects().lastObject();
            int lastIndex =
                ((Integer)lastObject.valueForKey(indexKey())).intValue();
View Full Code Here

            return value;
        }
    }

    protected static String getLevel(ERXAssert value) {
        NSArray arr = NSArray.componentsSeparatedByString(value.name(), ".");
        String prefix = "ERXAssert.instances";
        String level = System.getProperty(prefix);
        if(level == null)
            level = "LOG";
        for(Enumeration e = arr.objectEnumerator(); e.hasMoreElements(); ) {
            String s = (String)e.nextElement();
            String possibleLevel = System.getProperty(prefix + "." + s);
            if(possibleLevel != null) {
                level = possibleLevel;
            }
View Full Code Here

        return new NSDictionary(hashMap);
      }

      @Override
      public NSArray allKeys() {
        return new NSArray(hashMap.keySet());
      }
    };
  }
View Full Code Here

  }

  @Override
  public void recordSnapshotForSourceGlobalID(NSArray gids, EOGlobalID gid, String name) {
    if (!ERXDatabaseContext.isFetching()) {
      NSArray originalToManyGIDs = snapshotForSourceGlobalID(gid, name);
      _notifyCacheChange(new ToManySnapshotUpdated(gid, name, originalToManyGIDs, gids));
    }
    super.recordSnapshotForSourceGlobalID(gids, gid, name);
  }
View Full Code Here

  }
 
  @Override
  public NSDictionary _newPrimaryKey(EOEnterpriseObject object, EOEntity entity) {
    EREntityStore store = _entityStoreForEntity(entity, false);
    NSArray pkAttributes = entity.primaryKeyAttributes();
    if (pkAttributes.count() > 1) {
      throw new EOGeneralAdaptorException("Failed to generate primary key because " + entity.name() + " has a composite primary key.");
    }
    EOAttribute pkAttribute = (EOAttribute) pkAttributes.objectAtIndex(0);
    int nextSequence = store.nextSequence();
    Object pkValue;
    String className = pkAttribute.className();
    String valueType = pkAttribute.valueType();
    if ("NSData".equals(className)) {
View Full Code Here

  }

  protected NSArray noopExpressions() {
    EOSQLExpression expression = new ERMemoryExpression(null); // until adaptor().expressionFactory() returns a real expression factory, just hardcode it ...
    expression.setStatement("--");
    return new NSArray(expression);
  }
View Full Code Here

   *      com.webobjects.foundation.NSDictionary)
   */
  public EOEntity subEntityForEntity(EOEntity entity, NSDictionary pkDict) {
    if (encodeEntityInPkValue()) {
      //get the code, we assume that the pkDict contains only one pk value!
      NSArray values = pkDict.allValues();
      if (values.count() > 1) throw new IllegalArgumentException("subEntityForEntity in its default implementation"+
      " works only with single pk long values " + entity.name()" has " +  pkDict);
      long pkValueWithCode;
      try {
        Number n = (Number) values.objectAtIndex(0);
        pkValueWithCode = n.longValue();
      } catch (ClassCastException e) {
        throw new IllegalArgumentException("subEntityForEntity in its default implementation"+
            " works only with single pk long values, expected a java.lang.Number but got a "+values.objectAtIndex(0));
      }
      long entityCode = pkValueWithCode & ((1 << ERXLongPrimaryKeyFactory.CODE_LENGTH) - 1);
      if (entityCode == 0) return null;
      for (Enumeration subEntities = entity.subEntities().objectEnumerator(); subEntities.hasMoreElements();) {
        EOEntity subEntity = (EOEntity) subEntities.nextElement();
View Full Code Here

        EODatabaseContext dbc = ERXEOAccessUtilities.databaseContextForEntityNamed((EOObjectStoreCoordinator) ec.rootObjectStore(), entityName);
        dbc.lock();
        try {
          EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
          EOAdaptorChannel channel = (EOAdaptorChannel) dbc.adaptorContext().channels().lastObject();
          NSArray result = channel.primaryKeysForNewRowsWithEntity(increasePkBy, entity);
          return (Long) ((NSDictionary) result.lastObject()).allValues().lastObject();
        } finally {
          dbc.unlock();
        }
      } finally {
        ec.unlock();
View Full Code Here

  private void createPrimaryKeySupportForModel(EOModel eomodel, EOAdaptorChannel channel, EOSynchronizationFactory syncFactory) {
    try {
      // AK: the (Object) cast is needed, because in 5.4 new NSArray(obj)
      // != new NSArray(array).
      NSArray pkSupportExpressions = syncFactory.primaryKeySupportStatementsForEntityGroups(new NSArray((Object) eomodel.entities()));
      Enumeration enumeration = pkSupportExpressions.objectEnumerator();
      while (enumeration.hasMoreElements()) {
        EOSQLExpression expression = (EOSQLExpression) enumeration.nextElement();
        channel.evaluateExpression(expression);
      }
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSArray

Copyright © 2018 www.massapicom. 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.