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

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


  private void index(Session session, Object entity) {
    try {
      final InstanceInitializer sessionInitializer = new HibernateSessionLoadingInitializer(
          (SessionImplementor) session );
      final ConversionContext contextualBridge = new ContextualExceptionBridgeHelper();

      // trick to attach the objects to session:
      session.buildLockRequest( LockOptions.NONE ).lock( entity );
      index( entity, session, sessionInitializer, contextualBridge );
      monitor.documentsBuilt( 1 );
View Full Code Here


    return fieldCacheUsage;
  }

  @Deprecated //with no replacement: too expensive to create the conversionContext each time this was needed
  public Term getTerm(Serializable id) {
    final ConversionContext conversionContext = new ContextualExceptionBridgeHelper();
    return new Term( idKeywordName, objectToString( idBridge, idKeywordName, id, conversionContext ) );
  }
View Full Code Here

  private void index(Session session, Object entity) {
    try {
      final InstanceInitializer sessionInitializer = new HibernateSessionLoadingInitializer(
          (SessionImplementor) session );
      final ConversionContext contextualBridge = new ContextualExceptionBridgeHelper();

      // trick to attach the objects to session:
      session.buildLockRequest( LockOptions.NONE ).lock( entity );
      index( entity, session, sessionInitializer, contextualBridge );
      monitor.documentsBuilt( 1 );
View Full Code Here

    session.clear();
  }

  private void indexAllQueue(Session session, List<?> entities, InstanceInitializer sessionInitializer) {
    try {
      ConversionContext contextualBridge = new ContextualExceptionBridgeHelper();
        if ( entities == null && entities.isEmpty() ) {
          return;
        }
        else {
          log.tracef( "received a list of objects to index: %s", entities );
View Full Code Here

public class JavaSerializationDeserializer implements Deserializer {

  @Override
  public void deserialize(byte[] data, LuceneWorksBuilder hydrator) {
    Message message = SerializationHelper.toInstance( data, Message.class );
    final ConversionContext conversionContext = new ContextualExceptionBridgeHelper();
    for ( Operation operation : message.getOperations() ) {
      if ( operation instanceof OptimizeAll ) {
        hydrator.addOptimizeAll();
      }
      else if ( operation instanceof PurgeAll ) {
View Full Code Here

    session.clear();
  }

  private void indexAllQueue(Session session, List<?> entities, InstanceInitializer sessionInitializer) {
    try {
      ConversionContext contextualBridge = new ContextualExceptionBridgeHelper();
        if ( entities == null || entities.isEmpty() ) {
          return;
        }
        else {
          log.tracef( "received a list of objects to index: %s", entities );
View Full Code Here

      }
    }
    byte[] newData = new byte[data.length - 2];
    System.arraycopy( data, 2, newData, 0, newData.length );
    Message message = SerializationHelper.toInstance( newData, Message.class );
    final ConversionContext conversionContext = new ContextualExceptionBridgeHelper();
    for ( Operation operation : message.getOperations() ) {
      if ( operation instanceof OptimizeAll ) {
        hydrator.addOptimizeAll();
      }
      else if ( operation instanceof PurgeAll ) {
View Full Code Here

      throw log.unableToDeserializeAvroStream( e );
    }

    classReferences = asListOfString( result, "classReferences" );
    final List<GenericRecord> operations = asListOfGenericRecords( result, "operations" );
    final ConversionContext conversionContext = new ContextualExceptionBridgeHelper();
    for ( GenericRecord operation : operations ) {
      String schema = operation.getSchema().getName();
      if ( "OptimizeAll".equals( schema ) ) {
        hydrator.addOptimizeAll();
      }
View Full Code Here

          range.isMinIncluded(),
          range.isMaxIncluded()
      );
    }
    else if ( minOrMax instanceof Date ) {
      final ConversionContext conversionContext = new ContextualExceptionBridgeHelper();
      return createRangeQuery(
          documentBuilder.objectToString( getFieldName(), range.getMin(), conversionContext ),
          documentBuilder.objectToString( getFieldName(), range.getMax(), conversionContext ),
          range.isMinIncluded(),
          range.isMaxIncluded()
View Full Code Here

  }

  @Override
  public Query createQuery() {
    final int size = fieldContexts.size();
    final ConversionContext conversionContext = new ContextualExceptionBridgeHelper();
    if ( size == 1 ) {
      return queryCustomizer.setWrappedQuery( createQuery( fieldContexts.get( 0 ), conversionContext ) ).createQuery();
    }
    else {
      BooleanQuery aggregatedFieldsQuery = new BooleanQuery( );
View Full Code Here

TOP

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

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.