Examples of UserException


Examples of org.apache.openjpa.util.UserException

            switch (JavaTypes.getTypeCode(type)) {
                case JavaTypes.ARRAY:
                case JavaTypes.COLLECTION:
                case JavaTypes.MAP:
                    throw new UserException(_loc.get("container-projection",
                        q.getContext().getQueryString()));
            }
        }
View Full Code Here

Examples of org.apache.openjpa.util.UserException

                    // fall through to exception below
                } catch (NullPointerException npe) {
                    // fall through to exception below
                }
            }
            throw new UserException(_loc.get("only-range-constants",
                q.getContext().getQueryString()));
        }
View Full Code Here

Examples of org.apache.openjpa.util.UserException

                } else if (_agg == null) {
                    if (val.isAggregate())
                        _agg = val;
                    else if (val instanceof Path
                        && (_grouped == null || !_grouped.contains(val))) {
                        throw new UserException(_loc.get("bad-grouping",
                            _ctx.getCandidateType(), _ctx.getQueryString()));
                    }
                }
            }
View Full Code Here

Examples of org.apache.openjpa.util.UserException

        public DataStoreExecutor(ExpressionStoreQuery q,
            ClassMetaData meta, boolean subclasses,
            ExpressionParser parser, Object parsed) {
            _metas = q.getIndependentExpressionCandidates(meta, subclasses);
            if (_metas.length == 0)
                throw new UserException(_loc.get("query-unmapped", meta));
            _meta = meta;
            _subs = subclasses;
            _parser = parser;

            _facts = new ExpressionFactory[_metas.length];
View Full Code Here

Examples of org.apache.openjpa.util.UserException

        final int[] min;

        public Schedule(String date) {
            StringTokenizer token = new StringTokenizer(date, " \t");
            if (token.countTokens() != 5)
                throw new UserException(_loc.get("bad-count", date)).
                    setFatal(true);
            try {
                min = parse(token.nextToken(), 0, 60);
                hour = parse(token.nextToken(), 0, 24);
                dayOfMonth = parse(token.nextToken(), 1, 31);
                month = parse(token.nextToken(), 1, 13);
                dayOfWeek = parse(token.nextToken(), 1, 8);
            } catch (Throwable t) {
                throw new UserException(_loc.get("bad-schedule", date), t).
                    setFatal(true);
            }
        }
View Full Code Here

Examples of org.apache.openjpa.util.UserException

            int [] times = new int[tokens.length];
            for (int i = 0; i < tokens.length; i++) {
                try {
                    times[i] = Integer.parseInt(tokens[i]);
                } catch (Throwable t) {
                    throw new UserException(_loc.get("not-number", token)).
                        setFatal(true);
                }
                if (times[i] < min || times[i] >= max)
                    throw new UserException(_loc.get("not-range", token,
                        String.valueOf(min), String.valueOf(max))).
                        setFatal(true);
            }
            return times;
        }
View Full Code Here

Examples of org.apache.openjpa.util.UserException

            this.urls = new HashSet((int) (strs.length * 1.33 + 1));
            try {
                for (int i = 0; i < strs.length; i++)
                    this.urls.add(new URL(strs[i]));
            } catch (MalformedURLException mue) {
                throw new UserException(mue);
            }
        }
    }
View Full Code Here

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

Examples of org.apache.openjpa.util.UserException

            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

Examples of org.apache.openjpa.util.UserException

    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
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.