Package org.apache.openjpa.util

Examples of org.apache.openjpa.util.UserException


           String[] includedFetchGropNames = fg.getDeclaredIncludes();
           for (String includedFectchGroupName:includedFetchGropNames) {
               org.apache.openjpa.meta.FetchGroup child =
               meta.getFetchGroup(includedFectchGroupName);
               if (child == null)
                   throw new UserException(_loc.get("missing-included-fg",
                           meta.getDescribedType().getName(), fg.getName(),
                           includedFectchGroupName));
               child.addContainedBy(fg);
           }
       }
View Full Code Here


                pstate.field = field;

                owner = pstate.field.getDefiningMapping();
                if (pstate.field.getManagement()
                    != FieldMapping.MANAGE_PERSISTENT)
                    throw new UserException(_loc.get("non-pers-field",
                        pstate.field));

                // find the most-derived type between the declared relation
                // type and the field's owner, and join from that type to
                // the lesser derived type
View Full Code Here

    public void verifyIndexedField() {
        Action lastAction = (Action) lastFieldAction();
        FieldMapping fm = (FieldMapping) lastAction.data;
        if (fm.getOrderColumn() == null)
            throw new UserException(_loc.get("no-order-column", fm.getName()));
    }
View Full Code Here

    return targets != null ? new SliceInfo(replicated, targets) : null;
  }
 
  private static void assertSlices(String[] targets, Object pc, List<String> actives, Object policy) {
      if (targets == null || targets.length == 0)
            throw new UserException(_loc.get("no-policy-slice", new Object[] {
                policy.getClass().getName(), pc, actives}));
        for (String target : targets)
            if (!actives.contains(target))
                throw new UserException(_loc.get("bad-policy-slice",
                   new Object[] {policy.getClass().getName(), target, pc,
                    actives}));
  }
View Full Code Here

            rs = stmnt.executeQuery();
            if (rs.next())
                return rs.getLong(1);

            // no row !?
            throw new UserException(_loc.get("invalid-seq-sql", _select));
        } finally {
            // clean up our resources
            if (rs != null)
                try { rs.close(); } catch (SQLException se) {}
            if (stmnt != null)
View Full Code Here

        if (_val2 instanceof Lit && val2Type.isAssignableFrom(Raw.class)){
            val2Type = String.class;
        }
        if (!Filters.canConvert(val1Type, val2Type, false)
            && !Filters.canConvert(val2Type, val1Type, false))
            throw new UserException(_loc.get("cant-convert", val1Type, val2Type));

        ctx.store.getDBDictionary().comparison(buf, _op,
            new FilterValueImpl(sel, ctx, bstate.state1, _val1),
            new FilterValueImpl(sel, ctx, bstate.state2, _val2));
        if (sel != null)
View Full Code Here

                    return ACT_NONE;
                break;
            case OP_ATTACH:
                // die on removed
                if (sm != null && sm.isDeleted())
                    throw new UserException(_loc.get("removed",
                        Exceptions.toString(obj))).setFailedObject(obj);
                // cascade through managed instances
                if (sm != null && !sm.isDetached())
                    return ACT_CASCADE;
                break;
            case OP_REFRESH:
                // die on unmanaged instances
                if (sm == null)
                    throw new UserException(_loc.get("not-managed",
                        Exceptions.toString(obj))).setFailedObject(obj);
                break;
            case OP_DETACH:
                if (sm == null || !sm.isPersistent() || sm.isDetached())
                    return ACT_NONE;
View Full Code Here

    public Object getExternalValue(Object val, StoreContext ctx) {
        Map extValues = getExternalValueMap();
        if (extValues != null) {
            Object foundVal = extValues.get(val);
            if (foundVal == null) {
                throw new UserException(_loc.get("bad-externalized-value",
                        new Object[] { val, extValues.keySet(), this }))
                        .setFatal(true).setFailedObject(val);
            } else {
                return foundVal;
            }
View Full Code Here

        if (sm != null) {
            // if deleted and not managed inverse, die
            if (sm.isDeleted() && (_broker.getInverseManager() == null
                || vmd.getFieldMetaData().getInverseMetaDatas().length == 0))
                throw new UserException(_loc.get("ref-to-deleted",
                    Exceptions.toString(obj), vmd,
                    Exceptions.toString(_sm.getManagedInstance()))).
                    setFailedObject(obj);

            StateManagerImpl smimpl = (StateManagerImpl) sm;
View Full Code Here

     */
    private Collection embed(ValueMetaData vmd, Collection orig) {
        // we have to copy to get a collection of the right type and size,
        // though we immediately clear it
        if (orig == null)
            throw new UserException(_loc.get("not-copyable",
                vmd.getFieldMetaData()));
        Collection coll = null;
        try {
            coll = getProxyManager().copyCollection(orig);
        } catch (Exception 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.