Package com.webobjects.eoaccess.EOUtilities

Examples of com.webobjects.eoaccess.EOUtilities.MoreThanOneException


            fs.setPrefetchingRelationshipKeyPaths(prefetchingKeyPaths);
          }
          eos = ec.objectsWithFetchSpecification(fs);
        }
        if (eos.count() > 1) {
          throw new MoreThanOneException("Found multiple objects for the entity '" + entity.name() + "' with primary key value: " + primaryKeyValue);
        }
        if (eos.count() == 0) {
          if (throwIfMissing) {
            throw new EOObjectNotAvailableException("There was no '" + entity.name() + "' found with the id '" + primaryKeyValue + "'.");
          }
View Full Code Here


    public static EOEnterpriseObject objectWithQualifier(EOEditingContext editingContext, String entityName, EOQualifier qualifier) {
        EOFetchSpecification fetchSpec = new EOFetchSpecification(entityName, qualifier, null);
        NSArray results = editingContext.objectsWithFetchSpecification(fetchSpec);
        if( results.count() > 1)
        {
          throw new MoreThanOneException("objectMatchingValueForKeyEntityNamed: Matched more than one object with " +qualifier);
        }
        return (results.count() == 0) ? null : (EOEnterpriseObject)results.objectAtIndex(0);
    }
View Full Code Here

TOP

Related Classes of com.webobjects.eoaccess.EOUtilities.MoreThanOneException

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.