Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOQualifier


    // Class methods go here
   
    public static class ReleaseClazz extends _ReleaseClazz {
       
        public Release defaultRelease(EOEditingContext ec) {
            EOQualifier qualifier = new EOKeyValueQualifier(Key.IS_OPEN, EOQualifier.QualifierOperatorEqual, Boolean.TRUE);
            NSArray sorting = new NSArray(new Object[]{
                    EOSortOrdering.sortOrderingWithKey(Key.NAME, EOSortOrdering.CompareDescending)
            });
            EOFetchSpecification fs = new EOFetchSpecification(entityName(), qualifier, sorting);
            return (Release) ec.objectsWithFetchSpecification(fs).lastObject();
View Full Code Here


    EODatabaseContext dbc = EOUtilities.databaseContextForModelNamed(ec, model.name());
    EOAdaptor adaptor = dbc.adaptorContext().adaptor();
    EOSQLExpressionFactory sqlFactory = adaptor.expressionFactory();
    spec = (EOFetchSpecification) spec.clone();

    EOQualifier qualifier = spec.qualifier();
    if (qualifier != null) {
      qualifier = EOQualifierSQLGeneration.Support._schemaBasedQualifierWithRootEntity(qualifier, entity);
    }
    if (qualifier != spec.qualifier()) {
      spec.setQualifier(qualifier);
View Full Code Here

      log.error("filteredArrayWithEntityFetchSpecification Calling conventions have changed from fetchSpec, entity to entity, fetchSpec");
    }
        EOFetchSpecification spec = EOFetchSpecification.fetchSpecificationNamed(fetchSpec, entity);
        NSArray<EOSortOrdering> sortOrderings;
        NSArray<T> result;
        EOQualifier qualifier;

        if (bindings != null) {
            spec = spec.fetchSpecificationWithQualifierBindings(bindings);
        }
View Full Code Here

        primaryKeys = pkeys;
        setEditingContext(ec != null ? ec : ERXEC.newEditingContext());
        setBatchSize(batchSize);
        setFiltersBatches(false);
       
        EOQualifier qualifier = this.fetchSpecification.qualifier();
        if (qualifier != null) {
            editingContext().rootObjectStore().lock();
            try {
                this.fetchSpecification.setQualifier(entity.schemaBasedQualifier(qualifier));
            } finally {
View Full Code Here

                    log.debug("Primary Keys that were not found for this batch: " + missedKeys);
                }
            }

            if (shouldFilterBatches) {
                EOQualifier originalQualifier = fetchSpecification.qualifier();
                if (originalQualifier != null) {
                    nextBatch = EOQualifier.filteredArrayWithQualifier(nextBatch, originalQualifier);
                    log.debug("Filtered batch to: " + nextBatch.count());
                }
            }
View Full Code Here

        }
       
        // ENHANCEME: This should support restrictive qualifiers on the root entity
        @Override
    public EOQualifier schemaBasedQualifierWithRootEntity(EOQualifier eoqualifier, EOEntity eoentity) {
            EOQualifier result = null;
            EOKeyValueQualifier qualifier = (EOKeyValueQualifier)eoqualifier;
            String key = qualifier.key();
             if(qualifier.selector().name().equals(MatchesAllInArraySelectorName)) {
              EOQualifierSQLGeneration.Support support = EOQualifierSQLGeneration.Support.supportForClass(ERXToManyQualifier.class);
              NSArray array = (NSArray) qualifier.value();
View Full Code Here

    /* (non-Javadoc)
     * @see er.extensions.ERXEnterpriseObject#refetchObjectFromDBinEditingContext(com.webobjects.eocontrol.EOEditingContext)
     */
    public ERXEnterpriseObject refetchObjectFromDBinEditingContext(EOEditingContext ec){
        EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName());
        EOQualifier qual = entity.qualifierForPrimaryKey(primaryKeyDictionary(false));
        EOFetchSpecification fetchSpec = new EOFetchSpecification(entityName(), qual, null);
        fetchSpec.setRefreshesRefetchedObjects(true);
        NSArray results = ec.objectsWithFetchSpecification(fetchSpec);
        ERXEnterpriseObject freshObject = null;
        if(results.count()>0){
View Full Code Here

    public Class classForCoder() {
      return getClass();
    }
   
  public static Object decodeObject(NSCoder coder) {
    EOQualifier subqualifier = (EOQualifier) coder.decodeObject();
    String baseKeyPath = (String)coder.decodeObject();
    return new ERXExistsQualifier(subqualifier, baseKeyPath);
  }
View Full Code Here

        if (dg instanceof ERXDisplayGroup) {
      ERXDisplayGroup erxdg = (ERXDisplayGroup) dg;
      return erxdg.filteredObjects().count();
    }
        int result=0;
        EOQualifier q=dg.qualifier();
        if (q!=null) {
            result=EOQualifier.filteredArrayWithQualifier(dg.allObjects(),q).count();
        } else {
            result=dg.allObjects().count();
        }
View Full Code Here

   * Will return the qualifier set by "setQualifierForKey()" if it exists. Null returns otherwise.
   * @param key
   * @return
   */
  public EOQualifier qualifierForKey(String key) {
    EOQualifier qualifier = null;
    if (StringUtils.isNotBlank(key)) {
      qualifier = _extraQualifiers.objectForKey(key);
    }
    return qualifier;
  }
View Full Code Here

TOP

Related Classes of com.webobjects.eocontrol.EOQualifier

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.