Package org.hibernate.annotations.common

Examples of org.hibernate.annotations.common.AssertionFailure


          for (DirectoryProvider provider : providers) {
            queueWithFlatDPs.add( new LuceneWorker.WorkWithPayload(work, provider) );
          }
        }
        else {
          throw new AssertionFailure( "Unknown work type: " + work.getClass() );
        }
      }
      deadlockFreeQueue(queueWithFlatDPs, searchFactoryImplementor);
      checkForBatchIndexing(workspace);   
      for ( LuceneWorker.WorkWithPayload luceneWork : queueWithFlatDPs ) {
View Full Code Here


        throw new SearchException( "Incompatible version of Lucene: MultiReader.subReaders not accessible", e );
      }
      if ( trace ) log.trace( "Closing MultiReader: " + reader );
    }
    else {
      throw new AssertionFailure( "Everything should be wrapped in a MultiReader" );
    }

    for (IndexReader subReader : readers) {
      ReaderData readerData;
      //TODO can we avoid that lock?
View Full Code Here

public class NotShardedStrategy implements IndexShardingStrategy {
  private DirectoryProvider[] directoryProvider;
  public void initialize(Properties properties, DirectoryProvider[] providers) {
    this.directoryProvider = providers;
    if ( directoryProvider.length > 1) {
      throw new AssertionFailure("Using SingleDirectoryProviderSelectionStrategy with multiple DirectryProviders");
    }
  }
View Full Code Here

          //too bad we have to reparse to validate again :(
          saxReader.read( new StringReader( doc.asXML() ) );
        }
        catch ( DocumentException e ) {
          //oops asXML fails even if the core doc parses initially
          throw new AssertionFailure("Error in DOM4J leads to a bug in Hibernate", e);
        }

      }
      if ( errors.size() != 0 ) {
        //report errors in exception
View Full Code Here

  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

      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

    }
  }

  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

  /**
   * 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

          .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

  /**
   * 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

TOP

Related Classes of org.hibernate.annotations.common.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.