Package org.hibernate

Examples of org.hibernate.HibernateException


              searcher, 1
          ).topDocs; // Lucene enforces that at least one top doc will be retrieved.
          resultSize = hits.totalHits;
        }
        catch ( IOException e ) {
          throw new HibernateException( "Unable to query Lucene index", e );
        }
        finally {
          //searcher cannot be null
          try {
            closeSearcher( searcher.getSearcher(), searchFactoryImplementor.getReaderProvider() );
View Full Code Here


      sender.send( message );

      session.close();
    }
    catch (JMSException e) {
      throw new HibernateException( "Unable to send Search work to JMS queue: " + factory.getJmsQueueName(), e );
    }
    finally {
      try {
        if (cnn != null)
          cnn.close();
View Full Code Here

    final Serializable id = session.getContextEntityIdentifier( entity );

    final EntityEntry entry = session.getPersistenceContext().getEntry( entity );
    if ( entry == null ) {
      throw new HibernateException( "entity is not associated with the session: " + id );
    }

    if ( log.isTraceEnabled() ) {
      log.trace(
          "initializing lazy properties of: " +
View Full Code Here

    }

    if ( isVersionPropertyGenerated() ) {
      // the difficulty here is exactly what do we update in order to
      // force the version to be incremented in the db...
      throw new HibernateException( "LockMode.FORCE is currently not supported for generated version properties" );
    }

    Object nextVersion = getVersionType().next( currentVersion, session );
    if ( log.isTraceEnabled() ) {
      log.trace(
View Full Code Here

      final Object[] fields,
      final boolean[] notNull,
      String sql,
      final Object object,
      final SessionImplementor session) throws HibernateException {
    throw new HibernateException( "Cannot use a database generator with OGM" );
  }
View Full Code Here

  }

  @Override
  public Serializable insert(Object[] fields, Object object, SessionImplementor session)
      throws HibernateException {
    throw new HibernateException( "Identifier values generated by the database are not supported in Hibernate OGM" );
  }
View Full Code Here

      final EntityKey key = EntityKeyBuilder.fromPersister( this, id, session );
      Tuple resultset = gridDialect.getTuple( key, this.getTupleContext() );
      // add the discriminator
      if ( j == 0 ) {
        if (resultset != null) {
          throw new HibernateException( "trying to insert an already existing entity: "
              +  MessageHelper.infoString( this, id, getFactory() ) );
        }

        if ( discriminator.isNeeded() ) {
          resultset = createNewResultSetIfNull( key, resultset, id, session );
View Full Code Here

  @Override
  public void delete(Serializable id, Object version, Object object, SessionImplementor session)
      throws HibernateException {
    final int span = getTableSpan();
    if ( span > 1 ) {
      throw new HibernateException( "Hibernate OGM does not yet support entities spanning multiple tables");
    }
    final EntityMetamodel entityMetamodel = getEntityMetamodel();
    boolean isImpliedOptimisticLocking = !entityMetamodel.isVersioned() && isAllOrDirtyOptLocking();
    Object[] loadedState = null;
    if ( isImpliedOptimisticLocking ) {
View Full Code Here

      case Types.CHAR:
      case Types.LONGVARCHAR:
      case Types.VARCHAR:
        return false;
      default:
        throw new HibernateException( "Unable to persist an Enum in a column of SQL Type: " + paramType );
    }
  }
View Full Code Here

      public IntegralDataTypeHolder execute(Connection connection) throws SQLException {
        try {
          return doWorkInCurrentTransactionIfAny( localSession );
        }
        catch ( RuntimeException sqle ) {
          throw new HibernateException( "Could not get or update next value", sqle );
        }
      }
    }
    //we want to work out of transaction
    boolean workInTransaction = false;
View Full Code Here

TOP

Related Classes of org.hibernate.HibernateException

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.