Package com.webobjects.eoaccess

Examples of com.webobjects.eoaccess.EOEntity.model()


     *            name of the entity to generate the primary key dictionary for.
     * @return a dictionary containing a new primary key for the given entity.
     */
    public static NSDictionary primaryKeyDictionaryForEntity(EOEditingContext ec, String entityName) {
      EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
      EODatabaseContext dbContext = EODatabaseContext.registeredDatabaseContextForModel(entity.model(), ec);
      NSDictionary primaryKey = null;
      dbContext.lock();
      try {
        EOAdaptorChannel adaptorChannel = dbContext.availableChannel().adaptorChannel();
        if (!adaptorChannel.isOpen()) {
View Full Code Here


        return result;
    }

    protected boolean _shouldGenerateForeignKeyConstraints(EORelationship rel) {
        EOEntity destinationEntity = rel.destinationEntity();
        return !rel.isFlattened() && destinationEntity.externalName() != null && rel.entity().model() == destinationEntity.model();
    }

    /**
     * <code>PostgresqlExpression</code> factory method.
     *
 
View Full Code Here

            @Override
            protected int doPerform(EOAdaptorChannel channel) {
                return channel.deleteRowsDescribedByQualifier(qualifier, entity);
            }
        };
        return action.perform(ec, entity.model().name());
    }

    /**
     * Updates rows described by the qualifier. Note that the values and the qualifier need to be on an attribute
     * and not on a relationship level. I.e. you need to give relationshipForeignKey = pk of object instead of
View Full Code Here

            @Override
            protected int doPerform(EOAdaptorChannel channel) {
                return channel.updateValuesInRowsDescribedByQualifier(newValues, qualifier, entity);
            }
        };
        return action.perform(ec, entity.model().name());
    }

    /**
     * Insert row described dictionary.
     * @param ec
View Full Code Here

            protected int doPerform(EOAdaptorChannel channel) {
              channel.insertRow(newValues, entity);
                return 1;
            }
        };
        return action.perform(ec, entity.model().name());
    }

    /**
     * Insert rows described the array of dictionaries.
     * @param ec
View Full Code Here

                  insert++;
        }
                return insert;
            }
        };
        return action.perform(ec, entity.model().name());
    }

    /**
     * Creates count new primary keys for the entity.
     * @param ec
View Full Code Here

        NSArray keys = channel.primaryKeysForNewRowsWithEntity(count, entity);
        result.addObjectsFromArray(keys);
        return count;
      }
    };
    action.perform(ec, entity.model().name());
    return result;
  }

    /**
   * Tries to get the plugin name for a JDBC based model.
View Full Code Here

          EOModel model = modelGroup.modelNamed(modelName);
          Enumeration entitiesEnum = model.entities().objectEnumerator();
          while (entitiesEnum.hasMoreElements()) {
            EOEntity entity = (EOEntity) entitiesEnum.nextElement();
            EOEntity parentEntity = entity.parentEntity();
            if (parentEntity != null && !parentEntity.model().equals(model)) {
              EOModel parentModel = parentEntity.model();
              _buildDependenciesForModel(parentModel, LATEST_VERSION, versions, migrations);
            }
            Enumeration relationshipsEnum = entity.relationships().objectEnumerator();
            while (relationshipsEnum.hasMoreElements()) {
View Full Code Here

          Enumeration entitiesEnum = model.entities().objectEnumerator();
          while (entitiesEnum.hasMoreElements()) {
            EOEntity entity = (EOEntity) entitiesEnum.nextElement();
            EOEntity parentEntity = entity.parentEntity();
            if (parentEntity != null && !parentEntity.model().equals(model)) {
              EOModel parentModel = parentEntity.model();
              _buildDependenciesForModel(parentModel, LATEST_VERSION, versions, migrations);
            }
            Enumeration relationshipsEnum = entity.relationships().objectEnumerator();
            while (relationshipsEnum.hasMoreElements()) {
              EORelationship relationship = (EORelationship) relationshipsEnum.nextElement();
View Full Code Here

            }
            Enumeration relationshipsEnum = entity.relationships().objectEnumerator();
            while (relationshipsEnum.hasMoreElements()) {
              EORelationship relationship = (EORelationship) relationshipsEnum.nextElement();
              EOEntity destinationEntity = relationship.destinationEntity();
              if (destinationEntity != null && !destinationEntity.model().equals(model)) {
                EOModel destinationModel = destinationEntity.model();
                _buildDependenciesForModel(destinationModel, LATEST_VERSION, versions, migrations);
              }
            }
          }
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.