Package org.apache.openjpa.util

Examples of org.apache.openjpa.util.RuntimeExceptionTranslator


     * Translation only occurs if the exception is initiated by a user action
     * on an instance, and therefore will not be caught and translated by the
     * broker.
     */
    protected RuntimeException translate(RuntimeException re) {
        RuntimeExceptionTranslator trans = _broker.getInstanceExceptionTranslator();
        return (trans == null) ? re : trans.translate(re);
    }
View Full Code Here


     * Translation only occurs if the exception is initiated by a user action
     * on an instance, and therefore will not be caught and translated by the
     * broker.
     */
    protected RuntimeException translate(RuntimeException re) {
        RuntimeExceptionTranslator trans = _broker.getInstanceExceptionTranslator();
        return (trans == null) ? re : trans.translate(re);
    }
View Full Code Here

     * Constructor; supply factory and delegate.
     */
    public EntityManagerImpl(EntityManagerFactoryImpl factory,
        Broker broker) {
        _emf = factory;
        RuntimeExceptionTranslator translator =
            PersistenceExceptions.getRollbackTranslator(this);
        _broker = new DelegatingBroker(broker, translator);
        _broker.setImplicitBehavior(this, translator);
    }
View Full Code Here

     * and {@link NonUniqueResultException} in accordance with
     * section 3.7 of the EJB 3.0 specification.
     */
    public static RuntimeExceptionTranslator getRollbackTranslator
        (final OpenJPAEntityManager em) {
        return new RuntimeExceptionTranslator() {
            private boolean throwing = false;

            public RuntimeException translate(RuntimeException re) {
                RuntimeException ex = toPersistenceException(re);
                if (!(ex instanceof NonUniqueResultException)
View Full Code Here

     * Translation only occurs if the exception is initiated by a user action
     * on an instance, and therefore will not be caught and translated by the
     * broker.
     */
    protected RuntimeException translate(RuntimeException re) {
        RuntimeExceptionTranslator trans = _broker.
            getInstanceExceptionTranslator();
        return (trans == null) ? re : trans.translate(re);
    }
View Full Code Here

    _em.assertNotCloseInvoked();
    Object ob = execute();
    if (ob instanceof List) {
      List ret = (List) ob;
      if (ret instanceof ResultList) {
          RuntimeExceptionTranslator trans = PersistenceExceptions.getRollbackTranslator(_em);
          if (_query.isDistinct()) {
              return new DistinctResultList((ResultList) ret, trans);
          } else {
              return new DelegatingResultList((ResultList) ret, trans);
          }
View Full Code Here

     * Translation only occurs if the exception is initiated by a user action
     * on an instance, and therefore will not be caught and translated by the
     * broker.
     */
    protected RuntimeException translate(RuntimeException re) {
        RuntimeExceptionTranslator trans = _broker.getInstanceExceptionTranslator();
        return (trans == null) ? re : trans.translate(re);
    }
View Full Code Here

     * Translation only occurs if the exception is initiated by a user action
     * on an instance, and therefore will not be caught and translated by the
     * broker.
     */
    protected RuntimeException translate(RuntimeException re) {
        RuntimeExceptionTranslator trans = _broker.getInstanceExceptionTranslator();
        return (trans == null) ? re : trans.translate(re);
    }
View Full Code Here

        list.add("xxx");
        list.add("yyy");
        ResultList resultList = new ListResultList(list);
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
        em.close();
        RuntimeExceptionTranslator trans = PersistenceExceptions.getRollbackTranslator(em);
        DistinctResultList distinctResultList = new DistinctResultList(resultList, trans);
        try {
            roundtrip(distinctResultList);
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

        list.add("xxx");
        list.add("yyy");
        ResultList resultList = new ListResultList(list);
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
        em.close();
        RuntimeExceptionTranslator trans = PersistenceExceptions.getRollbackTranslator(em);
        DistinctResultList distinctResultList = new DistinctResultList(resultList, trans);
        try {
            roundtrip(distinctResultList);
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

TOP

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

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.