Package org.apache.openjpa.util

Examples of org.apache.openjpa.util.UserException


        ConnectionInfo info = (ConnectionInfo) context;
        try {
            return initializeState(sm, state, (JDBCFetchConfiguration) fetch,
                info);
        } catch (ClassNotFoundException cnfe) {
            throw new UserException(cnfe);
        } catch (SQLException se) {
            throw SQLExceptions.getStore(se, _dict);
        }
    }
View Full Code Here


            try {
                return (JPQLNode) new JPQL(jpql).parseQuery();
            } catch (Error e) {
                // special handling for Error subclasses, which the
                // parser may sometimes (unfortunately) throw
                throw new UserException(_loc.get("parse-error",
                    new Object[]{ e.toString(), jpql }));
            } catch (ParseException e) {
                throw new UserException(_loc.get("parse-error",
                    new Object[]{ e.toString(), jpql }), e);
            }
        }
View Full Code Here

    private static Localizer _loc = Localizer.forPackage(JPQLParser.class);
    public static final String LANG_JPQL = "javax.persistence.JPQL";

    public Object parse(String ql, ExpressionStoreQuery query) {
        if (query.getContext().getParameterDeclaration() != null)
            throw new UserException(_loc.get("param-decs-invalid"));

        return new JPQLExpressionBuilder.ParsedJPQL(ql);
    }
View Full Code Here

            return new JPQLExpressionBuilder(factory, query, parsed).
                getQueryExpressions();
        } catch (OpenJPAException ke) {
            throw ke;
        } catch (Exception e) {
            throw new UserException(_loc.get("bad-jpql", parsed), e);
        }
    }
View Full Code Here

        return _endIdx;
    }

    public void setRange(long start, long end) {
        if (start < 0 || end < 0)
            throw new UserException(_loc.get("invalid-range",
                String.valueOf(start), String.valueOf(end)));

        if (end - start > Integer.MAX_VALUE && end != Long.MAX_VALUE)
            throw new UserException(_loc.get("range-too-big",
                String.valueOf(start), String.valueOf(end)));

        lock();
        try {
            assertOpen();
View Full Code Here

            metas = new ClassMetaData[]{ meta };
        else
            metas = StoreQuery.EMPTY_METAS;

        if (metas.length == 0)
            throw new UserException(_loc.get("no-impls", _class));
        try {
            if (metas.length == 1) {
                if (inMem)
                    return _storeQuery.newInMemoryExecutor(metas[0],
                        _subclasses);
View Full Code Here

                    return update(_storeQuery, ex, params);
                throw new UnsupportedException();
            } catch (OpenJPAException ke) {
                throw ke;
            } catch (Exception e) {
                throw new UserException(e);
            } finally {
                _broker.endOperation();
            }
        }
        finally {
View Full Code Here

                    return update(_storeQuery, ex, arr);
                throw new UnsupportedException();
            } catch (OpenJPAException ke) {
                throw ke;
            } catch (Exception e) {
                throw new UserException(e);
            } finally {
                _broker.endOperation();
            }
        }
        finally {
View Full Code Here

            else if (key instanceof Number) {
                if (base == -1)
                    base = positionalParameterBase(params.keySet());
                arr[((Number) key).intValue() - base] = entry.getValue();
            } else
                throw new UserException(_loc.get("bad-param-name", key));
        }
        return arr;
    }
View Full Code Here

                _broker.delete(i.next(), null);
            return Numbers.valueOf(size);
        } catch (OpenJPAException ke) {
            throw ke;
        } catch (Exception e) {
            throw new UserException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.util.UserException

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.