Package org.hibernate

Examples of org.hibernate.AssertionFailure


    log.trace( "updating detached instance" );


    if ( event.getSession().getPersistenceContext().isEntryFor( event.getEntity() ) ) {
      //TODO: assertion only, could be optimized away
      throw new AssertionFailure( "entity was persistent" );
    }

    Object entity = event.getEntity();

    EntityPersister persister = event.getSession().getEntityPersister( event.getEntityName(), entity );
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

      case INNER:
        return JoinFragment.INNER_JOIN;
      case RIGHT_OUTER:
        return JoinFragment.RIGHT_OUTER_JOIN;
      default:
        throw new AssertionFailure( "undefined join type " + astJoinType );
    }
  }
View Full Code Here

    return buf.append(" )").toString();
  }

  protected String[] getSubclassTableKeyColumns(int j) {
    if (j!=0) throw new AssertionFailure("only one table");
    return getIdentifierColumnNames();
  }
View Full Code Here

    if (j!=0) throw new AssertionFailure("only one table");
    return getIdentifierColumnNames();
  }

  public String getSubclassTableName(int j) {
    if (j!=0) throw new AssertionFailure("only one table");
    return tableName;
  }
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.