Examples of UserException


Examples of org.apache.openjpa.util.UserException

     */
    private void assertBulkModify(StoreQuery q, StoreQuery.Executor ex,
        Object[] params) {
        _broker.assertActiveTransaction();
        if (_startIdx != 0 || _endIdx != Long.MAX_VALUE)
            throw new UserException(_loc.get("no-modify-range"));
        if (_resultClass != null)
            throw new UserException(_loc.get("no-modify-resultclass"));
        StoreQuery.Range range = new StoreQuery.Range();
        ex.getRange(q, params, range);
        if (range.start != 0 || range.end != Long.MAX_VALUE)
            throw new UserException(_loc.get("no-modify-range"));
    }
View Full Code Here

Examples of org.apache.openjpa.util.UserException

            return;

        LinkedMap paramTypes = ex.getParameterTypes(q);
        int typeCount = paramTypes.size();
        if (typeCount > params.length)
            throw new UserException(_loc.get("unbound-params",
                paramTypes.keySet()));

        Iterator itr = paramTypes.entrySet().iterator();
        Map.Entry entry;
        for (int i = 0; itr.hasNext(); i++) {
            entry = (Map.Entry) itr.next();
            if (((Class) entry.getValue()).isPrimitive() && params[i] == null)
                throw new UserException(_loc.get("null-primitive-param",
                    entry.getKey()));
        }
    }
View Full Code Here

Examples of org.apache.openjpa.util.UserException

        // now go through the paramOrder list and re-order the params array
        List translated = new ArrayList();
        for (Iterator i = paramOrder.iterator(); i.hasNext();) {
            int index = ((Number) i.next()).intValue() - 1;
            if (index >= params.size())
                throw new UserException(_loc.get("sqlquery-missing-params",
                    sql, String.valueOf(index), params));
            translated.add(params.get(index));
        }

        // transfer the translated list into the original params list
View Full Code Here

Examples of org.apache.openjpa.util.UserException

            }
            _meta = candidate;

            String sql = StringUtils.trimToNull(ctx.getQueryString());
            if (sql == null)
                throw new UserException(_loc.get("no-sql"));
            _select = sql.length() > 6
                && sql.substring(0, 6).equalsIgnoreCase("select");
            _call = sql.length() > 4
                && sql.substring(0, 4).equalsIgnoreCase("call");
        }
View Full Code Here

Examples of org.apache.openjpa.util.UserException

            if (params.length > 0) {
                paramList = new ArrayList(Arrays.asList(params));
                try {
                    sql = substituteParams(sql, paramList);
                } catch (IOException ioe) {
                    throw new UserException(ioe);
                }
            } else
                paramList = Collections.EMPTY_LIST;

            SQLBuffer buf = new SQLBuffer(dict).append(sql);
View Full Code Here

Examples of org.apache.openjpa.util.UserException

            if (params.length > 0) {
                paramList = new ArrayList(Arrays.asList(params));
                try {
                    sql = substituteParams(sql, paramList);
                } catch (IOException ioe) {
                    throw new UserException(ioe);
                }
            } else
                paramList = Collections.EMPTY_LIST;

            SQLBuffer buf = new SQLBuffer(dict).append(sql);
View Full Code Here

Examples of org.apache.openjpa.util.UserException

    }

    public Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch,
        Result res, Joins joins)
        throws SQLException {
        throw new UserException(_loc.get("cant-project-owned", field));
    }
View Full Code Here

Examples of org.apache.openjpa.util.UserException

     */
    public static void copyKeyFieldsToObjectId(Class pcClass, FieldSupplier fm,
        Object oid) {
        Meta meta = getMeta(pcClass);
        if (meta.pc == null)
            throw new UserException(_loc.get("copy-no-id", pcClass));

        meta.pc.pcCopyKeyFieldsToObjectId(fm, oid);
    }
View Full Code Here

Examples of org.apache.openjpa.util.UserException

     */
    public static void copyKeyFieldsFromObjectId(Class pcClass,
        FieldConsumer fm, Object oid) {
        Meta meta = getMeta(pcClass);
        if (meta.pc == null)
            throw new UserException(_loc.get("copy-no-id", pcClass));

        meta.pc.pcCopyKeyFieldsFromObjectId(fm, oid);
    }
View Full Code Here

Examples of org.apache.openjpa.util.UserException

            setDate(stmnt, idx, ((Calendar) val).getTime(), col);
        else if (val instanceof Reader)
            setCharacterStream(stmnt, idx, (Reader) val,
                (sized == null) ? 0 : sized.size, col);
        else
            throw new UserException(_loc.get("bad-param", val.getClass()));
    }
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.