Examples of InvalidResultException


Examples of com.googlecode.mashups.services.digg.exceptions.InvalidResultException

            return null;
        }
      
        // Check for invalid result or returned an error
        if (!DIGG_STORIES_ELEMENT.equals(storiesElement.getName())) {
            throw new InvalidResultException(
                    "The result root element is expected to be ("
                            + DIGG_STORIES_ELEMENT
                            + ") but returned element is (" + storiesElement
                            + ")");
        }
View Full Code Here

Examples of com.googlecode.mashups.services.digg.exceptions.InvalidResultException

      
       
        JSONObject rootResults    = new JSONObject(builder.toString())
        // Check for invalid result or returned an error
        if (! rootResults.has(DIGG_STORIES_ELEMENT) ) {
            throw new InvalidResultException(
                    "Error in Results: The stories root element is not available ");
        }              
        JSONArray  storiesElement = rootResults.getJSONArray(DIGG_STORIES_ELEMENT);

        /*  Parse the Results as long there is no returned Error code */
 
View Full Code Here

Examples of org.jooq.exception.InvalidResultException

        if (r.size() == 1) {
            return r.get(0);
        }
        else if (r.size() > 1) {
            throw new InvalidResultException("Query returned more than one result");
        }

        return null;
    }
View Full Code Here

Examples of org.jooq.exception.InvalidResultException

    public final <K> Map<K, R> fetchMap(Field<K> key) {
        Map<K, R> map = new LinkedHashMap<K, R>();

        for (R record : fetch()) {
            if (map.put(record.getValue(key), record) != null) {
                throw new InvalidResultException("Key " + key + " is not unique in Result for " + this);
            }
        }

        return map;
    }
View Full Code Here

Examples of org.jooq.exception.InvalidResultException

    private final Map<String, Object> convertToMap(R record) {
        Map<String, Object> map = new LinkedHashMap<String, Object>();

        for (Field<?> field : record.getFields()) {
            if (map.put(field.getName(), record.getValue(field)) != null) {
                throw new InvalidResultException("Field " + field.getName() + " is not unique in Record for " + this);
            }
        }

        return map;
    }
View Full Code Here

Examples of org.jooq.exception.InvalidResultException

    private static int filterOne(int i, String action) {
        if (i <= 1) {
            return i;
        }
        else {
            throw new InvalidResultException("Too many rows " + action + " : " + i);
        }
    }
View Full Code Here

Examples of org.jooq.exception.InvalidResultException

            for (Field<?> field : getFields()) {
                setValue0(field, record.getValue0(field));
            }
        }
        else {
            throw new InvalidResultException("Exactly one row expected for refresh. Record does not exist in database.");
        }
    }
View Full Code Here

Examples of org.jooq.exception.InvalidResultException

        int size = fields.size();
        for (int i = 0; i < size; i++) {
            Field<?> field = fields.field(i);

            if (map.put(field.getName(), getValue(i)) != null) {
                throw new InvalidResultException("Field " + field.getName() + " is not unique in Record : " + this);
            }
        }

        return map;
    }
View Full Code Here

Examples of org.jooq.exception.InvalidResultException

                        return record;
                    }
                });
        }
        else {
            throw new InvalidResultException("Exactly one row expected for refresh. Record does not exist in database.");
        }
    }
View Full Code Here

Examples of org.jooq.exception.InvalidResultException

        int index = indexOrFail(fieldsRow(), key);
        Map<K, R> map = new LinkedHashMap<K, R>();

        for (R record : this) {
            if (map.put((K) record.getValue(index), record) != null) {
                throw new InvalidResultException("Key " + key + " is not unique in Result for " + this);
            }
        }

        return map;
    }
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.