Package org.hibernate.search.test.reader.performance

Source Code of org.hibernate.search.test.reader.performance.UpdateActivity

// $Id: UpdateActivity.java 14954 2008-07-17 20:43:10Z sannegrinovero $
package org.hibernate.search.test.reader.performance;

import java.util.List;
import java.util.concurrent.CountDownLatch;

import org.hibernate.SessionFactory;
import org.hibernate.search.FullTextQuery;
import org.hibernate.search.FullTextSession;
import org.hibernate.search.test.reader.Detective;

/**
* @author Sanne Grinovero
*/
public class UpdateActivity extends AbstractActivity {

  UpdateActivity(SessionFactory sf, CountDownLatch startSignal) {
    super(sf, startSignal);
  }

  @Override
  protected void doAction(FullTextSession s, int jobSeed) {
    FullTextQuery q = getQuery( "John", s, Detective.class );
    List list = q.setMaxResults( 1 ).list();
    for ( Object o : list){
      Detective detective = (Detective) o;
      detective.setPhysicalDescription( "old" );
    }
  }

}
TOP

Related Classes of org.hibernate.search.test.reader.performance.UpdateActivity

TOP
Copyright © 2018 www.massapi.com. 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.