Examples of entityNamed()


Examples of com.webobjects.eoaccess.EOModelGroup.entityNamed()

    }

    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

Examples of com.webobjects.eoaccess.EOModelGroup.entityNamed()

     *          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

Examples of com.webobjects.eoaccess.EOModelGroup.entityNamed()

            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

Examples of com.webobjects.eoaccess.EOModelGroup.entityNamed()

    }

    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;
    }

    private EOEnterpriseObject _newObjectWithEntity(EOEntity entity, EOEditingContext ec) {
        if (entity.isReadOnly()) { throw new IllegalArgumentException(" You can't create a new instance of " + entity.name()
                + ". It is a read-only entity.  It is marked read-only in the model."); }
View Full Code Here

Examples of com.webobjects.eoaccess.EOModelGroup.entityNamed()

    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

Examples of com.webobjects.eoaccess.EOModelGroup.entityNamed()

      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

Examples of com.webobjects.eoaccess.EOModelGroup.entityNamed()

     *            entity name
     * @return the entity with the specified name
     */
    public static EOEntity entityNamed(EOEditingContext ec, String entityName) {
        EOModelGroup modelGroup = modelGroup(ec);
        return modelGroup.entityNamed(entityName);
    }

    /**
     * Creates an aggregate integer attribute for a given function name. These can then
     * be used to query on when using raw rows.
View Full Code Here

Examples of com.webobjects.eoaccess.EOModelGroup.entityNamed()

               EOGlobalID gid = (EOGlobalID) gidEnum.nextElement();
               if (gid instanceof EOKeyGlobalID) {
                 EOEnterpriseObject eo = null;
                 EOKeyGlobalID keyGID = (EOKeyGlobalID) gid;
                 String entityName = keyGID.entityName();
                 EOEntity entity = modelGroup.entityNamed(entityName);
                 NSDictionary snapshot = database.snapshotForGlobalID(gid);
                 if (snapshot != null) {
                   EOQualifier gidQualifier = entity.qualifierForPrimaryKey(entity.primaryKeyForGlobalID(gid));
                   EOFetchSpecification gidFetchSpec = new EOFetchSpecification(entityName, gidQualifier, null);
View Full Code Here

Examples of com.webobjects.eoaccess.EOModelGroup.entityNamed()

    if (_lastUpdatedModel == model) {
      dbUpdaterModel = _dbUpdaterModelCache;
    }
    else {
      EOModelGroup modelGroup = model.modelGroup();
      EOEntity prototypeEntity = modelGroup.entityNamed(ERXModelGroup.prototypeEntityNameForModel(model));
      boolean isWonderPrototype = (prototypeEntity != null && prototypeEntity.model().name().equals("erprototypes"));

      dbUpdaterModel = new EOModel();
      dbUpdaterModel.setConnectionDictionary(model.connectionDictionary());
      dbUpdaterModel.setAdaptorName(model.adaptorName());
View Full Code Here

Examples of com.webobjects.eoaccess.EOModelGroup.entityNamed()

        if (null==dataSource()) {
            setDataSource((EODatabaseDataSource) _WOJExtensionsUtil.valueForBindingOrNull("dataSource",this));
            if (null==dataSource()) {
                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
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.