Package org.hibernate.search.test.performance.model

Examples of org.hibernate.search.test.performance.model.Book


      if ( bookId % 100 == 0 ) {
        log( "InsertBookTask: bookId=" + bookId );
      }
    }

    Book book = new Book();
    book.setId( bookId );
    book.setTitle( "title" + bookId );
    book.setSummary( SUMMARIES[(int) ( bookId % SUMMARIES.length )] );
    book.setRating( 0.0f );
    book.setTotalSold( 0L );
    book.setPublicationDate( DateUtils.addDays( PUBLICATION_DATE_ZERO, (int) ( bookId % 1000 ) ) );
    book.getAuthors().add( new Author( authorId, "author" + authorId ) );

    fts.merge( book );
  }
View Full Code Here


  }

  @Override
  protected void execute(FullTextSession fts) {
    long bookId = ctx.getRandomBookId();
    Book book = (Book) fts.get( Book.class, bookId );
    if ( book != null ) {
      book.setTotalSold( book.getTotalSold() + 1 );
    }
  }
View Full Code Here

  }

  @Override
  protected void execute(FullTextSession fts) {
    long bookId = ctx.getRandomBookId();
    Book book = (Book) fts.get( Book.class, bookId );
    if ( book != null ) {
      book.setRating( Math.abs( RANDOM_RATING.nextFloat() ) * MAX_RATING );
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.search.test.performance.model.Book

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.