Package org.hibernate.annotations.common

Examples of org.hibernate.annotations.common.AssertionFailure


          buildDocumentFields(
              value, doc, embeddedMetadata, fieldToAnalyzerMap, processedFieldNames, contextualBridge
          );
          break;
        default:
          throw new AssertionFailure(
              "Unknown embedded container: "
                  + propertiesMetadata.embeddedContainers.get( i )
          );
      }
      contextualBridge.popMethod();
View Full Code Here


    return idGetter.getName();
  }

  public DirectoryProvider[] getDirectoryProviders() {
    if ( getEntityState() != EntityState.INDEXED ) {
      throw new AssertionFailure( "Contained in only entity: getDirectoryProvider should not have been called." );
    }
    return directoryProviders;
  }
View Full Code Here

    return directoryProviders;
  }

  public IndexShardingStrategy getDirectoryProviderSelectionStrategy() {
    if ( getEntityState() != EntityState.INDEXED ) {
      throw new AssertionFailure(
          "Contained in only entity: getDirectoryProviderSelectionStrategy should not have been called."
      );
    }
    return shardingStrategy;
  }
View Full Code Here

    return (Serializable) ReflectionHelper.getMemberValue( unproxiedEntity, idGetter );
  }
 
  public String objectToString(String fieldName, Object value) {
    if ( fieldName == null ) {
      throw new AssertionFailure( "Field name should not be null" );
    }
    if ( fieldName.equals( idKeywordName ) ) {
      return objectToString( idBridge, idKeywordName, value );
    }
    else {
View Full Code Here

      return entityInfo.projection;
    }
  }

  public Object loadWithoutTiming(EntityInfo entityInfo) {
    throw new AssertionFailure("This method is not meant to be used on ProjectionLoader");
  }
View Full Code Here

          bucket.add( entityInfo );
          found = true;
          break; //we stop looping for the right bucket
        }
      }
      if (!found) throw new AssertionFailure( "Could not find root entity for " + entityInfo.clazz );
    }

    //initialize objects by bucket
    for ( Map.Entry<RootEntityMetadata, List<EntityInfo>> entry : entityinfoBuckets.entrySet() ) {
      final RootEntityMetadata key = entry.getKey();
View Full Code Here

    private final Criteria criteria;

    RootEntityMetadata(Class<?> rootEntity, SearchFactoryImplementor searchFactoryImplementor, Session session) {
      this.rootEntity = rootEntity;
      DocumentBuilderIndexedEntity<?> provider = searchFactoryImplementor.getDocumentBuilderIndexedEntity( rootEntity );
      if ( provider == null) throw new AssertionFailure("Provider not found for class: " + rootEntity);
      this.mappedSubclasses = provider.getMappedSubclasses();
      this.criteria = session.createCriteria( rootEntity );
    }
View Full Code Here

   * @param reflectionManager Reflection manager to use for processing the annotations
   */
  public AbstractDocumentBuilder(XClass xClass, ConfigContext context, Similarity similarity, ReflectionManager reflectionManager) {

    if ( xClass == null ) {
      throw new AssertionFailure( "Unable to build a DocumentBuilderContainedEntity with a null class" );
    }

    this.entityState = EntityState.CONTAINED_IN_ONLY;
    this.beanXClass = xClass;
    this.reflectionManager = reflectionManager;
View Full Code Here

  public void postInitialize(Set<Class<?>> indexedClasses) {
    //we initialize only once because we no longer have a reference to the reflectionManager
    //in theory
    Class<?> plainClass = beanClass;
    if ( entityState == EntityState.NON_INDEXABLE ) {
      throw new AssertionFailure( "A non indexed entity is post processed" );
    }
    Set<Class<?>> tempMappedSubclasses = new HashSet<Class<?>>();
    //together with the caller this creates a o(2), but I think it's still faster than create the up hierarchy for each class
    for ( Class<?> currentClass : indexedClasses ) {
      if ( plainClass != currentClass && plainClass.isAssignableFrom( currentClass ) ) {
View Full Code Here

      case WITH_POSITIONS:
        return Field.TermVector.WITH_POSITIONS;
      case WITH_POSITION_OFFSETS:
        return Field.TermVector.WITH_POSITIONS_OFFSETS;
      default:
        throw new AssertionFailure( "Unexpected TermVector: " + vector );
    }
  }
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.