Examples of AssertionFailure


Examples of org.hibernate.annotations.common.AssertionFailure

  private final EntityKey entityKey;

  public AssociationKey(AssociationKeyMetadata metadata, Object[] columnValues, EntityKey entityKey) {
    this.metadata = metadata;
    if ( metadata.getColumnNames().length != columnValues.length ) {
      throw new AssertionFailure( "Column names do not match column values" );
    }
    this.columnValues = columnValues;
    this.entityKey = entityKey;

    this.hashCode = metadata.hashCode() * 31 + Arrays.hashCode( columnValues );
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

      if ( name.equals( columnName ) ) {
        return getColumnValues()[i];
      }
    }

    throw new AssertionFailure(
        String.format( "Given column %s is not part of this key: %s", columnName, this.toString() )
    );
  }
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

    }
  }

  private DBObject associationKeyToObject(AssociationKey key, AssociationStorageStrategy storageStrategy) {
    if ( storageStrategy == AssociationStorageStrategy.IN_ENTITY ) {
      throw new AssertionFailure( MongoHelpers.class.getName()
          + ".associationKeyToObject should not be called for associations embedded in entity documents");
    }
    Object[] columnValues = key.getColumnValues();
    DBObject columns = new BasicDBObject( columnValues.length );
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

  /**
   * Load a collection
   */
  public OgmLoader(OgmCollectionPersister[] collectionPersisters) {
    if ( collectionPersisters == null || collectionPersisters.length == 0 ) {
      throw new AssertionFailure( "CollectionPersister[] must not be null or empty" );
    }
    this.entityPersisters = new OgmEntityPersister[] {};
    this.collectionPersisters = collectionPersisters;
    this.factory = collectionPersisters[0].getFactory();
    this.gridDialect = this.factory.getServiceRegistry().getService( GridDialect.class );
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

          .getIdentifierOrUniqueKeyType( factory );
      gridTypeOfAssociatedId = typeTranslator.getType( identifierOrUniqueKeyType );
    }
    else if ( collection.isOneToMany() ) {
      // one to many but not what we expected
      throw new AssertionFailure( "Association marked as one to many but has no ManyToOneType: " + collection.getRole() );
    }
    else if ( getElementType().isAssociationType() && getElementType().isEntityType() ) {
      associationType = AssociationType.ASSOCIATION_TABLE_TO_ENTITY;
      final Type identifierOrUniqueKeyType = ( (EntityType) getElementType() ).getIdentifierOrUniqueKeyType( factory );
      gridTypeOfAssociatedId = typeTranslator.getType( identifierOrUniqueKeyType );
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

  /**
   * Load an entity
   */
  public OgmLoader(OgmEntityPersister[] entityPersisters) {
    if ( entityPersisters == null || entityPersisters.length == 0 ) {
      throw new AssertionFailure( "EntityPersister[] must not be null or empty" );
    }
    this.entityPersisters = entityPersisters;
    this.collectionPersisters = new OgmCollectionPersister[] {};
    this.factory = entityPersisters[0].getFactory();
    this.gridDialect = this.factory.getServiceRegistry().getService( GridDialect.class );
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

      }
    }
    else {
      //collection persister
      if ( getCollectionPersisters().length != 1 ) {
        throw new AssertionFailure( "Found an unexpected number of collection persisters: " + getCollectionPersisters().length );
      }
      final OgmCollectionPersister persister = (OgmCollectionPersister) getCollectionPersisters()[0];
      Object owner = session.getPersistenceContext().getCollectionOwner( id, persister );

      AssociationPersister associationPersister = new AssociationPersister(
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

      if ( collection.needsUpdating( entry, i, elementType ) ) {
        // find the matching element
        RowKey assocEntryKey = getTupleKeyForUpdate( key, collection, session, i, entry, associationPersister );
        Tuple assocEntryTuple = associationPersister.getAssociation().get( assocEntryKey );
        if ( assocEntryTuple == null ) {
          throw new AssertionFailure( "Updating a collection tuple that is not present: " + "table {" + getTableName() + "} collectionKey {" + key + "} entry {" + entry + "}" );
        }
        // update the matching element
        // FIXME update the associated entity key data
        updateInverseSideOfAssociationNavigation( session, entry, assocEntryTuple, Action.REMOVE, assocEntryKey );
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

        indexGridType.nullSafeSet( tuple, incrementIndexByBase( index ), getIndexColumnNames(), session );
      }
      else {
        final Object snapshotElement = collection.getSnapshotElement( entry, i );
        if ( elementIsPureFormula ) {
          throw new AssertionFailure( "cannot use a formula-based element in the where condition" );
        }
        getElementGridType().nullSafeSet( tuple, snapshotElement, getElementColumnNames(), session );
      }
    }
    rowKeyBuilder.values( tuple );
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

        indexGridType.nullSafeSet( tuple, incrementIndexByBase( index ), getIndexColumnNames(), session );
      }
      else {
        final Object snapshotElement = entry;
        if ( elementIsPureFormula ) {
          throw new AssertionFailure( "cannot use a formula-based element in the where condition" );
        }
        getElementGridType().nullSafeSet( tuple, snapshotElement, getElementColumnNames(), session );
      }
    }
    rowKeyBuilder.values( tuple );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.