Hibernate SVN: r14017 - sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-09-21 12:21:18 -0400 (Fri, 21 Sep 2007)
New Revision: 14017
Modified:
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/AbstractBatchImpl.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/Batch.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/BatchBuilder.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/BatchObserver.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/BatchingBatch.java
sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/NonBatchingBatch.java
Log:
javadoc of batch stuff
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/AbstractBatchImpl.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/AbstractBatchImpl.java 2007-09-20 21:59:46 UTC (rev 14016)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/AbstractBatchImpl.java 2007-09-21 16:21:18 UTC (rev 14017)
@@ -31,7 +31,7 @@
import org.hibernate.jdbc.proxy.ProxyBuilder;
/**
- * AbstractBatchImpl implementation
+ * Convenience base class for implementors of the Batch interface.
*
* @author Steve Ebersole
*/
@@ -50,20 +50,49 @@
this.connectionProxy = ProxyBuilder.buildConnection( logicalConnection );
}
+ /**
+ * Perform batch execution.
+ * <p/>
+ * This is called from the explicit {@link #execute() execution}, but may also be called from elsewhere
+ * depending on the exact implementation.
+ */
protected abstract void doExecuteBatch();
+ /**
+ * Convenience access to the underlying JDbC services.
+ *
+ * @return The underlying JDBC services.
+ */
protected JDBCServices getJdbcServices() {
return logicalConnection.getJdbcServices();
}
+ /**
+ * Access to the batch's map of statements (keyed by SQL statement string).
+ *
+ * @return This batch's statements.
+ */
protected LinkedHashMap getStatements() {
return statements;
}
+ /**
+ * {@inheritDoc}
+ */
public final Object getKey() {
return key;
}
+ /**
+ * {@inheritDoc}
+ */
+ public void addObserver(BatchObserver observer) {
+ observers.add( observer );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public final PreparedStatement getBatchStatement(String sql, boolean callable) {
PreparedStatement statement = ( PreparedStatement ) statements.get( sql );
if ( statement == null ) {
@@ -92,6 +121,9 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
public final void execute() {
notifyObserversExplicitExecution();
if ( statements.isEmpty() ) {
@@ -123,12 +155,9 @@
log.error( "sqlexception escaped proxy", e );
}
}
+ getStatements().clear();
}
- public void addObserver(BatchObserver observer) {
- observers.add( observer );
- }
-
private void notifyObserversExplicitExecution() {
Iterator itr = observers.iterator();
while ( itr.hasNext() ) {
@@ -136,10 +165,21 @@
}
}
+ /**
+ * Convenience method to notify registered observers of an implicit execution of this batch.
+ */
protected void notifyObserversImplicitExecution() {
Iterator itr = observers.iterator();
while ( itr.hasNext() ) {
( ( BatchObserver ) itr.next() ).batchImplicitlyExecuted();
}
}
+
+ public void release() {
+ if ( getStatements() != null && !getStatements().isEmpty() ) {
+ log.info( "On release of batch it still contained JDBC statements" );
+ }
+ releaseStatements();
+ observers.clear();
+ }
}
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/Batch.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/Batch.java 2007-09-20 21:59:46 UTC (rev 14016)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/Batch.java 2007-09-21 16:21:18 UTC (rev 14017)
@@ -20,15 +20,53 @@
import org.hibernate.jdbc.Expectation;
/**
- * Conceptually models a batch, but unlike directly in JDBC, here we add the ability to
- * batch together multiple statements at a time.
+ * Conceptually models a batch.
+ * <p/>
+ * Unlike directly in JDBC, here we add the ability to batch together multiple statements at a time. In the underlying
+ * JDBC this correlates to multiple {@link PreparedStatement} objects (one for each DML string) maintained within the
+ * batch.
*
* @author Steve Ebersole
*/
public interface Batch {
+ /**
+ * Retrieves the object being used to key (uniquely identify) this batch.
+ *
+ * @return The batch key.
+ */
public Object getKey();
+
+ /**
+ * Adds an observer to this batch.
+ *
+ * @param observer The batch observer.
+ */
public void addObserver(BatchObserver observer);
+
+ /**
+ * Get a statement which is part of the batch, creating if necessary (and storing for next time).
+ *
+ * @param sql The SQL statement.
+ * @param callable Is the SQL statement callable?
+ * @return The prepared statement instance, representing the SQL statement.
+ */
public PreparedStatement getBatchStatement(String sql, boolean callable);
+
+ /**
+ * Indicates completion of the current part of the batch.
+ *
+ * @param expectation The expectation for the part's result.
+ */
public void addToBatch(Expectation expectation);
+
+ /**
+ * Execute this batch.
+ */
public void execute();
+
+ /**
+ * Used to indicate that the batch instance is no longer needed and that, therefore, it can release its
+ * resources.
+ */
+ public void release();
}
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/BatchBuilder.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/BatchBuilder.java 2007-09-20 21:59:46 UTC (rev 14016)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/BatchBuilder.java 2007-09-21 16:21:18 UTC (rev 14017)
@@ -21,14 +21,14 @@
import org.hibernate.jdbc.impl.LogicalConnectionImplementor;
/**
- * BatchBuilder implementation
+ * A builder for {@link Batch} instances.
*
* @author Steve Ebersole
*/
public class BatchBuilder {
private static final Logger log = LoggerFactory.getLogger( BatchBuilder.class );
- // todo : eventually have this take the Settings; this form is needed for testing because Settings is currently final :(
+ // todo : eventually have this take the Settings; this form is needed for testing because Settings is currently final and does not expose the batch size :(
private int size;
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/BatchObserver.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/BatchObserver.java 2007-09-20 21:59:46 UTC (rev 14016)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/BatchObserver.java 2007-09-21 16:21:18 UTC (rev 14017)
@@ -16,11 +16,18 @@
package org.hibernate.jdbc.batch;
/**
- * BatchObserver contract
+ * An observer contract for batch events.
*
* @author Steve Ebersole
*/
public interface BatchObserver {
+ /**
+ * Indicates explicit execution of the batch via a call to {@link Batch#execute()}.
+ */
public void batchExplicitlyExecuted();
+
+ /**
+ * Indicates an implicit execution of the batch.
+ */
public void batchImplicitlyExecuted();
}
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/BatchingBatch.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/BatchingBatch.java 2007-09-20 21:59:46 UTC (rev 14016)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/BatchingBatch.java 2007-09-21 16:21:18 UTC (rev 14017)
@@ -28,7 +28,8 @@
import org.hibernate.HibernateException;
/**
- * BatchingBatch implementation
+ * A {@link Batch} implementation which does batching based on a given size. Once the batch size is exceeded, the
+ * batch is implicitly executed.
*
* @author Steve Ebersole
*/
@@ -45,6 +46,9 @@
this.expectations = new Expectation[ batchSize ];
}
+ /**
+ * {@inheritDoc}
+ */
public void addToBatch(Expectation expectation) {
if ( !expectation.canBeBatched() ) {
throw new HibernateException( "attempting to batch an operation which cannot be batched" );
@@ -69,6 +73,9 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
protected void doExecuteBatch() {
if ( batchPosition == 0 ) {
log.debug( "no batched statements to execute" );
Modified: sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/NonBatchingBatch.java
===================================================================
--- sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/NonBatchingBatch.java 2007-09-20 21:59:46 UTC (rev 14016)
+++ sandbox/trunk/jdbc-proxy/src/main/java/org/hibernate/jdbc/batch/NonBatchingBatch.java 2007-09-21 16:21:18 UTC (rev 14017)
@@ -27,7 +27,8 @@
import org.hibernate.jdbc.impl.LogicalConnectionImplementor;
/**
- * NonBatchingBatch implementation
+ * An implementation of {@link Batch} which does not perform batching. It simply executes each statement as it is
+ * encountered.
*
* @author Steve Ebersole
*/
17 years, 2 months
Hibernate SVN: r14016 - core/branches/Branch_3_2/src/org/hibernate/event/def.
by hibernate-commits@lists.jboss.org
Author: cbredesen
Date: 2007-09-20 17:59:46 -0400 (Thu, 20 Sep 2007)
New Revision: 14016
Modified:
core/branches/Branch_3_2/src/org/hibernate/event/def/DefaultFlushEntityEventListener.java
Log:
HHH-2816 avoid re-select on READ_ONLY in checkNaturalId
Modified: core/branches/Branch_3_2/src/org/hibernate/event/def/DefaultFlushEntityEventListener.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/event/def/DefaultFlushEntityEventListener.java 2007-09-20 21:58:27 UTC (rev 14015)
+++ core/branches/Branch_3_2/src/org/hibernate/event/def/DefaultFlushEntityEventListener.java 2007-09-20 21:59:46 UTC (rev 14016)
@@ -68,12 +68,12 @@
private void checkNaturalId(
EntityPersister persister,
- Serializable identifier,
+ EntityEntry entry,
Object[] current,
Object[] loaded,
EntityMode entityMode,
SessionImplementor session) {
- if ( persister.hasNaturalIdentifier() ) {
+ if ( persister.hasNaturalIdentifier() && entry.getStatus() != Status.READ_ONLY ) {
Object[] snapshot = null;
Type[] types = persister.getPropertyTypes();
int[] props = persister.getNaturalIdentifierProperties();
@@ -84,7 +84,7 @@
Object loadedVal;
if ( loaded == null ) {
if ( snapshot == null) {
- snapshot = session.getPersistenceContext().getNaturalIdSnapshot( identifier, persister );
+ snapshot = session.getPersistenceContext().getNaturalIdSnapshot( entry.getId(), persister );
}
loadedVal = snapshot[i];
} else {
@@ -166,7 +166,7 @@
// grab its current state
values = persister.getPropertyValues( entity, entityMode );
- checkNaturalId( persister, entry.getId(), values, loadedState, entityMode, session );
+ checkNaturalId( persister, entry, values, loadedState, entityMode, session );
}
return values;
}
17 years, 2 months
Hibernate SVN: r14015 - core/trunk/core/src/main/java/org/hibernate/event/def.
by hibernate-commits@lists.jboss.org
Author: cbredesen
Date: 2007-09-20 17:58:27 -0400 (Thu, 20 Sep 2007)
New Revision: 14015
Modified:
core/trunk/core/src/main/java/org/hibernate/event/def/DefaultFlushEntityEventListener.java
Log:
HHH-2816 avoid re-selecting state for READ_ONLY in checkNaturalId
Modified: core/trunk/core/src/main/java/org/hibernate/event/def/DefaultFlushEntityEventListener.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/event/def/DefaultFlushEntityEventListener.java 2007-09-20 15:13:34 UTC (rev 14014)
+++ core/trunk/core/src/main/java/org/hibernate/event/def/DefaultFlushEntityEventListener.java 2007-09-20 21:58:27 UTC (rev 14015)
@@ -68,12 +68,12 @@
private void checkNaturalId(
EntityPersister persister,
- Serializable identifier,
+ EntityEntry entry,
Object[] current,
Object[] loaded,
EntityMode entityMode,
SessionImplementor session) {
- if ( persister.hasNaturalIdentifier() ) {
+ if ( persister.hasNaturalIdentifier() && entry.getStatus() != Status.READ_ONLY ) {
Object[] snapshot = null;
Type[] types = persister.getPropertyTypes();
int[] props = persister.getNaturalIdentifierProperties();
@@ -84,7 +84,7 @@
Object loadedVal;
if ( loaded == null ) {
if ( snapshot == null) {
- snapshot = session.getPersistenceContext().getNaturalIdSnapshot( identifier, persister );
+ snapshot = session.getPersistenceContext().getNaturalIdSnapshot( entry.getId(), persister );
}
loadedVal = snapshot[i];
} else {
@@ -166,7 +166,7 @@
// grab its current state
values = persister.getPropertyValues( entity, entityMode );
- checkNaturalId( persister, entry.getId(), values, loadedState, entityMode, session );
+ checkNaturalId( persister, entry, values, loadedState, entityMode, session );
}
return values;
}
17 years, 2 months
Hibernate SVN: r14014 - search/trunk/src/test/org/hibernate/search/test/jpa.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2007-09-20 11:13:34 -0400 (Thu, 20 Sep 2007)
New Revision: 14014
Modified:
search/trunk/src/test/org/hibernate/search/test/jpa/EntityManagerSerializationTest.java
Log:
HSEARCH-117 Cleaned up the code a little.
Modified: search/trunk/src/test/org/hibernate/search/test/jpa/EntityManagerSerializationTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/jpa/EntityManagerSerializationTest.java 2007-09-20 14:54:45 UTC (rev 14013)
+++ search/trunk/src/test/org/hibernate/search/test/jpa/EntityManagerSerializationTest.java 2007-09-20 15:13:34 UTC (rev 14014)
@@ -38,7 +38,7 @@
File tmpFile = File.createTempFile("entityManager", "ser", null);
serializeEM(em, tmpFile);
- em = deserializeEM(em, tmpFile);
+ em = deserializeEM(tmpFile);
indexSearchAssert(em);
@@ -48,8 +48,8 @@
tmpFile.delete();
}
- private FullTextEntityManager deserializeEM(FullTextEntityManager em,
- File tmpFile) throws ClassNotFoundException {
+ private FullTextEntityManager deserializeEM(File tmpFile) throws ClassNotFoundException {
+ FullTextEntityManager em = null;
FileInputStream fis = null;
ObjectInputStream in = null;
try {
@@ -60,11 +60,12 @@
}
catch (IOException ex) {
ex.printStackTrace();
+ fail();
}
return em;
}
- private File serializeEM(FullTextEntityManager em, File tmpFile) {
+ private void serializeEM(FullTextEntityManager em, File tmpFile) {
FileOutputStream fos = null;
ObjectOutputStream out = null;
try {
@@ -76,7 +77,6 @@
ex.printStackTrace();
fail();
}
- return tmpFile;
}
public Class[] getAnnotatedClasses() {
17 years, 2 months
Hibernate SVN: r14013 - in search/trunk/src: java/org/hibernate/search/jpa/impl and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2007-09-20 10:54:45 -0400 (Thu, 20 Sep 2007)
New Revision: 14013
Added:
search/trunk/src/test/org/hibernate/search/test/jpa/EntityManagerSerializationTest.java
Modified:
search/trunk/src/java/org/hibernate/search/impl/FullTextSessionImpl.java
search/trunk/src/java/org/hibernate/search/jpa/impl/FullTextEntityManagerImpl.java
search/trunk/src/test/org/hibernate/search/test/jpa/EntityManagerTest.java
Log:
HSEARCH-117 Made FullTextEntityManagerimpl serializable by making the SearchFactoryImplementor transient in the FullTextSessionImpl.
Modified: search/trunk/src/java/org/hibernate/search/impl/FullTextSessionImpl.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/impl/FullTextSessionImpl.java 2007-09-16 19:57:36 UTC (rev 14012)
+++ search/trunk/src/java/org/hibernate/search/impl/FullTextSessionImpl.java 2007-09-20 14:54:45 UTC (rev 14013)
@@ -22,9 +22,9 @@
import org.hibernate.SQLQuery;
import org.hibernate.ScrollMode;
import org.hibernate.ScrollableResults;
-import org.hibernate.classic.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
+import org.hibernate.classic.Session;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.engine.EntityKey;
import org.hibernate.engine.PersistenceContext;
@@ -40,11 +40,11 @@
import org.hibernate.jdbc.JDBCContext;
import org.hibernate.loader.custom.CustomQuery;
import org.hibernate.persister.entity.EntityPersister;
+import org.hibernate.search.FullTextQuery;
import org.hibernate.search.FullTextSession;
-import org.hibernate.search.FullTextQuery;
import org.hibernate.search.SearchFactory;
+import org.hibernate.search.backend.Work;
import org.hibernate.search.backend.WorkType;
-import org.hibernate.search.backend.Work;
import org.hibernate.search.engine.DocumentBuilder;
import org.hibernate.search.engine.SearchFactoryImplementor;
import org.hibernate.search.query.FullTextQueryImpl;
@@ -57,12 +57,13 @@
*
* @author Emmanuel Bernard
* @author John Griffin
+ * @author Hardy Ferentschik
*/
public class FullTextSessionImpl implements FullTextSession, SessionImplementor {
private final Session session;
private final EventSource eventSource;
private final SessionImplementor sessionImplementor;
- private SearchFactoryImplementor searchFactory;
+ private transient SearchFactoryImplementor searchFactory;
public FullTextSessionImpl(org.hibernate.Session session) {
this.session = (Session) session;
Modified: search/trunk/src/java/org/hibernate/search/jpa/impl/FullTextEntityManagerImpl.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/jpa/impl/FullTextEntityManagerImpl.java 2007-09-16 19:57:36 UTC (rev 14012)
+++ search/trunk/src/java/org/hibernate/search/jpa/impl/FullTextEntityManagerImpl.java 2007-09-20 14:54:45 UTC (rev 14013)
@@ -19,7 +19,7 @@
/**
* @author Emmanuel Bernard
*/
-public class FullTextEntityManagerImpl implements FullTextEntityManager {
+public class FullTextEntityManagerImpl implements FullTextEntityManager, Serializable {
private EntityManager em;
private FullTextSession ftSession;
Added: search/trunk/src/test/org/hibernate/search/test/jpa/EntityManagerSerializationTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/jpa/EntityManagerSerializationTest.java (rev 0)
+++ search/trunk/src/test/org/hibernate/search/test/jpa/EntityManagerSerializationTest.java 2007-09-20 14:54:45 UTC (rev 14013)
@@ -0,0 +1,117 @@
+// $Id$
+package org.hibernate.search.test.jpa;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.apache.lucene.analysis.StopAnalyzer;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.TermQuery;
+import org.hibernate.search.jpa.FullTextEntityManager;
+import org.hibernate.search.jpa.Search;
+
+/**
+ * Serialization test for entity manager. HSEARCH-117.
+ *
+ * @author Hardy Ferentschik
+ */
+public class EntityManagerSerializationTest extends JPATestCase {
+
+ /**
+ * Test that a entity manager can successfully be serialized and
+ * deserialized.
+ *
+ * @throws Exception
+ * in case the test fails.
+ */
+ public void testSerialization() throws Exception {
+ FullTextEntityManager em = Search.createFullTextEntityManager(factory
+ .createEntityManager());
+
+ indexSearchAssert(em);
+
+ File tmpFile = File.createTempFile("entityManager", "ser", null);
+ serializeEM(em, tmpFile);
+ em = deserializeEM(em, tmpFile);
+
+ indexSearchAssert(em);
+
+ em.close();
+
+ // cleanup
+ tmpFile.delete();
+ }
+
+ private FullTextEntityManager deserializeEM(FullTextEntityManager em,
+ File tmpFile) throws ClassNotFoundException {
+ FileInputStream fis = null;
+ ObjectInputStream in = null;
+ try {
+ fis = new FileInputStream(tmpFile);
+ in = new ObjectInputStream(fis);
+ em = (FullTextEntityManager) in.readObject();
+ in.close();
+ }
+ catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ return em;
+ }
+
+ private File serializeEM(FullTextEntityManager em, File tmpFile) {
+ FileOutputStream fos = null;
+ ObjectOutputStream out = null;
+ try {
+ fos = new FileOutputStream(tmpFile);
+ out = new ObjectOutputStream(fos);
+ out.writeObject(em);
+ out.close();
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ fail();
+ }
+ return tmpFile;
+ }
+
+ public Class[] getAnnotatedClasses() {
+ return new Class[] { Bretzel.class };
+ };
+
+ /**
+ * Helper method for testing the entity manager before and after
+ * serialization.
+ *
+ * @param em
+ * @throws Exception
+ */
+ private void indexSearchAssert(FullTextEntityManager em) throws Exception {
+ em.getTransaction().begin();
+ Bretzel bretzel = new Bretzel(23, 34);
+ em.persist(bretzel);
+ em.getTransaction().commit();
+ em.clear();
+ em.getTransaction().begin();
+ QueryParser parser = new QueryParser("title", new StopAnalyzer());
+ Query query = parser.parse("saltQty:noword");
+ assertEquals(0, em.createFullTextQuery(query).getResultList().size());
+ query = new TermQuery(new Term("saltQty", "23.0"));
+ assertEquals("getResultList", 1, em.createFullTextQuery(query)
+ .getResultList().size());
+ assertEquals("getSingleResult and object retrieval", 23f, ((Bretzel) em
+ .createFullTextQuery(query).getSingleResult()).getSaltQty());
+ assertEquals(1, em.createFullTextQuery(query).getResultSize());
+ em.getTransaction().commit();
+
+ em.clear();
+
+ em.getTransaction().begin();
+ em.remove(em.find(Bretzel.class, bretzel.getId()));
+ em.getTransaction().commit();
+ }
+}
Property changes on: search/trunk/src/test/org/hibernate/search/test/jpa/EntityManagerSerializationTest.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: search/trunk/src/test/org/hibernate/search/test/jpa/EntityManagerTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/jpa/EntityManagerTest.java 2007-09-16 19:57:36 UTC (rev 14012)
+++ search/trunk/src/test/org/hibernate/search/test/jpa/EntityManagerTest.java 2007-09-20 14:54:45 UTC (rev 14013)
@@ -50,7 +50,7 @@
em.getTransaction().commit();
em.clear();
- //Not really a unit test but a test that shows the method call wiouth failing
+ //Not really a unit test but a test that shows the method call without failing
//FIXME port the index test
em.getTransaction().begin();
em.index( em.find( Bretzel.class, bretzel.getId() ) );
Property changes on: search/trunk/src/test/org/hibernate/search/test/jpa/EntityManagerTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
17 years, 2 months
Hibernate SVN: r14012 - in search/trunk/src/java/org/hibernate/search: annotations and 9 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2007-09-16 15:57:36 -0400 (Sun, 16 Sep 2007)
New Revision: 14012
Modified:
search/trunk/src/java/org/hibernate/search/FullTextFilter.java
search/trunk/src/java/org/hibernate/search/ProjectionConstants.java
search/trunk/src/java/org/hibernate/search/SearchFactory.java
search/trunk/src/java/org/hibernate/search/annotations/Analyzer.java
search/trunk/src/java/org/hibernate/search/annotations/ClassBridge.java
search/trunk/src/java/org/hibernate/search/annotations/Factory.java
search/trunk/src/java/org/hibernate/search/annotations/Fields.java
search/trunk/src/java/org/hibernate/search/annotations/FullTextFilterDef.java
search/trunk/src/java/org/hibernate/search/annotations/FullTextFilterDefs.java
search/trunk/src/java/org/hibernate/search/annotations/Key.java
search/trunk/src/java/org/hibernate/search/backend/LuceneIndexingParameters.java
search/trunk/src/java/org/hibernate/search/backend/OptimizeLuceneWork.java
search/trunk/src/java/org/hibernate/search/backend/PurgeAllLuceneWork.java
search/trunk/src/java/org/hibernate/search/engine/FilterDef.java
search/trunk/src/java/org/hibernate/search/filter/ChainedFilter.java
search/trunk/src/java/org/hibernate/search/filter/FilterCachingStrategy.java
search/trunk/src/java/org/hibernate/search/filter/FilterKey.java
search/trunk/src/java/org/hibernate/search/filter/MRUFilterCachingStrategy.java
search/trunk/src/java/org/hibernate/search/filter/StandardFilterKey.java
search/trunk/src/java/org/hibernate/search/jpa/FullTextEntityManager.java
search/trunk/src/java/org/hibernate/search/jpa/FullTextQuery.java
search/trunk/src/java/org/hibernate/search/jpa/Search.java
search/trunk/src/java/org/hibernate/search/jpa/impl/FullTextEntityManagerImpl.java
search/trunk/src/java/org/hibernate/search/jpa/impl/FullTextQueryImpl.java
search/trunk/src/java/org/hibernate/search/query/FullTextFilterImpl.java
search/trunk/src/java/org/hibernate/search/store/IdHashShardingStrategy.java
search/trunk/src/java/org/hibernate/search/store/IndexShardingStrategy.java
search/trunk/src/java/org/hibernate/search/store/NotShardedStrategy.java
search/trunk/src/java/org/hibernate/search/store/optimization/IncrementalOptimizerStrategy.java
search/trunk/src/java/org/hibernate/search/store/optimization/NoOpOptimizerStrategy.java
search/trunk/src/java/org/hibernate/search/store/optimization/OptimizerStrategy.java
search/trunk/src/java/org/hibernate/search/util/ScopedAnalyzer.java
Log:
Enabled svn keyword substitution.
Modified: search/trunk/src/java/org/hibernate/search/FullTextFilter.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/FullTextFilter.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/FullTextFilter.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search;
/**
Property changes on: search/trunk/src/java/org/hibernate/search/FullTextFilter.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/ProjectionConstants.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/ProjectionConstants.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/ProjectionConstants.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search;
/**
Property changes on: search/trunk/src/java/org/hibernate/search/ProjectionConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/SearchFactory.java
===================================================================
Property changes on: search/trunk/src/java/org/hibernate/search/SearchFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/annotations/Analyzer.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/annotations/Analyzer.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/annotations/Analyzer.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.annotations;
import java.lang.annotation.Retention;
Property changes on: search/trunk/src/java/org/hibernate/search/annotations/Analyzer.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/annotations/ClassBridge.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/annotations/ClassBridge.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/annotations/ClassBridge.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,3 +1,4 @@
+// $Id$
package org.hibernate.search.annotations;
import java.lang.annotation.Documented;
Property changes on: search/trunk/src/java/org/hibernate/search/annotations/ClassBridge.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/annotations/Factory.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/annotations/Factory.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/annotations/Factory.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.annotations;
import java.lang.annotation.Retention;
Property changes on: search/trunk/src/java/org/hibernate/search/annotations/Factory.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/annotations/Fields.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/annotations/Fields.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/annotations/Fields.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.annotations;
import java.lang.annotation.Retention;
Property changes on: search/trunk/src/java/org/hibernate/search/annotations/Fields.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/annotations/FullTextFilterDef.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/annotations/FullTextFilterDef.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/annotations/FullTextFilterDef.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.annotations;
import java.lang.annotation.Retention;
Property changes on: search/trunk/src/java/org/hibernate/search/annotations/FullTextFilterDef.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/annotations/FullTextFilterDefs.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/annotations/FullTextFilterDefs.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/annotations/FullTextFilterDefs.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.annotations;
import java.lang.annotation.Retention;
Property changes on: search/trunk/src/java/org/hibernate/search/annotations/FullTextFilterDefs.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/annotations/Key.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/annotations/Key.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/annotations/Key.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.annotations;
import java.lang.annotation.Retention;
Property changes on: search/trunk/src/java/org/hibernate/search/annotations/Key.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/backend/LuceneIndexingParameters.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/LuceneIndexingParameters.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/backend/LuceneIndexingParameters.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,3 +1,4 @@
+//$Id$
package org.hibernate.search.backend;
/**
Modified: search/trunk/src/java/org/hibernate/search/backend/OptimizeLuceneWork.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/OptimizeLuceneWork.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/backend/OptimizeLuceneWork.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.backend;
import java.io.Serializable;
Property changes on: search/trunk/src/java/org/hibernate/search/backend/OptimizeLuceneWork.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/backend/PurgeAllLuceneWork.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/PurgeAllLuceneWork.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/backend/PurgeAllLuceneWork.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,3 +1,4 @@
+//$Id$
package org.hibernate.search.backend;
import java.io.Serializable;
Property changes on: search/trunk/src/java/org/hibernate/search/backend/PurgeAllLuceneWork.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/engine/FilterDef.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/engine/FilterDef.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/engine/FilterDef.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.engine;
import java.lang.reflect.InvocationTargetException;
Property changes on: search/trunk/src/java/org/hibernate/search/engine/FilterDef.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/filter/ChainedFilter.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/filter/ChainedFilter.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/filter/ChainedFilter.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.filter;
import java.util.BitSet;
Property changes on: search/trunk/src/java/org/hibernate/search/filter/ChainedFilter.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/filter/FilterCachingStrategy.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/filter/FilterCachingStrategy.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/filter/FilterCachingStrategy.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.filter;
import java.util.Properties;
Property changes on: search/trunk/src/java/org/hibernate/search/filter/FilterCachingStrategy.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/filter/FilterKey.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/filter/FilterKey.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/filter/FilterKey.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.filter;
/**
Property changes on: search/trunk/src/java/org/hibernate/search/filter/FilterKey.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/filter/MRUFilterCachingStrategy.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/filter/MRUFilterCachingStrategy.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/filter/MRUFilterCachingStrategy.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.filter;
import java.util.Properties;
Property changes on: search/trunk/src/java/org/hibernate/search/filter/MRUFilterCachingStrategy.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/filter/StandardFilterKey.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/filter/StandardFilterKey.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/filter/StandardFilterKey.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.filter;
import java.util.Map;
Property changes on: search/trunk/src/java/org/hibernate/search/filter/StandardFilterKey.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/jpa/FullTextEntityManager.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/jpa/FullTextEntityManager.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/jpa/FullTextEntityManager.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.jpa;
import java.io.Serializable;
Property changes on: search/trunk/src/java/org/hibernate/search/jpa/FullTextEntityManager.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/jpa/FullTextQuery.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/jpa/FullTextQuery.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/jpa/FullTextQuery.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.jpa;
import javax.persistence.Query;
Property changes on: search/trunk/src/java/org/hibernate/search/jpa/FullTextQuery.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/jpa/Search.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/jpa/Search.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/jpa/Search.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.jpa;
import javax.persistence.EntityManager;
Property changes on: search/trunk/src/java/org/hibernate/search/jpa/Search.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/jpa/impl/FullTextEntityManagerImpl.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/jpa/impl/FullTextEntityManagerImpl.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/jpa/impl/FullTextEntityManagerImpl.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.jpa.impl;
import java.io.Serializable;
Property changes on: search/trunk/src/java/org/hibernate/search/jpa/impl/FullTextEntityManagerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/jpa/impl/FullTextQueryImpl.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/jpa/impl/FullTextQueryImpl.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/jpa/impl/FullTextQueryImpl.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.jpa.impl;
import java.util.List;
Property changes on: search/trunk/src/java/org/hibernate/search/jpa/impl/FullTextQueryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/query/FullTextFilterImpl.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/query/FullTextFilterImpl.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/query/FullTextFilterImpl.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.query;
import java.util.Map;
Property changes on: search/trunk/src/java/org/hibernate/search/query/FullTextFilterImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/store/IdHashShardingStrategy.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/store/IdHashShardingStrategy.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/store/IdHashShardingStrategy.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.store;
import java.util.Properties;
Property changes on: search/trunk/src/java/org/hibernate/search/store/IdHashShardingStrategy.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/store/IndexShardingStrategy.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/store/IndexShardingStrategy.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/store/IndexShardingStrategy.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.store;
import java.io.Serializable;
Property changes on: search/trunk/src/java/org/hibernate/search/store/IndexShardingStrategy.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/store/NotShardedStrategy.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/store/NotShardedStrategy.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/store/NotShardedStrategy.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.store;
import java.util.Properties;
Property changes on: search/trunk/src/java/org/hibernate/search/store/NotShardedStrategy.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/store/optimization/IncrementalOptimizerStrategy.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/store/optimization/IncrementalOptimizerStrategy.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/store/optimization/IncrementalOptimizerStrategy.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.store.optimization;
import java.util.Properties;
Property changes on: search/trunk/src/java/org/hibernate/search/store/optimization/IncrementalOptimizerStrategy.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/store/optimization/NoOpOptimizerStrategy.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/store/optimization/NoOpOptimizerStrategy.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/store/optimization/NoOpOptimizerStrategy.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.store.optimization;
import java.util.Properties;
Property changes on: search/trunk/src/java/org/hibernate/search/store/optimization/NoOpOptimizerStrategy.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/store/optimization/OptimizerStrategy.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/store/optimization/OptimizerStrategy.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/store/optimization/OptimizerStrategy.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.store.optimization;
import java.util.Properties;
Property changes on: search/trunk/src/java/org/hibernate/search/store/optimization/OptimizerStrategy.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: search/trunk/src/java/org/hibernate/search/util/ScopedAnalyzer.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/util/ScopedAnalyzer.java 2007-09-15 18:13:35 UTC (rev 14011)
+++ search/trunk/src/java/org/hibernate/search/util/ScopedAnalyzer.java 2007-09-16 19:57:36 UTC (rev 14012)
@@ -1,4 +1,4 @@
-//$Id$
+// $Id$
package org.hibernate.search.util;
import java.io.Reader;
Property changes on: search/trunk/src/java/org/hibernate/search/util/ScopedAnalyzer.java
___________________________________________________________________
Name: svn:keywords
+ Id
17 years, 2 months
Hibernate SVN: r14011 - search/trunk/src/java/org/hibernate/search.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-09-15 14:13:35 -0400 (Sat, 15 Sep 2007)
New Revision: 14011
Modified:
search/trunk/src/java/org/hibernate/search/SearchFactory.java
Log:
Better JavaDoc
Modified: search/trunk/src/java/org/hibernate/search/SearchFactory.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/SearchFactory.java 2007-09-14 19:32:16 UTC (rev 14010)
+++ search/trunk/src/java/org/hibernate/search/SearchFactory.java 2007-09-15 18:13:35 UTC (rev 14011)
@@ -16,8 +16,11 @@
ReaderProvider getReaderProvider();
/**
- * Provide access to the DirectoryProvider (hence the Lucene Directory)
+ * Provide access to the DirectoryProviders (hence the Lucene Directories)
* for a given entity
+ * In most cases, the returned type will be a one element array.
+ * But if the given entity is configured to use sharded indexes, then multiple
+ * elements will be returned. In this case all of them should be considered.
*/
DirectoryProvider[] getDirectoryProviders(Class entity);
17 years, 2 months
Hibernate SVN: r14010 - search/trunk/src/test/org/hibernate/search/test/query.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-09-14 15:32:16 -0400 (Fri, 14 Sep 2007)
New Revision: 14010
Modified:
search/trunk/src/test/org/hibernate/search/test/query/ProjectionQueryTest.java
Log:
more test
Modified: search/trunk/src/test/org/hibernate/search/test/query/ProjectionQueryTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/query/ProjectionQueryTest.java 2007-09-13 03:48:51 UTC (rev 14009)
+++ search/trunk/src/test/org/hibernate/search/test/query/ProjectionQueryTest.java 2007-09-14 19:32:16 UTC (rev 14010)
@@ -172,6 +172,7 @@
assertEquals( "id incorrect", 1001, projection[0] );
assertEquals( "last name incorrect", "Jackson", projection[1] );
assertEquals( "dept incorrect", "Accounting", projection[2] );
+ assertEquals( "THIS incorrect", "Jackson", ( (Employee) projection[3] ).getLastname() );
assertEquals( "THIS incorrect", projection[3], s.get(Employee.class, (Serializable) projection[0]) );
assertEquals( "SCORE incorrect", 1.0F, projection[4] );
assertEquals( "BOOST incorrect", 1.0F, projection[5] );
17 years, 2 months
Hibernate SVN: r14009 - in search/trunk/src: java/org/hibernate/search/bridge and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-09-12 23:48:51 -0400 (Wed, 12 Sep 2007)
New Revision: 14009
Added:
search/trunk/src/java/org/hibernate/search/annotations/ClassBridge.java
search/trunk/src/test/org/hibernate/search/test/bridge/CatFieldsClassBridge.java
search/trunk/src/test/org/hibernate/search/test/bridge/ClassBridgeTest.java
search/trunk/src/test/org/hibernate/search/test/bridge/Department.java
Modified:
search/trunk/src/java/org/hibernate/search/bridge/BridgeFactory.java
search/trunk/src/java/org/hibernate/search/engine/DocumentBuilder.java
search/trunk/src/test/org/hibernate/search/test/PurgeTest.java
Log:
HSEARCH-81 Add @ClassBridge support (John Griffin)
Added: search/trunk/src/java/org/hibernate/search/annotations/ClassBridge.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/annotations/ClassBridge.java (rev 0)
+++ search/trunk/src/java/org/hibernate/search/annotations/ClassBridge.java 2007-09-13 03:48:51 UTC (rev 14009)
@@ -0,0 +1,61 @@
+package org.hibernate.search.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * This annotation allows a user to apply an implementation
+ * class to a Lucene document to manipulate it in any way
+ * the usersees fit.
+ *
+ * @author John Griffin
+ */
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.TYPE )
+@Documented
+public @interface ClassBridge {
+ /**
+ * Field name, default to the JavaBean property name.
+ */
+ String name() default "";
+
+ /**
+ * Should the value be stored in the document.
+ * defaults to no.
+ */
+ Store store() default Store.NO;
+
+ /**
+ * Define an analyzer for the field, default to
+ * the inherited analyzer.
+ */
+ Analyzer analyzer() default @Analyzer;
+
+ /**
+ * Defines how the Field should be indexed
+ * defaults to tokenized.
+ */
+ Index index() default Index.TOKENIZED;
+
+ /**
+ * A float value of the amount of lucene defined
+ * boost to apply to a field.
+ */
+ Boost boost() default @Boost(value=1.0F);
+
+ /**
+ * User supplied class to manipulate document in
+ * whatever mysterious ways they wish to.
+ */
+ public Class impl() default void.class;
+
+ /**
+ * Array of fields to work with. The imnpl class
+ * above will work on these fields.
+ */
+ public Parameter[] params() default {};
+
+}
\ No newline at end of file
Modified: search/trunk/src/java/org/hibernate/search/bridge/BridgeFactory.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/bridge/BridgeFactory.java 2007-09-09 10:41:51 UTC (rev 14008)
+++ search/trunk/src/java/org/hibernate/search/bridge/BridgeFactory.java 2007-09-13 03:48:51 UTC (rev 14009)
@@ -23,6 +23,7 @@
import org.hibernate.search.annotations.Resolution;
import org.hibernate.search.annotations.Parameter;
import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.ClassBridge;
import org.hibernate.search.SearchException;
import org.hibernate.search.util.BinderHelper;
import org.hibernate.annotations.common.reflection.XClass;
@@ -30,6 +31,7 @@
/**
* @author Emmanuel Bernard
+ * @author John Griffin
*/
public class BridgeFactory {
private static Map<String, FieldBridge> builtInBridges = new HashMap<String, FieldBridge>();
@@ -83,7 +85,45 @@
builtInBridges.put( Date.class.getName(), DATE_MILLISECOND );
}
+
+ /**
+ * This extracts and instantiates the implementation class from a ClassBridge
+ * annotation.
+ *
+ * @param cb the ClassBridge
+ * @return FieldBridge
+ */
+ public static FieldBridge extractType(ClassBridge cb)
+ {
+ FieldBridge bridge = null;
+ if ( cb != null ) {
+ Class impl = cb.impl();
+
+ if (impl != null) {
+ try {
+ Object instance = impl.newInstance();
+ if ( FieldBridge.class.isAssignableFrom( impl ) ) {
+ bridge = (FieldBridge) instance;
+ }
+ if ( cb.params().length > 0 && ParameterizedBridge.class.isAssignableFrom( impl ) ) {
+ Map params = new HashMap( cb.params().length );
+ for ( Parameter param : cb.params() ) {
+ params.put( param.name(), param.value() );
+ }
+ ( (ParameterizedBridge) instance ).setParameterValues( params );
+ }
+ }
+ catch (Exception e) {
+ throw new HibernateException( "Unable to instantiate FieldBridge for " + ClassBridge.class.getName(), e );
+ }
+ }
+ }
+ if ( bridge == null ) throw new SearchException( "Unable to guess FieldBridge for " + ClassBridge.class.getName() );
+
+ return bridge;
+ }
+
public static FieldBridge guessType(Field field, XMember member) {
FieldBridge bridge = null;
org.hibernate.search.annotations.FieldBridge bridgeAnn;
Modified: search/trunk/src/java/org/hibernate/search/engine/DocumentBuilder.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/engine/DocumentBuilder.java 2007-09-09 10:41:51 UTC (rev 14008)
+++ search/trunk/src/java/org/hibernate/search/engine/DocumentBuilder.java 2007-09-13 03:48:51 UTC (rev 14009)
@@ -33,6 +33,7 @@
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.IndexedEmbedded;
import org.hibernate.search.annotations.Store;
+import org.hibernate.search.annotations.ClassBridge;
import org.hibernate.search.backend.AddLuceneWork;
import org.hibernate.search.backend.DeleteLuceneWork;
import org.hibernate.search.backend.LuceneWork;
@@ -139,6 +140,11 @@
if ( analyzer != null ) {
propertiesMetadata.analyzer = analyzer;
}
+ // Check for any ClassBridge style of annotations.
+ ClassBridge classBridgeAnn = currClass.getAnnotation(ClassBridge.class);
+ if (classBridgeAnn != null) {
+ bindClassAnnotation(prefix, propertiesMetadata, classBridgeAnn);
+ }
//rejecting non properties because the object is loaded from Hibernate, so indexing a non property does not make sense
List<XProperty> methods = currClass.getDeclaredProperties( XClass.ACCESS_PROPERTY );
for (XProperty method : methods) {
@@ -279,6 +285,21 @@
}
}
+ private void bindClassAnnotation(String prefix, PropertiesMetadata propertiesMetadata, ClassBridge ann) {
+ //FIXME name should be prefixed
+ String fieldName = prefix + ann.name();
+ propertiesMetadata.classNames.add( fieldName );
+ propertiesMetadata.classStores.add( getStore( ann.store() ) );
+ propertiesMetadata.classIndexes.add( getIndex( ann.index() ) );
+ propertiesMetadata.classBridges.add( BridgeFactory.extractType( ann ) );
+ propertiesMetadata.classBoosts.add( ann.boost().value() );
+
+ Analyzer analyzer = getAnalyzer( ann.analyzer() );
+ if ( analyzer == null ) analyzer = propertiesMetadata.analyzer;
+ if ( analyzer == null ) throw new AssertionFailure( "Analyzer should not be undefined" );
+ this.analyzer.addScopedAnalyzer( fieldName, analyzer );
+ }
+
private void bindFieldAnnotation(XProperty member, PropertiesMetadata propertiesMetadata, String prefix, org.hibernate.search.annotations.Field fieldAnn) {
setAccessible( member );
propertiesMetadata.fieldGetters.add( member );
@@ -487,6 +508,16 @@
if ( instance == null ) return;
//needed for field access: I cannot work in the proxied version
Object unproxiedInstance = unproxy( instance );
+ for (int i = 0; i < propertiesMetadata.classBridges.size(); i++) {
+ FieldBridge fb = propertiesMetadata.classBridges.get( i );
+
+ fb.set( propertiesMetadata.classNames.get(i),
+ unproxiedInstance,
+ doc,
+ propertiesMetadata.classStores.get(i),
+ propertiesMetadata.classIndexes.get(i),
+ propertiesMetadata.classBoosts.get(i));
+ }
for (int i = 0; i < propertiesMetadata.fieldNames.size(); i++) {
XMember member = propertiesMetadata.fieldGetters.get( i );
Object value = getMemberValue( unproxiedInstance, member );
@@ -677,6 +708,11 @@
public final List<PropertiesMetadata> embeddedPropertiesMetadata = new ArrayList<PropertiesMetadata>();
public final List<Container> embeddedContainers = new ArrayList<Container>();
public final List<XMember> containedInGetters = new ArrayList<XMember>();
+ public final List<String> classNames = new ArrayList<String>();
+ public final List<Field.Store> classStores = new ArrayList<Field.Store>();
+ public final List<Field.Index> classIndexes = new ArrayList<Field.Index>();
+ public final List<FieldBridge> classBridges = new ArrayList<FieldBridge>();
+ public final List<Float> classBoosts = new ArrayList<Float>();
public enum Container {
OBJECT,
Modified: search/trunk/src/test/org/hibernate/search/test/PurgeTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/PurgeTest.java 2007-09-09 10:41:51 UTC (rev 14008)
+++ search/trunk/src/test/org/hibernate/search/test/PurgeTest.java 2007-09-13 03:48:51 UTC (rev 14009)
@@ -88,11 +88,16 @@
tx = s.beginTransaction();
- Query query = parser.parse( "brand:Festina or brand:Seiko" );
+ Query query = parser.parse( "brand:Festina or brand:Seiko or brand:Longine or brand:Rolex" );
org.hibernate.Query hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
List results = hibQuery.list();
- assertEquals("incorrect test record count", 0, results.size());
+ assertEquals("class not completely purged", 0, results.size());
+ query = parser.parse( "summary:Festina or summary:gloire" );
+ hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
+ results = hibQuery.list();
+ assertEquals("incorrect class purged", 2, results.size());
+
for (Object element : s.createQuery( "from java.lang.Object" ).list()) s.delete( element );
tx.commit();
s.close();
Added: search/trunk/src/test/org/hibernate/search/test/bridge/CatFieldsClassBridge.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/bridge/CatFieldsClassBridge.java (rev 0)
+++ search/trunk/src/test/org/hibernate/search/test/bridge/CatFieldsClassBridge.java 2007-09-13 03:48:51 UTC (rev 14009)
@@ -0,0 +1,42 @@
+package org.hibernate.search.test.bridge;
+
+import java.util.Map;
+
+import org.hibernate.search.bridge.StringBridge;
+import org.hibernate.search.bridge.ParameterizedBridge;
+import org.hibernate.search.bridge.FieldBridge;
+import org.hibernate.util.StringHelper;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+
+/**
+ * @author John Griffin
+ */
+public class CatFieldsClassBridge implements FieldBridge, ParameterizedBridge {
+
+ private String sepChar;
+
+ public void setParameterValues(Map parameters) {
+ this.sepChar = (String) parameters.get( "sepChar" );
+ }
+
+ public void set(String name, Object value, Document document, Field.Store store, Field.Index index, Float boost) {
+ // In this particular class the name of the new field was passed
+ // from the name field of the ClassBridge Annotation. This is not
+ // a requirement. It just works that way in this instance. The
+ // actual name could be supplied by hard coding it below.
+ Department dep = (Department) value;
+ String fieldValue1 = dep.getBranch();
+ if ( fieldValue1 == null ) {
+ fieldValue1 = "";
+ }
+ String fieldValue2 = dep.getNetwork();
+ if ( fieldValue2 == null ) {
+ fieldValue2 = "";
+ }
+ String fieldValue = fieldValue1 + sepChar + fieldValue2;
+ Field field = new Field( name, fieldValue, store, index );
+ if ( boost != null ) field.setBoost( boost );
+ document.add( field );
+ }
+}
\ No newline at end of file
Added: search/trunk/src/test/org/hibernate/search/test/bridge/ClassBridgeTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/bridge/ClassBridgeTest.java (rev 0)
+++ search/trunk/src/test/org/hibernate/search/test/bridge/ClassBridgeTest.java 2007-09-13 03:48:51 UTC (rev 14009)
@@ -0,0 +1,129 @@
+package org.hibernate.search.test.bridge;
+
+import java.util.List;
+
+import org.apache.lucene.analysis.SimpleAnalyzer;
+import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.search.Query;
+import org.hibernate.Transaction;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.search.Environment;
+import org.hibernate.search.FullTextSession;
+import org.hibernate.search.Search;
+import org.hibernate.search.test.SearchTestCase;
+
+/**
+ * @author John Griffin
+ */
+public class ClassBridgeTest extends SearchTestCase {
+ /**
+ * This test checks for two fields being concatentated by the user-supplied
+ * CatFieldsClassBridge class which is specified as the implementation class
+ * in the ClassBridge annotation of the Department class.
+ *
+ * @throws Exception
+ */
+ public void testClassBridge() throws Exception {
+ org.hibernate.Session s = openSession();
+ Transaction tx = s.beginTransaction();
+ s.persist( getDept1() );
+ s.persist( getDept2() );
+ s.persist( getDept3() );
+ s.flush();
+ tx.commit();
+
+ tx = s.beginTransaction();
+ FullTextSession session = Search.createFullTextSession( s );
+
+ // The branchnetwork field is the concatenation of both
+ // the branch field and the network field of the Department
+ // class. This is in the Lucene document but not in the
+ // Department entity itself.
+ QueryParser parser = new QueryParser( "branchnetwork", new SimpleAnalyzer() );
+
+ Query query = parser.parse( "branchnetwork:layton 2B" );
+ org.hibernate.search.FullTextQuery hibQuery = session.createFullTextQuery( query, Department.class );
+ List result = hibQuery.list();
+ assertNotNull( result );
+ assertEquals( "incorrect entity returned, wrong network", "2B", ( (Department) result.get( 0 ) ).getNetwork() );
+ assertEquals( "incorrect entity returned, wrong branch", "Layton", ( (Department) result.get( 0 ) ).getBranch() );
+ assertEquals( "incorrect number of results returned", 1, result.size() );
+
+ // Partial match.
+ query = parser.parse( "branchnetwork:3c" );
+ hibQuery = session.createFullTextQuery( query, Department.class );
+ result = hibQuery.list();
+ assertNotNull( result );
+ assertEquals( "incorrect entity returned, wrong network", "3C", ( (Department) result.get( 0 ) ).getNetwork() );
+ assertEquals( "incorrect entity returned, wrong branch", "West Valley", ( (Department) result.get( 0 ) ).getBranch() );
+ assertEquals( "incorrect number of results returned", 1, result.size() );
+
+ // No data cross-ups .
+ query = parser.parse( "branchnetwork:Kent Lewin" );
+ hibQuery = session.createFullTextQuery( query, Department.class );
+ result = hibQuery.list();
+ assertNotNull( result );
+ assertTrue( "problem with field cross-ups", result.size() == 0 );
+
+ // Non-ClassBridge field.
+ parser = new QueryParser( "branchHead", new SimpleAnalyzer() );
+ query = parser.parse( "branchHead:Kent Lewin" );
+ hibQuery = session.createFullTextQuery( query, Department.class );
+ result = hibQuery.list();
+ assertNotNull( result );
+ assertTrue( "incorrect entity returned, wrong branch head", result.size() == 1 );
+ assertEquals("incorrect entity returned", "Kent Lewin", ( (Department) result.get( 0 ) ).getBranchHead());
+
+ //cleanup
+ for (Object element : s.createQuery( "from " + Department.class.getName() ).list()) s.delete( element );
+ tx.commit();
+ s.close();
+ }
+
+ private Department getDept1() {
+ Department dept = new Department();
+
+// dept.setId( 1000 );
+ dept.setBranch( "Salt Lake City" );
+ dept.setBranchHead( "Kent Lewin" );
+ dept.setMaxEmployees( 100 );
+ dept.setNetwork( "1A" );
+
+ return dept;
+ }
+
+ private Department getDept2() {
+ Department dept = new Department();
+
+// dept.setId( 1001 );
+ dept.setBranch( "Layton" );
+ dept.setBranchHead( "Terry Poperszky" );
+ dept.setMaxEmployees( 20 );
+ dept.setNetwork( "2B" );
+
+ return dept;
+ }
+
+ private Department getDept3() {
+ Department dept = new Department();
+
+// dept.setId( 1002 );
+ dept.setBranch( "West Valley" );
+ dept.setBranchHead( "Pat Kelley" );
+ dept.setMaxEmployees( 15 );
+ dept.setNetwork( "3C" );
+
+ return dept;
+ }
+
+ protected Class[] getMappings() {
+ return new Class[] {
+ Department.class
+ };
+ }
+
+ protected void configure(Configuration cfg) {
+ super.configure( cfg );
+ cfg.setProperty( Environment.ANALYZER_CLASS, SimpleAnalyzer.class.getName() );
+ }
+}
\ No newline at end of file
Added: search/trunk/src/test/org/hibernate/search/test/bridge/Department.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/bridge/Department.java (rev 0)
+++ search/trunk/src/test/org/hibernate/search/test/bridge/Department.java 2007-09-13 03:48:51 UTC (rev 14009)
@@ -0,0 +1,79 @@
+package org.hibernate.search.test.bridge;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+import org.hibernate.search.annotations.ClassBridge;
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.Parameter;
+import org.hibernate.search.annotations.Store;
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+
+/**
+ * @author John Griffin
+ */
+@Entity
+@Indexed
+@ClassBridge(name="branchnetwork",
+ index=Index.TOKENIZED,
+ store=Store.YES,
+ impl = CatFieldsClassBridge.class,
+ params = @Parameter( name="sepChar", value=" " ) )
+public class Department {
+ private int id;
+ private String network;
+ private String branchHead;
+ private String branch;
+ private Integer maxEmployees;
+
+ @Id
+ @GeneratedValue
+ @DocumentId
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ @Field(index=Index.TOKENIZED, store=Store.YES)
+ public String getBranchHead() {
+ return branchHead;
+ }
+
+ public void setBranchHead(String branchHead) {
+ this.branchHead = branchHead;
+ }
+
+ @Field(index=Index.TOKENIZED, store=Store.YES)
+ public String getNetwork() {
+ return network;
+ }
+
+ public void setNetwork(String network) {
+ this.network = network;
+ }
+
+ @Field(index=Index.TOKENIZED, store=Store.YES)
+ public String getBranch() {
+ return branch;
+ }
+
+ public void setBranch(String branch) {
+ this.branch = branch;
+ }
+
+ @Field(index=Index.UN_TOKENIZED, store=Store.YES)
+ public Integer getMaxEmployees() {
+ return maxEmployees;
+ }
+
+ public void setMaxEmployees(Integer maxEmployees) {
+ this.maxEmployees = maxEmployees;
+ }
+}
\ No newline at end of file
17 years, 2 months
Hibernate SVN: r14008 - search/trunk/doc/reference/en/modules.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2007-09-09 06:41:51 -0400 (Sun, 09 Sep 2007)
New Revision: 14008
Modified:
search/trunk/doc/reference/en/modules/getting-started.xml
Log:
Added maven section to 'getting started'
Modified: search/trunk/doc/reference/en/modules/getting-started.xml
===================================================================
--- search/trunk/doc/reference/en/modules/getting-started.xml 2007-09-08 21:24:35 UTC (rev 14007)
+++ search/trunk/doc/reference/en/modules/getting-started.xml 2007-09-09 10:41:51 UTC (rev 14008)
@@ -64,6 +64,54 @@
</section>
<section>
+ <title>Maven</title>
+
+ <para>Instead of managing all dependencies yourself maven users have the
+ possibility to use the <ulink
+ url="http://repository.jboss.com/maven2">JBoss maven repository</ulink>.
+ Just add the JBoss repository url to the <emphasis>repositories</emphasis>
+ section of your <filename>pom.xml</filename> or
+ <filename>settgins.xml</filename>:</para>
+
+ <programlisting>
+<repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Maven Repository</name>
+ <url>http://repository.jboss.org/maven2</url>
+ <layout>default</layout>
+</repository>
+ </programlisting>
+
+ <para>Then add the following dependencies to your pom.xml:</para>
+
+ <programlisting>
+<dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search</artifactId>
+ <version>3.0.0.CR1</version>
+</dependency>
+<dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <version>3.3.0.ga</version>
+</dependency>
+<dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>3.3.1.ga</version>
+</dependency>
+ </programlisting>
+
+ <para>Not all three dependencies are required.
+ <emphasis>hibernate-search</emphasis> alone contains everything needed to
+ use Hibernate Search. <emphasis>hibernate-annotations</emphasis> is only
+ needed if you use non Hibernate Search annotations like we do in the
+ examples of this tutorial. Last but not least,
+ <emphasis>hibernate-entitymanager</emphasis> is only required if you use
+ Hibernate Search in conjunction with JPA.</para>
+ </section>
+
+ <section>
<title>Configuration</title>
<para>Once you have downloaded and added all required dependencies to your
17 years, 2 months