Package com.webobjects.eoaccess

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


     *          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


     *
     * @return array of dictionaries
     */
    public static NSArray<NSDictionary> rawRowsForSQLExpression(EOEditingContext ec, String modelName, EOSQLExpression expression) {
      EOModelGroup modelGroup = EOUtilities.modelGroup(ec);
        EOModel model = modelGroup.modelNamed(modelName);
      return ERXEOAccessUtilities.rawRowsForSQLExpression(ec, model, expression, null);
    }

    /**
     * Returns the raw rows for the given EOSQLExpression.
View Full Code Here

      EOModelGroup modelGroup = EOModelGroup.defaultGroup();
      Enumeration modelNamesEnum = modelNames.objectEnumerator();
      while (modelNamesEnum.hasMoreElements()) {
        String modelName = (String) modelNamesEnum.nextElement();
        if (!skipModelNames.containsObject(modelName)) {
          EOModel model = modelGroup.modelNamed(modelName);
          if (model == null) {
            throw new IllegalArgumentException("There is no model named '" + modelName + "' in this model group.");
          }
          _buildDependenciesForModel(model, ERXMigrator.LATEST_VERSION, versions, migrations);
        }
View Full Code Here

      Set<String> pendingModelNames = new HashSet<String>(versions.keySet());
      while (!pendingModelNames.isEmpty()) {
        Iterator<String> modelNamesIter = pendingModelNames.iterator();
        while (modelNamesIter.hasNext()) {
          String modelName = modelNamesIter.next();
          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)) {
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.