Package org.hibernate

Examples of org.hibernate.AssertionFailure


  public int getSubclassTableSpan() {
    return 1;
  }

  protected boolean isClassOrSuperclassTable(int j) {
    if (j!=0) throw new AssertionFailure("only one table");
    return true;
  }
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

    if ( persister.canExtractIdOutOfEntity() ) {

      Serializable oid = persister.getIdentifier( object, entityMode );
      if (id==null) {
        throw new AssertionFailure("null id in " + persister.getEntityName() + " entry (don't flush the Session after an exception occurs)");
      }
      if ( !persister.getIdentifierType().isEqual(id, oid, entityMode) ) {
        throw new HibernateException(
            "identifier of an instance of " +
            persister.getEntityName() +
View Full Code Here

    // if it was dirtied by a collection only
    int[] dirtyProperties = event.getDirtyProperties();
    if ( event.isDirtyCheckPossible() && dirtyProperties == null ) {
      if ( ! intercepted && !event.hasDirtyCollection() ) {
        throw new AssertionFailure( "dirty, but no dirty properties" );
      }
      dirtyProperties = ArrayHelper.EMPTY_INT_ARRAY;
    }

    // check nullability but do not perform command execute
View Full Code Here

    catch (NamingException ne) {
      log.error("Could not find UserTransaction in JNDI", ne);
      throw new TransactionException("Could not find UserTransaction in JNDI: ", ne);
    }
    if (ut==null) {
      throw new AssertionFailure("A naming service lookup returned null");
    }

    log.debug("Obtained UserTransaction");
  }
View Full Code Here

   * Write the element to a JDBC <tt>PreparedStatement</tt>
   */
  protected int writeElementToWhere(PreparedStatement st, Object elt, int i, SessionImplementor session)
      throws HibernateException, SQLException {
    if (elementIsPureFormula) {
      throw new AssertionFailure("cannot use a formula-based element in the where condition");
    }
    getElementType().nullSafeSet(st, elt, i, elementColumnIsInPrimaryKey, session);
    return i + elementColumnAliases.length;

  }
View Full Code Here

   * Write the index to a JDBC <tt>PreparedStatement</tt>
   */
  protected int writeIndexToWhere(PreparedStatement st, Object index, int i, SessionImplementor session)
      throws HibernateException, SQLException {
    if (indexContainsFormula) {
      throw new AssertionFailure("cannot use a formula-based index in the where condition");
    }
    getIndexType().nullSafeSet( st, incrementIndexByBase(index), i, session );
    return i + indexColumnAliases.length;
  }
View Full Code Here

    return getRole();
  }

  public EntityPersister getElementPersister() {
    if ( elementPersister == null ) {
      throw new AssertionFailure( "not an association" );
    }
    return ( Loadable ) elementPersister;
  }
View Full Code Here

                                      : pc.getCustomSQLDeleteCheckStyle();
      jk--;
      pc = pc.getSuperclass();
    }
    if ( jk != -1 ) {
      throw new AssertionFailure( "Tablespan does not match height of joined-subclass hiearchy." );
    }

    // PROPERTIES

    int hydrateSpan = getPropertySpan();
View Full Code Here

    for ( int j=0; j<tables.length; j++ ) {
      if ( tableName.equals( tables[j] ) ) {
        return j;
      }
    }
    throw new AssertionFailure("Table " + tableName + " not found");
  }
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.