Package com.github.jmkgreen.morphia.query

Examples of com.github.jmkgreen.morphia.query.QueryException


            dbColl = getCollection(query.getEntityClass());

        WriteResult wr;

        if (query.getSortObject() != null || query.getOffset() != 0 || query.getLimit() > 0)
            throw new QueryException("Delete does not allow sort/offset/limit query options.");

        if (query.getQueryObject() != null)
            if (wc == null)
                wr = dbColl.remove(query.getQueryObject());
            else
View Full Code Here


        //TODO remove this after testing.
        if (dbColl == null)
            dbColl = getCollection(qi.getEntityClass());

        if (qi.getSortObject() != null && qi.getSortObject().keySet() != null && !qi.getSortObject().keySet().isEmpty())
            throw new QueryException("sorting is not allowed for updates.");
        if (qi.getOffset() > 0)
            throw new QueryException("a query offset is not allowed for updates.");
        if (qi.getLimit() > 0)
            throw new QueryException("a query limit is not allowed for updates.");

        DBObject q = qi.getQueryObject();
        if (q == null)
            q = new BasicDBObject();
View Full Code Here

        if (MapreduceType.INLINE.equals(type))
            throw new IllegalArgumentException("Inline map/reduce is not supported.");

        if (q.getOffset() != 0 || q.getFieldsObject() != null)
            throw new QueryException("mapReduce does not allow the offset/retrievedFields query options.");


        OutputType outType = OutputType.REPLACE;
        switch (type) {
            case REDUCE:
View Full Code Here

TOP

Related Classes of com.github.jmkgreen.morphia.query.QueryException

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.