Package org.hibernate

Examples of org.hibernate.HibernateException


    }

    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

    identityColumnAwareGridDialect.insertTuple( entityKeyMetadata, tuple, getTupleContext() );
    Serializable id = (Serializable) getGridIdentifierType().hydrate( tuple, getIdentifierColumnNames(), session, object );
    addToInverseAssociations( tuple, 0, id, session );

    if ( id == null ) {
      throw new HibernateException( "Dialect failed to generate id for entity type " + entityKeyMetadata );
    }

    OgmEntityEntryState.getStateFor( session, object ).setTuple( tuple );

    return id;
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 EntityKey key = EntityKeyBuilder.fromPersister( this, id, session );
    Object[] loadedState = getLoadedState( id, session );
    Tuple currentState = null;
View Full Code Here

  public UUID fromStringValue(String string) throws HibernateException {
    try {
      return UUID.fromString( string );
    }
    catch ( NumberFormatException e ) {
      throw new HibernateException( "Unable to rebuild BigInteger from String", e );
    }
  }
View Full Code Here

          // log.debug("classic factory");
          sessionFactory = cfg.buildSessionFactory();
        }
      } catch (Exception a_th) {
        // log.error(a_th);
        throw new HibernateException("Could not initialize the Hibernate configuration : " + a_th.getMessage(), a_th);
      }
    }
  }
View Full Code Here

          }
        }
        catch ( Exception e ) {
          final String msg = "Unable to instantiate ClassBridge of type " + impl.getName() + " defined on "
              + clazz.getName();
          throw new HibernateException( msg, e );
        }
      }
    }
    if ( bridge == null ) {
      throw new SearchException( "Unable to guess FieldBridge for " + ClassBridge.class.getName() );
View Full Code Here

      IndexWriter.MaxFieldLength fieldLength = new IndexWriter.MaxFieldLength( IndexWriter.DEFAULT_MAX_FIELD_LENGTH );
      IndexWriter iw = new IndexWriter( directory, new SimpleAnalyzer(), true, fieldLength );
      iw.close();
    }
    catch (IOException e) {
      throw new HibernateException( "Unable to initialize index: " + indexName, e );
    }
  }
View Full Code Here

      if ( candidate instanceof FullTextIndexEventListener ) {
        listener = (FullTextIndexEventListener) candidate;
        break;
      }
    }
    if ( listener == null ) throw new HibernateException(
        "Hibernate Search Event listeners not configured, please check the reference documentation and the " +
            "application's hibernate.cfg.xml" );
    return listener.getSearchFactoryImplementor();
  }
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.