Package org.hibernate.search.annotations

Examples of org.hibernate.search.annotations.ProvidedId


    }
    return idAnnotation;
  }

  private ProvidedId findProvidedId(XClass clazz, ReflectionManager reflectionManager) {
    ProvidedId id = null;
    XClass currentClass = clazz;
    while ( id == null && ( !reflectionManager.equals( currentClass, Object.class ) ) ) {
      id = currentClass.getAnnotation( ProvidedId.class );
      currentClass = clazz.getSuperclass();
    }
View Full Code Here


  private PropertyMetadata providedIdMetadata(XClass clazz, ConfigContext context, ReflectionManager reflectionManager) {
    PropertyMetadata propertyMetadata = null;

    FieldBridge providedIdFieldBridge = null;
    String providedIdFieldName = null;
    ProvidedId provided = findProvidedId( clazz, reflectionManager );
    if ( provided != null ) {
      providedIdFieldBridge = BridgeFactory.extractTwoWayType( provided.bridge(), clazz, reflectionManager );
      providedIdFieldName = provided.name();
      idProvided = true;
    }
    else if ( context.isProvidedIdImplicit() ) {
      providedIdFieldBridge = new TwoWayString2FieldBridgeAdaptor( org.hibernate.search.bridge.builtin.StringBridge.INSTANCE );
      providedIdFieldName = ProvidedId.defaultFieldName;
View Full Code Here

  public FieldCacheCollectorFactory getIdFieldCacheCollectionFactory() {
    return idFieldCacheCollectorFactory;
  }

  private ProvidedId findProvidedId(XClass clazz, ReflectionManager reflectionManager) {
    ProvidedId id = null;
    XClass currentClass = clazz;
    while ( id == null && ( !reflectionManager.equals( currentClass, Object.class ) ) ) {
      id = currentClass.getAnnotation( ProvidedId.class );
      currentClass = currentClass.getSuperclass();
    }
View Full Code Here

   */
  public DocumentBuilderIndexedEntity(XClass clazz, ConfigContext context, Similarity similarity,
      ReflectionManager reflectionManager, Set<XClass> optimizationBlackList, InstanceInitializer instanceInitializer) {
    super( clazz, context, similarity, reflectionManager, optimizationBlackList, instanceInitializer );
    // special case @ProvidedId
    ProvidedId provided = findProvidedId( clazz, reflectionManager );
    if ( provided != null ) {
      idBridge = BridgeFactory.extractTwoWayType( provided.bridge(), clazz, reflectionManager );
      idKeywordName = provided.name();
      idProvided = true;
    }
    else if ( context.isProvidedIdImplicit() ) {
      idBridge =  new TwoWayString2FieldBridgeAdaptor( org.hibernate.search.bridge.builtin.StringBridge.INSTANCE );
      idKeywordName = ProvidedId.defaultFieldName;
View Full Code Here

    }
    return idAnnotation;
  }

  private ProvidedId findProvidedId(XClass clazz, ReflectionManager reflectionManager) {
    ProvidedId id = null;
    XClass currentClass = clazz;
    while ( id == null && ( !reflectionManager.equals( currentClass, Object.class ) ) ) {
      id = currentClass.getAnnotation( ProvidedId.class );
      currentClass = currentClass.getSuperclass();
    }
View Full Code Here

      boolean disableOptimizationsArg,
      PathsContext pathsContext) {
    List<XClass> hierarchy = ReflectionHelper.createXClassHierarchy( parseContext.getCurrentClass() );

    // Iterate the class hierarchy top down. This allows to override the default analyzer for the properties if the class holds one
    ProvidedId explicitProvidedIdAnnotation = null;
    XClass providedIdHostingClass = null;
    for ( XClass currentClass : hierarchy ) {
      if ( currentClass.getAnnotation( ProvidedId.class ) != null ) {
        explicitProvidedIdAnnotation = currentClass.getAnnotation( ProvidedId.class );
        providedIdHostingClass = currentClass;
View Full Code Here

   */
  public DocumentBuilderIndexedEntity(XClass clazz, TypeMetadata typeMetadata, ConfigContext context,
      ReflectionManager reflectionManager, Set<XClass> optimizationBlackList, InstanceInitializer instanceInitializer) {
    super( clazz, typeMetadata, reflectionManager, optimizationBlackList, instanceInitializer );

    ProvidedId providedIdAnnotation = findProvidedId( clazz, reflectionManager );
    if ( providedIdAnnotation != null || context.isProvidedIdImplicit() ) {
      idProvided = true;
    }

    if ( idPropertyMetadata == null ) {
View Full Code Here

  public FieldCacheCollectorFactory getIdFieldCacheCollectionFactory() {
    return idFieldCacheCollectorFactory;
  }

  private ProvidedId findProvidedId(XClass clazz, ReflectionManager reflectionManager) {
    ProvidedId id = null;
    XClass currentClass = clazz;
    while ( id == null && ( !reflectionManager.equals( currentClass, Object.class ) ) ) {
      id = currentClass.getAnnotation( ProvidedId.class );
      currentClass = currentClass.getSuperclass();
    }
View Full Code Here

    this.shardingStrategy = shardingStrategy;
  }

  protected void initSubClass(XClass clazz, ConfigContext context) {
    // special case @ProvidedId
    ProvidedId provided = findProvidedId( clazz, reflectionManager );
    if ( provided != null ) {
      idBridge = BridgeFactory.extractTwoWayType( provided.bridge() );
      idKeywordName = provided.name();
    }

    if ( idKeywordName == null ) {
      throw new SearchException( "No document id in: " + clazz.getName() );
    }
View Full Code Here

    }
    return idAnnotation;
  }

  private ProvidedId findProvidedId(XClass clazz, ReflectionManager reflectionManager) {
    ProvidedId id = null;
    XClass currentClass = clazz;
    while ( id == null && ( !reflectionManager.equals( currentClass, Object.class ) ) ) {
      id = currentClass.getAnnotation( ProvidedId.class );
      currentClass = currentClass.getSuperclass();
    }
View Full Code Here

TOP

Related Classes of org.hibernate.search.annotations.ProvidedId

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.