Examples of EOModel


Examples of com.webobjects.eoaccess.EOModel

         * @param entity to create the class description for
         * @return new class description for the given entity
         */
        protected ERXEntityClassDescription newClassDescriptionForEntity(EOEntity entity) {
          String key = entity.name();
          EOModel model = entity.model();
          if (model != null) {
            key = model.name() + " " + key;
          }
          ERXEntityClassDescription classDescription = (ERXEntityClassDescription)_classDescriptionForEntity.objectForKey(key);
          if (classDescription == null) {
            classDescription = new ERXEntityClassDescription(entity);
            _classDescriptionForEntity.setObjectForKey(classDescription, key);
View Full Code Here

Examples of com.webobjects.eoaccess.EOModel

     *          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.EOModel

     *          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

Examples of com.webobjects.eoaccess.EOModel

        }
    }

    public void indexAllObjects(EOModelGroup group) {
        for (Enumeration models = group.models().objectEnumerator(); models.hasMoreElements();) {
            EOModel model = (EOModel) models.nextElement();
            indexAllObjects(model);
        }
    }
View Full Code Here

Examples of com.webobjects.eoaccess.EOModel

     * @param eo enterprise object
     * @param relationshipName relationship name
     */
    public static void clearSnapshotForRelationshipNamed(EOEnterpriseObject eo, String relationshipName) {
        EOEditingContext ec = eo.editingContext();
        EOModel model = EOUtilities.entityForObject(ec, eo).model();
        EODatabaseContext dbc = EODatabaseContext.registeredDatabaseContextForModel(model, ec);
        EODatabase database = dbc.database();
        ERXEOControlUtilities.clearSnapshotForRelationshipNamedInDatabase(eo, relationshipName, database);
    }
View Full Code Here

Examples of com.webobjects.eoaccess.EOModel

      result = objects.immutableClone();
    }
    else {
      // we have hints, use them
     
      EOModel model = EOModelGroup.defaultGroup().entityNamed(spec.entityName()).model();
      ERXSQLHelper sqlHelper = ERXSQLHelper.newSQLHelper(ec, model.name());
      Object hint = spec.hints().valueForKey(EODatabaseContext.CustomQueryExpressionHintKey);
      String sql = sqlHelper.customQueryExpressionHintAsString(hint);
      sql = sqlHelper.limitExpressionForSQL(null, spec, sql, start, end);
     
      if (rawRowsForCustomQueries) {
        result = EOUtilities.rawRowsForSQL(ec, model.name(), sql, null);
      }
      else {
        EOFetchSpecification fs = new EOFetchSpecification(spec.entityName(), null, null);
        fs.setHints(new NSDictionary(sql, EODatabaseContext.CustomQueryExpressionHintKey));
        result = ec.objectsWithFetchSpecification(fs);
View Full Code Here

Examples of com.webobjects.eoaccess.EOModel

     * @param aggregateAttribute the attribute that contains the "count(*)" definition
     * @return the number of objects
     */
    public static Object _aggregateFunctionWithQualifierAndAggregateAttribute(EOEditingContext ec, String entityName, EOQualifier qualifier, EOAttribute aggregateAttribute) {
        EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
        EOModel model = entity.model();
        EODatabaseContext dbc = EODatabaseContext.registeredDatabaseContextForModel(model, ec);
        Object aggregateValue = null;
       
        dbc.lock();
        try {
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EOModel

    try {
      String extension = (_createEOModelGroup) ? ".eomodelgroup" : ".eogen";
      EOModelGroup modelGroup = new EOModelGroup();
      final Set<EOModelVerificationFailure> failures = new HashSet<EOModelVerificationFailure>();
      IEOModelGroupFactory.Utility.loadModelGroup(_modelFile, modelGroup, failures, true, _modelFile.getLocationURI().toURL(), new NullProgressMonitor());
      EOModel model = modelGroup.getEditingModel();
      if (model != null) {
        EOGeneratorModel eogenModel = EOGeneratorWizard.createEOGeneratorModel(_modelFile.getParent(), model, false);
        String eogenBasePath = URLUtils.cheatAndTurnIntoFile(model.getModelURL()).getAbsolutePath();
        int dotIndex = eogenBasePath.lastIndexOf('.');
        eogenBasePath = eogenBasePath.substring(0, dotIndex);
        String eogenPath = eogenBasePath + extension;
        IFile eogenFile = _modelFile.getWorkspace().getRoot().getFileForLocation(new Path(eogenPath));
        for (int dupeNum = 0; eogenFile.exists(); dupeNum++) {
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EOModel

    // GridData(GridData.FILL_HORIZONTAL);
    // modelCombo.setLayoutData(modelComboLayoutData);
    _modelComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
      public void selectionChanged(SelectionChangedEvent event) {
        IStructuredSelection selection = (IStructuredSelection) event.getSelection();
        EOModel selectedModel = (EOModel) selection.getFirstElement();
        _entityComboViewer.setInput(selectedModel);
        if (_entityComboViewer.getCombo().getItemCount() > 0) {
          _entityComboViewer.setSelection(new StructuredSelection(_entityComboViewer.getElementAt(0)));
        }
      }
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EOModel

    myComparator = new KVCComparator(EOEntity.class, EOEntity.NAME);
  }

  public Object[] getElements(Object _inputElement) {
    Set entitiesList;
    EOModel model = EOModelUtils.getRelatedModel(_inputElement);
    if (model != null) {
      entitiesList = model.getModelGroup().getPrototypeEntities();
    } else {
      throw new IllegalArgumentException("Unknown input element: " + _inputElement);
    }

    List entitiesListCopy = new LinkedList();
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.