Package org.hibernate.search.backend

Examples of org.hibernate.search.backend.AddWork


    final Object entity = event.getEntity();
    DocumentBuilder<Object> builder = documentBuilders.get( entity.getClass() );
    if ( builder != null ) {
      Serializable id = event.getId();
      Document doc = builder.getDocument( entity, id );
      AddWork work = new AddWork( id, entity.getClass(), doc );
      processWork( work, event );
    }
  }
View Full Code Here


  public void add(Work work) {
    //TODO optimize by getting rid of dupe works
    if ( work instanceof UpdateWork ) {
      //split in 2 to optimize the process (reader first, writer next
      queue.add( new DeleteWork( work.getId(), work.getEntity() ) );
      queue.add( new AddWork( work.getId(), work.getEntity(), work.getDocument() ) );
    }
    else {
      queue.add( work );
    }
  }
View Full Code Here

TOP

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

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.