Author: norman.richards(a)jboss.com
Date: 2009-06-11 11:51:35 -0400 (Thu, 11 Jun 2009)
New Revision: 11122
Modified:
branches/community/Seam_2_2/build/core.pom.xml
branches/community/Seam_2_2/build/ioc.pom.xml
branches/community/Seam_2_2/build/remoting.pom.xml
branches/community/Seam_2_2/build/resteasy.pom.xml
branches/community/Seam_2_2/build/root.pom.xml
branches/community/Seam_2_2/build/ui.pom.xml
branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Dependencies.xml
branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Hsearch.xml
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
Log:
JBSEAM-4201
Modified: branches/community/Seam_2_2/build/core.pom.xml
===================================================================
--- branches/community/Seam_2_2/build/core.pom.xml 2009-06-11 15:27:28 UTC (rev 11121)
+++ branches/community/Seam_2_2/build/core.pom.xml 2009-06-11 15:51:35 UTC (rev 11122)
@@ -17,7 +17,7 @@
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
+ <artifactId>hibernate-core</artifactId>
<optional>true</optional>
</dependency>
Modified: branches/community/Seam_2_2/build/ioc.pom.xml
===================================================================
--- branches/community/Seam_2_2/build/ioc.pom.xml 2009-06-11 15:27:28 UTC (rev 11121)
+++ branches/community/Seam_2_2/build/ioc.pom.xml 2009-06-11 15:51:35 UTC (rev 11122)
@@ -96,7 +96,7 @@
<dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
+ <artifactId>hibernate-core</artifactId>
<optional>true</optional>
</dependency>
Modified: branches/community/Seam_2_2/build/remoting.pom.xml
===================================================================
--- branches/community/Seam_2_2/build/remoting.pom.xml 2009-06-11 15:27:28 UTC (rev
11121)
+++ branches/community/Seam_2_2/build/remoting.pom.xml 2009-06-11 15:51:35 UTC (rev
11122)
@@ -34,7 +34,7 @@
<dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
+ <artifactId>hibernate-core</artifactId>
<optional>true</optional>
</dependency>
Modified: branches/community/Seam_2_2/build/resteasy.pom.xml
===================================================================
--- branches/community/Seam_2_2/build/resteasy.pom.xml 2009-06-11 15:27:28 UTC (rev
11121)
+++ branches/community/Seam_2_2/build/resteasy.pom.xml 2009-06-11 15:51:35 UTC (rev
11122)
@@ -50,7 +50,7 @@
<dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
+ <artifactId>hibernate-core</artifactId>
<scope>provided</scope>
</dependency>
Modified: branches/community/Seam_2_2/build/root.pom.xml
===================================================================
--- branches/community/Seam_2_2/build/root.pom.xml 2009-06-11 15:27:28 UTC (rev 11121)
+++ branches/community/Seam_2_2/build/root.pom.xml 2009-06-11 15:51:35 UTC (rev 11122)
@@ -357,8 +357,8 @@
<dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
- <version>3.2.4.sp1</version>
+ <artifactId>hibernate-core</artifactId>
+ <version>3.3.1.GA</version>
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
@@ -382,7 +382,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
- <version>3.3.0.ga</version>
+ <version>3.4.0.GA</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
@@ -402,7 +402,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
- <version>3.3.1.ga</version>
+ <version>3.4.0.GA</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
@@ -422,7 +422,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.1.0.GA</version>
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
@@ -434,7 +434,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
- <version>3.0.1.GA</version>
+ <version>3.1.1.GA</version>
</dependency>
<dependency>
Modified: branches/community/Seam_2_2/build/ui.pom.xml
===================================================================
--- branches/community/Seam_2_2/build/ui.pom.xml 2009-06-11 15:27:28 UTC (rev 11121)
+++ branches/community/Seam_2_2/build/ui.pom.xml 2009-06-11 15:51:35 UTC (rev 11122)
@@ -148,7 +148,7 @@
<dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
+ <artifactId>hibernate-core</artifactId>
<optional>true</optional>
</dependency>
Modified: branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Dependencies.xml
===================================================================
--- branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Dependencies.xml 2009-06-11
15:27:28 UTC (rev 11121)
+++ branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Dependencies.xml 2009-06-11
15:51:35 UTC (rev 11122)
@@ -1198,8 +1198,8 @@
</dependency>]]></programlisting>
<para>
- This sample POM will give you Seam, JPA (provided by Hibernate) and
- Hibernate Validator:
+ This sample POM will give you Seam, JPA (provided by Hibernate),
+ Hibernate Validator and Hibernate Search:
</para>
<programlisting role="XML"><![CDATA[<?xml version="1.0"
encoding="UTF-8"?>
@@ -1225,25 +1225,31 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.1.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
- <version>3.3.0.ga</version>
+ <version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
- <version>3.3.1.ga</version>
+ <version>3.4.0.GA</version>
</dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search</artifactId>
+ <version>3.1.1.GA</version>
+ </dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
- <version>2.0.0.GA</version>
+ <version>2.2.0.GA</version>
</dependency>
</dependencies>
Modified: branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Hsearch.xml
===================================================================
--- branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Hsearch.xml 2009-06-11
15:27:28 UTC (rev 11121)
+++ branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Hsearch.xml 2009-06-11
15:51:35 UTC (rev 11122)
@@ -18,7 +18,7 @@
and the domain model, and querying mismatch). But the benefits of speed
and efficiency far outweigh these limitations.</para>
- <para>Hibernate Search has been designed to integrates nicely and as
+ <para>Hibernate Search has been designed to integrate nicely and as
naturally as possible with JPA and Hibernate. As a natural extension,
JBoss Seam provides an Hibernate Search integration.</para>
@@ -74,13 +74,17 @@
value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-delete"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
-
+
</properties>
</persistence-unit>]]></programlisting>
<note>
- <para>This step is no longer necessary if Hibernate Annotation or
- EntityManager 3.3.x are used.</para>
+ <para>It is not longer necessary the register the event listeners if
+ Hibernate Annotations or EntityManager 3.3.x are used.
+ When using Hibernate Search 3.1.x more eventlisteners are needed, but
+ these are registered automatically by Hibernate Annotations; refer
+ to the Hibernate Search reference for configuring it without
+ EntityManager and Annotations.</para>
</note>
<para>In addition to the configuration file, the following jars have to be
@@ -203,7 +207,7 @@
<caution>
<para>For people accustomed to Hibernate Search out of Seam, note that
- using <methodname>Search.createFullTextSession</methodname> is not
+ using <methodname>Search.getFullTextSession</methodname> is not
necessary.</para>
</caution>
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java
===================================================================
---
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java 2009-06-11
15:27:28 UTC (rev 11121)
+++
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java 2009-06-11
15:51:35 UTC (rev 11122)
@@ -10,41 +10,48 @@
/**
* Wrap a FullTextEntityManager
- *
+ *
* @author Emmanuel Bernard
+ * @author Sanne Grinovero
*/
public class FullTextEntityManagerProxy extends EntityManagerProxy implements
FullTextEntityManager
{
- private FullTextEntityManager fullTextEntityManager;
-
+
+ private final FullTextEntityManager fullTextEntityManager;
+
public FullTextEntityManagerProxy(FullTextEntityManager entityManager)
{
super(entityManager);
this.fullTextEntityManager = entityManager;
}
-
- public FullTextQuery createFullTextQuery(Query query, Class... classes)
+
+ public FullTextQuery createFullTextQuery(Query query, Class<?>... classes)
{
return fullTextEntityManager.createFullTextQuery(query, classes);
}
-
- public void index(Object object)
+
+ public void flushToIndexes()
{
- fullTextEntityManager.index(object);
+ fullTextEntityManager.flushToIndexes();
}
-
+
+ public <T> void index(T entity)
+ {
+ fullTextEntityManager.index(entity);
+ }
+
public SearchFactory getSearchFactory()
{
return fullTextEntityManager.getSearchFactory();
}
-
- public void purge(Class aClass, Serializable serializable)
+
+ public <T> void purge(Class<T> aClass, Serializable id)
{
- fullTextEntityManager.purge(aClass, serializable);
+ fullTextEntityManager.purge(aClass, id);
}
-
- public void purgeAll(Class aClass)
+
+ public <T> void purgeAll(Class<T> entityType)
{
- fullTextEntityManager.purgeAll(aClass);
+ fullTextEntityManager.purgeAll(entityType);
}
}
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java
===================================================================
---
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java 2009-06-11
15:27:28 UTC (rev 11121)
+++
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java 2009-06-11
15:51:35 UTC (rev 11122)
@@ -7,6 +7,7 @@
import org.hibernate.HibernateException;
import org.hibernate.Query;
+import org.hibernate.jdbc.Work;
import org.hibernate.search.FullTextQuery;
import org.hibernate.search.FullTextSession;
import org.hibernate.search.SearchFactory;
@@ -16,7 +17,7 @@
* Wraps a Hibernate Search session
*
* @author Gavin King
- *
+ * @author Sanne Grinovero
*/
@SuppressWarnings("deprecation")
public class FullTextHibernateSessionProxy extends HibernateSessionProxy implements
FullTextSession
@@ -29,14 +30,14 @@
this.fullTextSession = fullTextSession;
}
- public void index(Object arg0)
+ public <T> void index(T entity)
{
- fullTextSession.index(arg0);
+ fullTextSession.index(entity);
}
- public FullTextQuery createFullTextQuery(org.apache.lucene.search.Query arg0, Class...
arg1)
+ public FullTextQuery createFullTextQuery(org.apache.lucene.search.Query ftQuery,
Class<?>... entityTypes)
{
- return fullTextSession.createFullTextQuery(arg0, arg1);
+ return fullTextSession.createFullTextQuery(ftQuery, entityTypes);
}
public Query createSQLQuery(String arg0, String arg1, Class arg2)
@@ -63,6 +64,16 @@
{
return fullTextSession.delete(arg0);
}
+
+ public void doWork(Work work) throws HibernateException
+ {
+ fullTextSession.doWork(work);
+ }
+
+ public void flushToIndexes()
+ {
+ fullTextSession.flushToIndexes();
+ }
public Collection filter(Object arg0, String arg1, Object arg2, Type arg3) throws
HibernateException
{
@@ -100,12 +111,12 @@
return fullTextSession.getSearchFactory();
}
- public void purge(Class aClass, Serializable serializable)
+ public <T> void purge(Class<T> entityType, Serializable id)
{
- fullTextSession.purge(aClass, serializable);
+ fullTextSession.purge(entityType, id);
}
- public void purgeAll(Class aClass)
+ public <T> void purgeAll(Class<T> aClass)
{
fullTextSession.purgeAll(aClass);
}
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
---
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2009-06-11
15:27:28 UTC (rev 11121)
+++
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2009-06-11
15:51:35 UTC (rev 11122)
@@ -67,12 +67,24 @@
}
if (version != null) {
Class searchClass = Class.forName("org.hibernate.search.Search");
- FULL_TEXT_SESSION_CONSTRUCTOR =
searchClass.getDeclaredMethod("createFullTextSession", Session.class);
+ try {
+ FULL_TEXT_SESSION_CONSTRUCTOR =
searchClass.getDeclaredMethod("getFullTextSession", Session.class);
+ }
+ catch (NoSuchMethodException noSuchMethod) {
+ log.debug("org.hibernate.search.Search.getFullTextSession(Session)
not found, trying deprecated method name createFullTextSession");
+ FULL_TEXT_SESSION_CONSTRUCTOR =
searchClass.getDeclaredMethod("createFullTextSession", Session.class);
+ }
Class fullTextSessionProxyClass =
Class.forName("org.jboss.seam.persistence.FullTextHibernateSessionProxy");
Class fullTextSessionClass =
Class.forName("org.hibernate.search.FullTextSession");
FULL_TEXT_SESSION_PROXY_CONSTRUCTOR =
fullTextSessionProxyClass.getDeclaredConstructor(fullTextSessionClass);
Class jpaSearchClass =
Class.forName("org.hibernate.search.jpa.Search");
- FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR =
jpaSearchClass.getDeclaredMethod("createFullTextEntityManager",
EntityManager.class);
+ try {
+ FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR =
jpaSearchClass.getDeclaredMethod("getFullTextEntityManager",
EntityManager.class);
+ }
+ catch (NoSuchMethodException noSuchMethod) {
+ log.debug("org.hibernate.search.jpa.getFullTextSession(EntityManager)
not found, trying deprecated method name createFullTextEntityManager");
+ FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR =
jpaSearchClass.getDeclaredMethod("createFullTextEntityManager",
EntityManager.class);
+ }
Class fullTextEntityManagerProxyClass =
Class.forName("org.jboss.seam.persistence.FullTextEntityManagerProxy");
Class fullTextEntityManagerClass =
Class.forName("org.hibernate.search.jpa.FullTextEntityManager");
FULL_TEXT_ENTITYMANAGER_PROXY_CONSTRUCTOR =
fullTextEntityManagerProxyClass.getDeclaredConstructor(fullTextEntityManagerClass);
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
===================================================================
---
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java 2009-06-11
15:27:28 UTC (rev 11121)
+++
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java 2009-06-11
15:51:35 UTC (rev 11122)
@@ -37,6 +37,7 @@
import org.hibernate.impl.CriteriaImpl;
import org.hibernate.jdbc.Batcher;
import org.hibernate.jdbc.JDBCContext;
+import org.hibernate.jdbc.Work;
import org.hibernate.loader.custom.CustomQuery;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.stat.SessionStatistics;
@@ -165,6 +166,11 @@
{
return delegate.disconnect();
}
+
+ public void doWork(Work work) throws HibernateException
+ {
+ delegate.doWork(work);
+ }
public Filter enableFilter(String arg0)
{