Package org.hibernate.search.engine.spi

Examples of org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity


      // Create all DocumentBuilderIndexedEntity
      // FIXME DocumentBuilderIndexedEntity needs to be built by a helper method receiving Class<T> to infer T properly
      // XClass unfortunately is not (yet) genericized: TODO ?
      final DocumentBuilderIndexedEntity<?> documentBuilder =
          new DocumentBuilderIndexedEntity(
              mappedXClass,
              context,
              cfg.getReflectionManager(),
              optimizationBlackListedTypes,
              cfg.getInstanceInitializer()
View Full Code Here


      // it might be possible to receive not-indexes subclasses of the currently indexed type;
      // being not-indexed, we skip them.
      // FIXME for improved performance: avoid loading them in an early phase.
      return;
    }
    DocumentBuilderIndexedEntity docBuilder = entityIndexBinding.getDocumentBuilder();
    TwoWayFieldBridge idBridge = docBuilder.getIdBridge();
    ContextualException2WayBridge contextualBridge = new ContextualException2WayBridge()
        .setClass(clazz)
        .setFieldName(docBuilder.getIdKeywordName())
        .setFieldBridge(idBridge);
    String idInString = contextualBridge.objectToString( id );
    //depending on the complexity of the object graph going to be indexed it's possible
    //that we hit the database several times during work construction.
    AddLuceneWork addWork = docBuilder.createAddWork( clazz, entity, id, idInString, sessionInitializer );
    backend.enqueueAsyncWork( addWork );
  }
View Full Code Here

      }
      // Create all DocumentBuilderIndexedEntity
      //FIXME DocumentBuilderIndexedEntity needs to be built by a helper method receiving Class<T> to infer T properly
      //XClass unfortunately is not (yet) genericized: TODO?
      final DocumentBuilderIndexedEntity<?> documentBuilder =
          new DocumentBuilderIndexedEntity(
              mappedXClass,
              context,
              mappedEntity.getSimilarity(),
              cfg.getReflectionManager(),
              optimizationBlackListedTypes,
View Full Code Here

      if (entityIndexBinding == null) {
         // it might be possible to receive not-indexes types
         return;
      }
      ConversionContext conversionContext = new ContextualExceptionBridgeHelper();
      DocumentBuilderIndexedEntity docBuilder = entityIndexBinding.getDocumentBuilder();
      final String idInString = keyTransformationHandler.keyToString(key);
      UpdateLuceneWork updateTask = docBuilder.createUpdateWork(
            clazz,
            value,
            idInString,
            idInString,
            SimpleInitializer.INSTANCE,
View Full Code Here

    InstanceInitializer instanceInitializer = objectInitializationContext.getSearchFactoryImplementor()
        .getInstanceInitializer();
    for ( Object o : queryResultList ) {
      Class<?> loadedType = instanceInitializer.getClass( o );
      Object unproxiedObject = instanceInitializer.unproxy( o );
      DocumentBuilderIndexedEntity documentBuilder = getDocumentBuilder(
          loadedType,
          objectInitializationContext.getSearchFactoryImplementor()
      );
      if ( documentBuilder == null ) {
        // the query result can contain entities which are not indexed. This can for example happen if
        // the targeted entity type is a superclass with indexed and un-indexed sub classes
        // entities which don't have an document builder can be ignores (HF)
        continue;
      }
      XMember idProperty = documentBuilder.getIdGetter();
      Object id = ReflectionHelper.getMemberValue( unproxiedObject, idProperty );
      EntityInfoLoadKey key = new EntityInfoLoadKey( loadedType, id );
      Object previousValue = idToObjectMap.put( key, unproxiedObject );
      if ( previousValue == null ) {
        throw new AssertionFailure( "An entity got loaded even though it was not part of the EntityInfo list" );
View Full Code Here

  private void buildUpCriteria(EntityInfo[] entityInfos,
      Criteria criteria,
      int maxResults,
      ObjectInitializationContext objectInitializationContext) {
    DocumentBuilderIndexedEntity documentBuilder = getDocumentBuilder(
        objectInitializationContext.getEntityType(),
        objectInitializationContext.getSearchFactoryImplementor()
    );
    String idName = documentBuilder.getIdentifierName();
    Disjunction disjunction = Restrictions.disjunction();

    int loop = maxResults / MAX_IN_CLAUSE;
    boolean exact = maxResults % MAX_IN_CLAUSE == 0;
    if ( !exact ) {
View Full Code Here

      // it might be possible to receive not-indexes subclasses of the currently indexed type;
      // being not-indexed, we skip them.
      // FIXME for improved performance: avoid loading them in an early phase.
      return;
    }
    DocumentBuilderIndexedEntity docBuilder = entityIndexBinding.getDocumentBuilder();
    TwoWayFieldBridge idBridge = docBuilder.getIdBridge();
    ContextualException2WayBridge contextualBridge = new ContextualException2WayBridge()
        .setClass(clazz)
        .setFieldName(docBuilder.getIdKeywordName())
        .setFieldBridge(idBridge);
    String idInString = contextualBridge.objectToString( id );
    //depending on the complexity of the object graph going to be indexed it's possible
    //that we hit the database several times during work construction.
    AddLuceneWork addWork = docBuilder.createAddWork( clazz, entity, id, idInString, sessionInitializer );
    backend.enqueueAsyncWork( addWork );
  }
View Full Code Here

   
      // Create all DocumentBuilderIndexedEntity
      //FIXME DocumentBuilderIndexedEntity needs to be built by a helper method receiving Class<T> to infer T properly
      //XClass unfortunately is not (yet) genericized: TODO?
      final DocumentBuilderIndexedEntity<?> documentBuilder =
          new DocumentBuilderIndexedEntity(
              mappedXClass,
              context,
              mappedEntity.getSimilarity(),
              reflectionManager,
              optimizationBlackListedTypes
View Full Code Here

      // it might be possible to receive not-indexes subclasses of the currently indexed type;
      // being not-indexed, we skip them.
      // FIXME for improved performance: avoid loading them in an early phase.
      return;
    }
    DocumentBuilderIndexedEntity docBuilder = entityIndexBinding.getDocumentBuilder();
    TwoWayFieldBridge idBridge = docBuilder.getIdBridge();
    ContextualException2WayBridge contextualBridge = new ContextualException2WayBridge()
        .setClass(clazz)
        .setFieldName(docBuilder.getIdKeywordName())
        .setFieldBridge(idBridge);
    String idInString = contextualBridge.objectToString( id );
    //depending on the complexity of the object graph going to be indexed it's possible
    //that we hit the database several times during work construction.
    AddLuceneWork addWork = docBuilder.createAddWork( clazz, entity, id, idInString, sessionInitializer );
    backend.enqueueAsyncWork( addWork );
  }
View Full Code Here

      }
      // Create all DocumentBuilderIndexedEntity
      //FIXME DocumentBuilderIndexedEntity needs to be built by a helper method receiving Class<T> to infer T properly
      //XClass unfortunately is not (yet) genericized: TODO?
      final DocumentBuilderIndexedEntity<?> documentBuilder =
          new DocumentBuilderIndexedEntity(
              mappedXClass,
              context,
              mappedEntity.getSimilarity(),
              cfg.getReflectionManager(),
              optimizationBlackListedTypes,
View Full Code Here

TOP

Related Classes of org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity

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.