Package org.hibernate.annotations.common

Examples of org.hibernate.annotations.common.AssertionFailure


        Document doc = getDocument( entity, id );
        queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
        queue.add( new AddLuceneWork( id, idInString, entityClass, doc, true ) );
      }
      else {
        throw new AssertionFailure( "Unknown WorkType: " + workType );
      }
    }

    /**
     * When references are changed, either null or another one, we expect dirty checking to be triggered (both sides
View Full Code Here


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

    return new Term( idKeywordName, idBridge.objectToString( id ) );
  }

  public DirectoryProvider[] getDirectoryProviders() {
    if ( entityState != 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 ( entityState != EntityState.INDEXED ) {
      throw new AssertionFailure( "Contained in only entity: getDirectoryProviderSelectionStrategy should not have been called." );
    }
    return shardingStrategy;
  }
View Full Code Here

    return -1;
  }

  public void postInitialize(Set<Class<?>> indexedClasses) {
    if ( entityState == EntityState.NON_INDEXABLE )
      throw new AssertionFailure( "A non indexed entity is post processed" );
    //this method does not requires synchronization
    Class plainClass = reflectionManager.toClass( beanClass );
    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) {
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

    public final boolean useObjectLoader;

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

        Analyzer analyzer = AnnotationProcessingHelper.getAnalyzer( member.getAnnotation( org.hibernate.search.annotations.Analyzer.class ), context );
        if ( analyzer == null ) {
          analyzer = propertiesMetadata.analyzer;
        }
        if ( analyzer == null ) {
          throw new AssertionFailure( "Analyzer should not be undefined" );
        }
        addToScopedAnalyzer( fieldName, analyzer, index );
      }
    }
  }
View Full Code Here

                conversionContext,
                objectInitializer
            );
            break;
          default:
            throw new AssertionFailure(
                "Unknown embedded container: "
                    + propertiesMetadata.embeddedContainers.get( i )
            );
        }
      }
View Full Code Here

    return (Serializable) ReflectionHelper.getMemberValue( unproxiedEntity, idGetter );
  }
 
  public String objectToString(String fieldName, Object value, ConversionContext conversionContext) {
    if ( fieldName == null ) {
      throw new AssertionFailure( "Field name should not be null" );
    }
    if ( fieldName.equals( idKeywordName ) ) {
      return objectToString( idBridge, idKeywordName, value, conversionContext );
    }
    else {
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.