Package org.hibernate

Examples of org.hibernate.AssertionFailure


          EntityMode entityMode,
          SessionFactoryImplementor factory)
  throws HibernateException {

    if ( entry.isProcessed() ) {
      throw new AssertionFailure( "collection was processed twice by flush()" );
    }
    entry.setProcessed(true);

    final CollectionPersister loadedPersister = entry.getLoadedPersister();
    final CollectionPersister currentPersister = entry.getCurrentPersister();
View Full Code Here


    name = settings.getSessionFactoryName();
    try {
      uuid = (String) UUID_GENERATOR.generate(null, null);
    }
    catch (Exception e) {
      throw new AssertionFailure("Could not generate UUID");
    }
    SessionFactoryObjectFactory.addInstance(uuid, name, this, properties);

    log.debug("instantiated session factory");
View Full Code Here

      }
      else if ( copyEntry.getStatus() == Status.SAVING ) {
        transientCopyCache.put( entity, copy, copyCache.isOperatedOn( entity ) );
      }
      else if ( copyEntry.getStatus() != Status.MANAGED && copyEntry.getStatus() != Status.READ_ONLY ) {
        throw new AssertionFailure( "Merged entity does not have status set to MANAGED or READ_ONLY; "+copy+" status="+copyEntry.getStatus() );
      }
    }
    return transientCopyCache;
  }
View Full Code Here

    else {
      ( ( EventCache ) copyCache ).put( entity, result, true ); //before cascade!
 
      final Object target = source.getPersistenceContext().unproxy(result);
      if ( target == entity ) {
        throw new AssertionFailure("entity was not detached");
      }
      else if ( !source.getEntityName(target).equals(entityName) ) {
        throw new WrongClassException(
            "class of the given object did not match class of persistent copy",
            event.getRequestedId(),
View Full Code Here

    return rootTableKeyColumnNames;
  }

  protected String[] getSQLUpdateByRowIdStrings() {
    if ( sqlUpdateByRowIdString == null ) {
      throw new AssertionFailure( "no update by row id" );
    }
    String[] result = new String[getTableSpan() + 1];
    result[0] = sqlUpdateByRowIdString;
    System.arraycopy( sqlUpdateStrings, 0, result, 1, getTableSpan() );
    return result;
View Full Code Here

    return result;
  }

  protected String[] getSQLLazyUpdateByRowIdStrings() {
    if ( sqlLazyUpdateByRowIdString == null ) {
      throw new AssertionFailure( "no update by row id" );
    }
    String[] result = new String[getTableSpan()];
    result[0] = sqlLazyUpdateByRowIdString;
//    for ( int i = 1; i < getTableSpan(); i++ ) {
//      result[i] = sqlLazyUpdateStrings[i];
View Full Code Here

      final SessionImplementor session,
      final Serializable id,
      final EntityEntry entry) {

    if ( !hasLazyProperties() ) {
      throw new AssertionFailure("no lazy properties");
    }

    log.trace("initializing lazy properties from datastore");

    try {
View Full Code Here

        .toStatementString();
  }

  public Object forceVersionIncrement(Serializable id, Object currentVersion, SessionImplementor session) {
    if ( !isVersioned() ) {
      throw new AssertionFailure( "cannot force version increment on non-versioned entity" );
    }

    if ( isVersionPropertyGenerated() ) {
      // the difficulty here is exactly what do we update in order to
      // force the version to be incremented in the db...
View Full Code Here

    return getTuplizer( session.getEntityMode() ).getPropertyValuesToInsert( object, mergeMap, session );
  }

  public void processInsertGeneratedProperties(Serializable id, Object entity, Object[] state, SessionImplementor session) {
    if ( !hasInsertGeneratedProperties() ) {
      throw new AssertionFailure("no insert-generated properties");
    }
    processGeneratedProperties( id, entity, state, session, sqlInsertGeneratedValuesSelectString, getPropertyInsertGenerationInclusions() );
  }
View Full Code Here

    processGeneratedProperties( id, entity, state, session, sqlInsertGeneratedValuesSelectString, getPropertyInsertGenerationInclusions() );
  }

  public void processUpdateGeneratedProperties(Serializable id, Object entity, Object[] state, SessionImplementor session) {
    if ( !hasUpdateGeneratedProperties() ) {
      throw new AssertionFailure("no update-generated properties");
    }
    processGeneratedProperties( id, entity, state, session, sqlUpdateGeneratedValuesSelectString, getPropertyUpdateGenerationInclusions() );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.AssertionFailure

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.