Package org.hibernate.search.backend

Examples of org.hibernate.search.backend.DeleteLuceneWork


    works.add( OptimizeLuceneWork.INSTANCE );
    works.add( OptimizeLuceneWork.INSTANCE );
    works.add( new OptimizeLuceneWork( RemoteEntity.class ) ); //class won't be send over
    works.add( new PurgeAllLuceneWork( RemoteEntity.class ) );
    works.add( new PurgeAllLuceneWork( RemoteEntity.class ) );
    works.add( new DeleteLuceneWork( 123l, "123", RemoteEntity.class ) );
    works.add( new DeleteLuceneWork( "Sissi", "Sissi", RemoteEntity.class ) );
    works.add(
        new DeleteLuceneWork(
            new URL( "http://emmanuelbernard.com" ),
            "http://emmanuelbernard.com",
            RemoteEntity.class
        )
    );
View Full Code Here


  @Override
  public void addWorkToQueue(Class<T> entityClass, T entity, Serializable id, boolean delete, boolean add, List<LuceneWork> queue, ConversionContext contextualBridge) {
    DocumentFieldMetadata idFieldMetadata = idPropertyMetadata.getFieldMetadata( idFieldName );
    String idInString = objectToString( getIdBridge(), idFieldMetadata.getName(), id, contextualBridge );
    if ( delete && !add ) {
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( add && !delete ) {
      queue.add(
          createAddWork(
              entityClass,
View Full Code Here

  }
 
  public void addWorkToQueue(Class<T> entityClass, T entity, Serializable id, boolean delete, boolean add, List<LuceneWork> queue) {
    String idInString = objectToString( idBridge, idKeywordName, id );
    if ( delete && !add ) {
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( add && !delete) {
      queue.add( createAddWork( entityClass, entity, id, idInString, HibernateStatelessInitializer.INSTANCE ) );
    }
    else if ( add && delete ) {
View Full Code Here

  }
 
  public void addWorkToQueue(Class<T> entityClass, T entity, Serializable id, boolean delete, boolean add, List<LuceneWork> queue, ConversionContext contextualBridge) {
    String idInString = objectToString( idBridge, idKeywordName, id, contextualBridge );
    if ( delete && !add ) {
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( add && !delete) {
      queue.add( createAddWork( entityClass, entity, id, idInString, this.instanceInitalizer, contextualBridge ) );
    }
    else if ( add && delete ) {
View Full Code Here

      String idInString = idBridge.objectToString( id );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
    }
    else if ( workType == WorkType.DELETE || workType == WorkType.PURGE ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( workType == WorkType.PURGE_ALL ) {
      queue.add( new PurgeAllLuceneWork( entityClass ) );
    }
    else if ( workType == WorkType.UPDATE || workType == WorkType.COLLECTION ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
    }
    else if ( workType == WorkType.INDEX ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, true ) );
    }
    else {
      throw new AssertionFailure( "Unknown WorkType: " + workType );
    }
View Full Code Here

      String idInString = idBridge.objectToString( id );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
    }
    else if ( workType == WorkType.DELETE || workType == WorkType.PURGE ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( workType == WorkType.PURGE_ALL ) {
      queue.add( new PurgeAllLuceneWork( entityClass ) );
    }
    else if ( workType == WorkType.UPDATE || workType == WorkType.COLLECTION ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
    }
    else if ( workType == WorkType.INDEX ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, true ) );
    }
    else {
      throw new AssertionFailure( "Unknown WorkType: " + workType );
    }
View Full Code Here

  @Override
  public void addWorkToQueue(Class<T> entityClass, T entity, Serializable id, boolean delete, boolean add, List<LuceneWork> queue, ConversionContext contextualBridge) {
    DocumentFieldMetadata idFieldMetadata = idPropertyMetadata.getFieldMetadata( idFieldName );
    String idInString = objectToString( getIdBridge(), idFieldMetadata.getName(), id, contextualBridge );
    if ( delete && !add ) {
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( add && !delete ) {
      queue.add(
          createAddWork(
              entityClass,
View Full Code Here

      public DeleteLuceneWork cloneOverridingIdString(final DeleteLuceneWork lw, final KeyTransformationHandler keyTransformationHandler) {
         final Serializable id = lw.getId();
         if (id == null) {
            //this is serialized work received from a remote node: take the getIdAsString instead
            final String idInString = lw.getIdInString();
            return new DeleteLuceneWork(idInString, idInString, lw.getEntityClass());
         }
         else {
            return lw;
         }
      }
View Full Code Here

      String idInString = idBridge.objectToString( id );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
    }
    else if ( workType == WorkType.DELETE || workType == WorkType.PURGE ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( workType == WorkType.PURGE_ALL ) {
      queue.add( new PurgeAllLuceneWork( entityClass ) );
    }
    else if ( workType == WorkType.UPDATE || workType == WorkType.COLLECTION ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
    }
    else if ( workType == WorkType.INDEX ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, true ) );
    }
    else {
      throw new AssertionFailure( "Unknown WorkType: " + workType );
    }
View Full Code Here

      String idInString = idBridge.objectToString( id );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
    }
    else if ( workType == WorkType.DELETE || workType == WorkType.PURGE ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( workType == WorkType.PURGE_ALL ) {
      queue.add( new PurgeAllLuceneWork( entityClass ) );
    }
    else if ( workType == WorkType.UPDATE || workType == WorkType.COLLECTION ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
    }
    else if ( workType == WorkType.INDEX ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, true ) );
    }
    else {
      throw new AssertionFailure( "Unknown WorkType: " + workType );
    }
View Full Code Here

TOP

Related Classes of org.hibernate.search.backend.DeleteLuceneWork

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.