Package org.apache.openjpa.util

Examples of org.apache.openjpa.util.UserException


     */
    private boolean startTable(Attributes attrs)
        throws SAXException {
        ClassMapping mapping = (ClassMapping) currentElement();
        if (mapping.isAbstract())
            throw new UserException(_loc.get("table-not-allowed", mapping));
        DBIdentifier table = toTableIdentifier(attrs.getValue("schema"),
            attrs.getValue("name"));
        if (!DBIdentifier.isNull(table))
            mapping.getMappingInfo().setTableIdentifier(table);
        return true;
View Full Code Here


                && deleteAction == org.apache.openjpa.jdbc.schema.ForeignKey.ACTION_RESTRICT
                && updateAction == org.apache.openjpa.jdbc.schema.ForeignKey.ACTION_RESTRICT
            && _columnNames.length == 0
            && specified;
        if (!isDefault)
            throw new UserException(_loc.get("implicit-non-default-fk", _cls,
                getSourceFile()).getMessage());
    }
View Full Code Here

        List<Method> setters = filter(methods, setterFilter);
        getters =  matchGetterAndSetter(getters, setters);
       
        boolean mixed = !fields.isEmpty() && !getters.isEmpty();
        if (mixed)
          throw new UserException(_loc.get("access-mixed",
            cls, toFieldNames(fields), toMethodNames(getters)));
        if (!fields.isEmpty()) {
          return AccessCode.FIELD;
        }
        if (!getters.isEmpty()) {
View Full Code Here

   
    void error(ClassMetaData meta, Localizer.Message message) {
      Log log = meta.getRepository().getConfiguration()
        .getLog(OpenJPAConfiguration.LOG_RUNTIME);
      log.error(message.toString());
      throw new UserException(message.toString());
    }
View Full Code Here

        return _mappedBy;
    }

    public void setValueMappedBy(String mapped) {
        if (_owner.getKey() != this && mapped != null)
            throw new UserException(_loc.get("mapped-by-not-key", this));
        else {
            _mappedBy = mapped;
            _mappedByMeta = null;
        }
    }
View Full Code Here

        } catch (Exception e) {
            throw new GeneralException(e);
        }

        if (mustExist)
            throw new UserException(_loc.get("bad-getter", cls, prop));
        return null;
    }
View Full Code Here

        } catch (Exception e) {
            throw new GeneralException(e);
        }

        if (mustExist)
            throw new UserException(_loc.get("bad-setter", cls, prop));
        return null;
    }
View Full Code Here

        } catch (Exception e) {
            throw new GeneralException(e);
        }

        if (mustExist)
            throw new UserException(_loc.get("bad-field", cls, name));
        return null;
    }
View Full Code Here

        return get(obj, field);
      Method getter = findGetter(cls, prop, false);
      if (getter != null)
        return get(obj, getter);
        if (mustExist)
            throw new UserException(_loc.get("bad-field", cls, prop));
        return null; // should not reach
    }
View Full Code Here

        try {
            if (!Modifier.isPublic(mods) && !ao.isAccessible())
                AccessController.doPrivileged(J2DoPrivHelper
                    .setAccessibleAction(ao, true));
        } catch (SecurityException se) {
            throw new UserException(_loc.get("reflect-security", ao)).
                setFatal(true);
        }
    }
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.