Package org.hibernate.search.bridge.util.impl

Examples of org.hibernate.search.bridge.util.impl.ContextualException2WayBridge


  public static Object[] getDocumentFields(SearchFactoryImplementor searchFactoryImplementor, Class<?> clazz, Document document, String[] fields) {
    DocumentBuilderIndexedEntity<?> builderIndexedEntity = getDocumentBuilder( searchFactoryImplementor, clazz );
    final int fieldNbr = fields.length;
    Object[] result = new Object[fieldNbr];
    ContextualException2WayBridge contextualBridge = new ContextualException2WayBridge();
    contextualBridge.setClass( clazz );
    if ( builderIndexedEntity.getIdKeywordName() != null ) {
      final XMember member = builderIndexedEntity.getIdGetter();
      if ( member != null ) {
        contextualBridge.pushMethod( member );
      }
      populateResult(
          builderIndexedEntity.getIdKeywordName(),
          builderIndexedEntity.getIdBridge(),
          Store.YES,
          fields,
          result,
          document,
          contextualBridge
      );
      if ( member != null ) {
        contextualBridge.popMethod();
      }
    }

    final AbstractDocumentBuilder.PropertiesMetadata metadata = builderIndexedEntity.getMetadata();
    processFieldsForProjection( metadata, fields, result, document, contextualBridge );
View Full Code Here


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

      queue.add( createUpdateWork( entityClass, entity, id, idInString, HibernateStatelessInitializer.INSTANCE ) );
    }
  }
 
  private String objectToString(TwoWayFieldBridge bridge, String fieldName, Object value) {
    ContextualException2WayBridge contextualBridge = new ContextualException2WayBridge()
        .setClass( getBeanClass() )
        .setFieldBridge( bridge )
        .setFieldName( fieldName );
    return contextualBridge.objectToString( value );
  }
View Full Code Here

        .setFieldName( fieldName );
    return contextualBridge.objectToString( value );
  }

  private String objectToString(StringBridge bridge, String fieldName, Object value) {
    ContextualException2WayBridge contextualBridge = new ContextualException2WayBridge()
        .setClass( getBeanClass() )
        .setStringBridge( bridge )
        .setFieldName( fieldName );
    return contextualBridge.objectToString( value );
  }
View Full Code Here

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

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

      queue.add( createUpdateWork( entityClass, entity, id, idInString, this.instanceInitalizer ) );
    }
  }
 
  private String objectToString(TwoWayFieldBridge bridge, String fieldName, Object value) {
    ContextualException2WayBridge contextualBridge = new ContextualException2WayBridge()
        .setClass( getBeanClass() )
        .setFieldBridge( bridge )
        .setFieldName( fieldName );
    return contextualBridge.objectToString( value );
  }
View Full Code Here

        .setFieldName( fieldName );
    return contextualBridge.objectToString( value );
  }

  private String objectToString(StringBridge bridge, String fieldName, Object value) {
    ContextualException2WayBridge contextualBridge = new ContextualException2WayBridge()
        .setClass( getBeanClass() )
        .setStringBridge( bridge )
        .setFieldName( fieldName );
    return contextualBridge.objectToString( value );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.search.bridge.util.impl.ContextualException2WayBridge

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.