Package org.openbp.server.persistence

Examples of org.openbp.server.persistence.PersistenceException


   * @return The exception
   */
  protected PersistenceException createLoggedException(Throwable cause)
  {
    String msg = LogUtil.error(getClass(), "Persistence error.", cause);
    return new PersistenceException(msg, cause);
  }
View Full Code Here


    {
      return entityManager.getEntityManagerFactory().getPersistenceUnitUtil().getIdentifier(obj);
    }
    catch (IllegalArgumentException e)
    {
      throw new PersistenceException("Class '" + obj.getClass().getName() + "' of object '" + obj
        + "' is not a persistent class or does not define an id attribute.", e);
    }
    catch (Exception e)
    {
      throw createLoggedException(e);
View Full Code Here

  private Number obtainNumber(final Object value, final Class beanClass, final String propertyName)
  {
    if (value instanceof Number)
      return (Number) value;
    throw new PersistenceException("Expected numeric value as criteria of property '" + propertyName
      + "' of entity '" + beanClass.getName() + "', got '" + value + "'.");
  }
View Full Code Here

   * @throws PersistenceException On error
   */
  public Object findById(final Object id, final Class cls)
    throws PersistenceException
  {
    throw new PersistenceException("Operation not supported by dummy persistence context.");
  }
View Full Code Here

   * @throws PersistenceException On error
   */
  public Iterator runQuery(final PersistenceQuery query)
    throws PersistenceException
  {
    throw new PersistenceException("Operation not supported by dummy persistence context.");
  }
View Full Code Here

   * @throws PersistenceException On error
   */
  public Iterator executeSelect(String sql, int maxResults)
    throws PersistenceException
  {
    throw new PersistenceException("Operation not supported by dummy persistence context.");
  }
View Full Code Here

      // Create the session factory from the configuration
      return configuration.buildSessionFactory();
    }
    catch (HibernateException he)
    {
      throw new PersistenceException("Hibernate configuration problem:", he);
    }
  }
View Full Code Here

        {
          Expression newExp = ExpressionFactory.matchExp(property, null);
          exp = conjugate(newExp, exp);
        }
        else if (PersistenceCriterion.OPERATOR_ALIAS.equals(operator))
          throw new PersistenceException("'alias' operation not supproted by Cayenne persistence criterion.");
      }

      Class beanClass = determineEntityClass(query.getObjectClass ());
      SelectQuery cq = new SelectQuery(beanClass, exp);
View Full Code Here

  }

  private void checkObject(final Object o)
  {
    if (! (o instanceof DataObject))
      throw new PersistenceException("Class '" + o.getClass().getName() + "' must implement the org.apache.cayenne.DataObject interface.");
  }
View Full Code Here

    {
      ret = cpc.getDataContext().newObject(beanClass);
    }
    catch (Exception e)
    {
      throw new PersistenceException("Error creating persistent object.", e.getCause());
    }

    if (ret instanceof CayenneObjectBase)
    {
      ((CayenneObjectBase) ret).onCreate(pc);
View Full Code Here

TOP

Related Classes of org.openbp.server.persistence.PersistenceException

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.