Package com.webobjects.eoaccess

Examples of com.webobjects.eoaccess.EOModelGroup


    Map databaseConfig = selectedDatabaseConfig;
    if (databaseConfig == null) {
      databaseConfig = new HashMap();
    }

    _modelGroup = new EOModelGroup();

    Iterator modelURLIter = modelURLs.iterator();
    while (modelURLIter.hasNext()) {
      URL modelURL = (URL) modelURLIter.next();
      _modelGroup.addModelWithPathURL(modelURL);
View Full Code Here


    Map databaseConfig = selectedDatabaseConfig;
    if (databaseConfig == null) {
      databaseConfig = new HashMap();
    }

    _modelGroup = new EOModelGroup();

    Iterator modelURLIter = modelURLs.iterator();
    while (modelURLIter.hasNext()) {
      URL modelURL = (URL) modelURLIter.next();
      _modelGroup.addModelWithPathURL(modelURL);
View Full Code Here

        _selectedKey = key;
    }

    public String valueClassNameForKey(String key) {
        String entityName = (String) _WOJExtensionsUtil.valueForBindingOrNull("sourceEntityName", this);
        EOModelGroup modelGroup = EOModelGroup.defaultGroup();
        EOEntity entity = modelGroup.entityNamed(entityName);
        EOAttribute selectedAttribute = null;
        if (relationshipKey() != null && entity.relationshipNamed(relationshipKey()) != null) {
            EORelationship relationship = entity.relationshipNamed(relationshipKey());
            EOEntity destinationEntity = relationship.destinationEntity();
            selectedAttribute = destinationEntity.attributeNamed(key);
View Full Code Here

     * @param entityName
     *          The entity name
     * @return The database context for the given editing context and entity name
     */
    private static EODatabaseContext databaseContextForEntityName( EOEditingContext ec, String entityName ) {
        EOModelGroup group = EOUtilities.modelGroup( ec );
        EOModel model = group.entityNamed(entityName).model();
        if (model == null) {
            throw new RuntimeException("Entity named " + entityName + " not found in the model group.");
        }
        return EODatabaseContext.registeredDatabaseContextForModel(model, ec);
    }
View Full Code Here

     * @param modelName
     *          The model name
     * @return The database context for the given editing context and model name
     */
    private static EODatabaseContext databaseContextForModelName(EOEditingContext ec, String modelName) {
        EOModelGroup group = EOUtilities.modelGroup( ec );
        EOModel model = group.modelNamed(modelName);
        if (model == null) {
            throw new RuntimeException("Model " + modelName + " not found in the model group.");
        }
        return EODatabaseContext.registeredDatabaseContextForModel(model, ec);
    }
View Full Code Here

        if (dataSource() == null) {
            setDataSource((EODatabaseDataSource) _WOJExtensionsUtil.valueForBindingOrNull("dataSource", this));

            if (dataSource() == null) {
                String anEntityName = _localSourceEntityName();
                EOModelGroup aModelGroup = EOModelGroup.defaultGroup();
                EOEntity anEntity = aModelGroup.entityNamed(anEntityName);

                if (anEntity == null) {
                    throw new IllegalStateException("<" + getClass().getName() + " could not find entity named " + anEntityName + ">");
                }
               
View Full Code Here

      
    }

    private EOEntity _entityNamed(String entityName, WOSession session) {
        EOEditingContext ec = (session != null ? session.defaultEditingContext() : null);
        EOModelGroup group = (ec == null) ? EOModelGroup.defaultGroup() : EOUtilities.modelGroup(ec);
        return entityName != null ? group.entityNamed(entityName) : null;
    }
View Full Code Here

        /**
         * Method called when a model group did load.
         */
        public final void modelGroupWasAdded(NSNotification n) {
            log.debug("modelGroupWasAdded: " + n);
            EOModelGroup group = (EOModelGroup) n.object();
            processModelGroup(group);
        }
View Full Code Here

      boolean objectsMayGetAdded = includeNewObjects || includeNewObjectsInParentEditingContext || filterUpdatedObjects;
    NSMutableArray cloneMatchingObjects = null;
      NSMutableArray<String> entityNames = new NSMutableArray<String>();
    entityNames.addObject(entityName);
      if (isDeep) {
        EOModelGroup modelGroup = ERXEOAccessUtilities.modelGroup(editingContext);
        EOEntity rootEntity = modelGroup.entityNamed(entityName);
        for (EOEntity subEntity : rootEntity.subEntities()) {
          entityNames.addObject(subEntity.name());
        }
      }
      // Filter again, because the in-memory versions may have been modified and no longer may match the qualifier
View Full Code Here

      }
    }

    protected void _process(EOObjectStoreCoordinator sender, EOObjectStoreCoordinator osc, NSMutableDictionary dbcs, SnapshotProcessor processor, NSDictionary changesByEntity, String userInfoKey) {
      SynchronizerSettings settings = settingsForCoordinator(osc);
      EOModelGroup modelGroup = EOModelGroup.modelGroupForObjectStoreCoordinator(sender);
      for (Enumeration entityNames = changesByEntity.allKeys().objectEnumerator(); entityNames.hasMoreElements();) {
        String entityName = (String) entityNames.nextElement();
        String key = entityName + "/" + System.identityHashCode(osc);
        EOEntity entity = modelGroup.entityNamed(entityName);
        NSArray snapshots = (NSArray) changesByEntity.objectForKey(entityName);
        EODatabaseContext dbc = (EODatabaseContext) dbcs.objectForKey(key);
        if (dbc == null) {
          dbc = ERXEOAccessUtilities.databaseContextForEntityNamed(osc, entityName);
          dbcs.setObjectForKey(dbc, key);
View Full Code Here

TOP

Related Classes of com.webobjects.eoaccess.EOModelGroup

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.