org.hibernate.search.test.util
Class FullTextSessionBuilder

java.lang.Object
  extended by org.hibernate.search.test.util.FullTextSessionBuilder

public class FullTextSessionBuilder
extends Object

Use the builder pattern to provide a SessionFactory. This is meant to use only ram-based index and databases, for those test which need to use several differently configured SessionFactories.

Author:
Sanne Grinovero, Hardy Ferentschik

Constructor Summary
FullTextSessionBuilder()
           
 
Method Summary
 FullTextSessionBuilder addAnnotatedClass(Class annotatedClass)
          Adds classes to the SessionFactory being built.
 FullTextSessionBuilder build()
          Builds the sessionFactory as configured so far.
 void close()
          Closes the SessionFactory.
 FullTextSession openFullTextSession()
           
 FullTextSessionBuilder setProperty(String key, String value)
          Override before building any parameter, or add new ones.
 FullTextSessionBuilder useRAMDirectoryProvider(boolean use)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FullTextSessionBuilder

public FullTextSessionBuilder()
Method Detail

useRAMDirectoryProvider

public FullTextSessionBuilder useRAMDirectoryProvider(boolean use)
Parameters:
use - if true, use indexes in RAM otherwise use FSDirectoryProvider
Returns:
the same builder (this).

setProperty

public FullTextSessionBuilder setProperty(String key,
                                          String value)
Override before building any parameter, or add new ones.

Parameters:
key - Property name.
value - Property value.
Returns:
the same builder (this).

addAnnotatedClass

public FullTextSessionBuilder addAnnotatedClass(Class annotatedClass)
Adds classes to the SessionFactory being built.

Parameters:
annotatedClass - The annotated class to add to the configuration.
Returns:
the same builder (this)

openFullTextSession

public FullTextSession openFullTextSession()
Returns:
a new FullTextSession based upon the built configuration.

close

public void close()
Closes the SessionFactory. Make sure you close all sessions first


build

public FullTextSessionBuilder build()
Builds the sessionFactory as configured so far.



Copyright © 2006-2010 Hibernate. All Rights Reserved.