Hibernate SVN: r11721 - core.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-06-29 15:17:40 -0400 (Fri, 29 Jun 2007)
New Revision: 11721
Added:
core/tags/
Log:
starting SVN layout migration for core
17 years, 5 months
Hibernate SVN: r11720 - core.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-06-29 15:17:26 -0400 (Fri, 29 Jun 2007)
New Revision: 11720
Added:
core/branches/
Log:
starting SVN layout migration for core
17 years, 5 months
Hibernate SVN: r11719 - core.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-06-29 15:17:02 -0400 (Fri, 29 Jun 2007)
New Revision: 11719
Added:
core/trunk/
Log:
starting SVN layout migration for core
17 years, 5 months
Hibernate SVN: r11718 - /.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-06-29 15:16:45 -0400 (Fri, 29 Jun 2007)
New Revision: 11718
Added:
core/
Log:
starting SVN layout migration for core
17 years, 5 months
Hibernate SVN: r11717 - trunk/HibernateExt/validator/src/java/org/hibernate/validator.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-06-29 12:15:01 -0400 (Fri, 29 Jun 2007)
New Revision: 11717
Modified:
trunk/HibernateExt/validator/src/java/org/hibernate/validator/ClassValidator.java
Log:
minor
Modified: trunk/HibernateExt/validator/src/java/org/hibernate/validator/ClassValidator.java
===================================================================
--- trunk/HibernateExt/validator/src/java/org/hibernate/validator/ClassValidator.java 2007-06-28 15:46:14 UTC (rev 11716)
+++ trunk/HibernateExt/validator/src/java/org/hibernate/validator/ClassValidator.java 2007-06-29 16:15:01 UTC (rev 11717)
@@ -479,6 +479,7 @@
Class clazz = value.getClass();
ClassValidator validator = childClassValidators.get( reflectionManager.toXClass( clazz ) );
if ( validator == null ) { //handles polymorphism
+ //TODO cache this thing. in a second queue (reflectionManager being sealed)? beware of concurrency
validator = new ClassValidator( clazz );
}
return validator;
17 years, 5 months
Hibernate SVN: r11716 - in trunk/HibernateExt/search/src/java/org/hibernate/search: jpa and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-06-28 11:46:14 -0400 (Thu, 28 Jun 2007)
New Revision: 11716
Modified:
trunk/HibernateExt/search/src/java/org/hibernate/search/Search.java
trunk/HibernateExt/search/src/java/org/hibernate/search/jpa/Search.java
Log:
HSEARCH-91 do no wrap FullText* more than once
Modified: trunk/HibernateExt/search/src/java/org/hibernate/search/Search.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/Search.java 2007-06-28 15:37:54 UTC (rev 11715)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/Search.java 2007-06-28 15:46:14 UTC (rev 11716)
@@ -14,6 +14,11 @@
}
public static FullTextSession createFullTextSession(Session session) {
- return new FullTextSessionImpl(session);
+ if (session instanceof FullTextSessionImpl) {
+ return (FullTextSession) session;
+ }
+ else {
+ return new FullTextSessionImpl(session);
+ }
}
}
\ No newline at end of file
Modified: trunk/HibernateExt/search/src/java/org/hibernate/search/jpa/Search.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/jpa/Search.java 2007-06-28 15:37:54 UTC (rev 11715)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/jpa/Search.java 2007-06-28 15:46:14 UTC (rev 11716)
@@ -19,6 +19,11 @@
* The underlying EM implementation has to be Hibernate EntityManager
*/
public static FullTextEntityManager createFullTextEntityManager(EntityManager em) {
- return new FullTextEntityManagerImpl(em);
+ if ( em instanceof FullTextEntityManagerImpl ) {
+ return (FullTextEntityManager) em;
+ }
+ else {
+ return new FullTextEntityManagerImpl(em);
+ }
}
}
\ No newline at end of file
17 years, 5 months
Hibernate SVN: r11715 - in trunk/HibernateExt/search/src: java/org/hibernate/search/engine and 4 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-06-28 11:37:54 -0400 (Thu, 28 Jun 2007)
New Revision: 11715
Added:
trunk/HibernateExt/search/src/java/org/hibernate/search/annotations/Analyzer.java
trunk/HibernateExt/search/src/java/org/hibernate/search/util/ScopedAnalyzer.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/
trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/AbstractTestAnalyzer.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/AnalyzerTest.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/MyComponent.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/MyEntity.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test1Analyzer.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test2Analyzer.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test3Analyzer.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test4Analyzer.java
Modified:
trunk/HibernateExt/search/src/java/org/hibernate/search/annotations/Field.java
trunk/HibernateExt/search/src/java/org/hibernate/search/engine/DocumentBuilder.java
trunk/HibernateExt/search/src/java/org/hibernate/search/impl/SearchFactoryImpl.java
Log:
HSEARCH-41 Add scoped Analyzer
Added: trunk/HibernateExt/search/src/java/org/hibernate/search/annotations/Analyzer.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/annotations/Analyzer.java (rev 0)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/annotations/Analyzer.java 2007-06-28 15:37:54 UTC (rev 11715)
@@ -0,0 +1,26 @@
+//$Id$
+package org.hibernate.search.annotations;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Documented;
+
+/**
+ * Define an Analizer for a given entity, method, field or Field
+ * The order of precedence is as such:
+ * - @Field
+ * - field / method
+ * - entity
+ * - default
+ *
+ * @author Emmanuel Bernard
+ */
+@Retention( RetentionPolicy.RUNTIME )
+@Target( { ElementType.TYPE, ElementType.FIELD, ElementType.METHOD} )
+@Documented
+
+public @interface Analyzer {
+ Class impl() default void.class;
+}
Modified: trunk/HibernateExt/search/src/java/org/hibernate/search/annotations/Field.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/annotations/Field.java 2007-06-24 18:00:46 UTC (rev 11714)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/annotations/Field.java 2007-06-28 15:37:54 UTC (rev 11715)
@@ -35,4 +35,10 @@
*/
Index index();
+ /**
+ * Define an analyzer for the field, default to
+ * the inherited analyzer
+ */
+ Analyzer analyzer() default @Analyzer;
+
}
Modified: trunk/HibernateExt/search/src/java/org/hibernate/search/engine/DocumentBuilder.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/engine/DocumentBuilder.java 2007-06-24 18:00:46 UTC (rev 11714)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/engine/DocumentBuilder.java 2007-06-28 15:37:54 UTC (rev 11715)
@@ -45,6 +45,7 @@
import org.hibernate.search.bridge.TwoWayFieldBridge;
import org.hibernate.search.store.DirectoryProvider;
import org.hibernate.search.util.BinderHelper;
+import org.hibernate.search.util.ScopedAnalyzer;
/**
* Set up and provide a manager for indexes classes
@@ -57,12 +58,11 @@
public class DocumentBuilder<T> {
private static final Log log = LogFactory.getLog( DocumentBuilder.class );
- private final PropertiesMetadata rootPropertiesMetadata = new PropertiesMetadata();
+ private final PropertiesMetadata rootPropertiesMetadata;
private final XClass beanClass;
private final DirectoryProvider directoryProvider;
private String idKeywordName;
private XMember idGetter;
- private final Analyzer analyzer;
private Float idBoost;
public static final String CLASS_FIELDNAME = "_hibernate_class";
private TwoWayFieldBridge idBridge;
@@ -70,32 +70,73 @@
private ReflectionManager reflectionManager;
private int level = 0;
private int maxLevel = Integer.MAX_VALUE;
+ private ScopedAnalyzer analyzer;
- public DocumentBuilder(XClass clazz, Analyzer analyzer, DirectoryProvider directory,
+ public DocumentBuilder(XClass clazz, Analyzer defaultAnalyzer, DirectoryProvider directory,
ReflectionManager reflectionManager) {
+ this.analyzer = new ScopedAnalyzer();
this.beanClass = clazz;
- this.analyzer = analyzer;
this.directoryProvider = directory;
//FIXME get rid of it when boost is stored?
this.reflectionManager = reflectionManager;
if ( clazz == null ) throw new AssertionFailure( "Unable to build a DocumemntBuilder with a null class" );
-
+ rootPropertiesMetadata = new PropertiesMetadata();
rootPropertiesMetadata.boost = getBoost( clazz );
+ rootPropertiesMetadata.analyzer = defaultAnalyzer;
Set<XClass> processedClasses = new HashSet<XClass>();
processedClasses.add( clazz );
initializeMembers(clazz, rootPropertiesMetadata, true, "", processedClasses );
//processedClasses.remove( clazz ); for the sake of completness
-
+ this.analyzer.setGlobalAnalyzer( rootPropertiesMetadata.analyzer );
if ( idKeywordName == null ) {
throw new SearchException( "No document id in: " + clazz.getName() );
}
}
+ private Analyzer getAnalyzer(XAnnotatedElement annotatedElement) {
+ org.hibernate.search.annotations.Analyzer analyzerAnn =
+ annotatedElement.getAnnotation( org.hibernate.search.annotations.Analyzer.class );
+ return getAnalyzer( analyzerAnn );
+ }
+
+ private Analyzer getAnalyzer(org.hibernate.search.annotations.Analyzer analyzerAnn) {
+ Class analyzerClass = analyzerAnn == null ? void.class : analyzerAnn.impl();
+ if ( analyzerClass == void.class ) {
+ return null;
+ }
+ else {
+ try {
+ return (Analyzer) analyzerClass.newInstance();
+ }
+ catch (ClassCastException e) {
+ throw new SearchException(
+ "Lucene analyzer does not implement " + Analyzer.class.getName() + ": " + analyzerClass.getName(), e
+ );
+ }
+ catch (Exception e) {
+ throw new SearchException( "Failed to instantiate lucene analyzer with type " + analyzerClass.getName(), e );
+ }
+ }
+ }
+
private void initializeMembers(XClass clazz, PropertiesMetadata propertiesMetadata, boolean isRoot, String prefix,
Set<XClass> processedClasses) {
+ List<XClass> hierarchy = new ArrayList<XClass>();
for ( XClass currClass = clazz; currClass != null; currClass = currClass.getSuperclass() ) {
+ hierarchy.add( currClass );
+ }
+ for (int index = hierarchy.size() -1 ; index >= 0 ; index--) {
+ XClass currClass = hierarchy.get( index );
+ /**
+ * Override the default analyzer for the properties if the class hold one
+ * That's the reason we go down the hierarchy
+ */
+ Analyzer analyzer = getAnalyzer( currClass );
+ if ( analyzer != null) {
+ propertiesMetadata.analyzer = analyzer;
+ }
//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 ) {
@@ -181,10 +222,17 @@
if ( fieldAnn != null ) {
setAccessible( member );
propertiesMetadata.fieldGetters.add( member );
- propertiesMetadata.fieldNames.add( prefix + BinderHelper.getAttributeName( member, fieldAnn.name() ) );
+ String fieldName = prefix + BinderHelper.getAttributeName( member, fieldAnn.name() );
+ propertiesMetadata.fieldNames.add( fieldName );
propertiesMetadata.fieldStore.add( getStore( fieldAnn.store() ) );
propertiesMetadata.fieldIndex.add( getIndex( fieldAnn.index() ) );
propertiesMetadata.fieldBridges.add( BridgeFactory.guessType( member ) );
+ // Field > property > entity analyzer
+ Analyzer analyzer = getAnalyzer( fieldAnn.analyzer() );
+ if (analyzer == null) analyzer = getAnalyzer( member );
+ if (analyzer == null) analyzer = propertiesMetadata.analyzer;
+ if (analyzer == null) throw new AssertionFailure( "Analizer should not be undefined" );
+ this.analyzer.addScopedAnalyzer( fieldName, analyzer );
}
IndexedEmbedded embeddedAnn = member.getAnnotation( IndexedEmbedded.class );
@@ -211,6 +259,9 @@
PropertiesMetadata metadata = new PropertiesMetadata();
propertiesMetadata.embeddedPropertiesMetadata.add(metadata);
metadata.boost = getBoost( member );
+ //property > entity analyzer
+ Analyzer analyzer = getAnalyzer( member );
+ metadata.analyzer = analyzer != null ? analyzer : propertiesMetadata.analyzer;
String localPrefix = buildEmbeddedPrefix( prefix, embeddedAnn, member );
initializeMembers( elementClass, metadata, false, localPrefix, processedClasses);
/**
@@ -623,7 +674,8 @@
}
private static class PropertiesMetadata {
- public Float boost = null;
+ public Float boost;
+ public Analyzer analyzer;
public final List<XMember> keywordGetters = new ArrayList<XMember>();
public final List<String> keywordNames = new ArrayList<String>();
public final List<FieldBridge> keywordBridges = new ArrayList<FieldBridge>();
Modified: trunk/HibernateExt/search/src/java/org/hibernate/search/impl/SearchFactoryImpl.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/impl/SearchFactoryImpl.java 2007-06-24 18:00:46 UTC (rev 11714)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/impl/SearchFactoryImpl.java 2007-06-28 15:37:54 UTC (rev 11715)
@@ -85,17 +85,17 @@
analyzerClass = StandardAnalyzer.class;
}
// Initialize analyzer
- Analyzer analyzer;
+ Analyzer defaultAnalyzer;
try {
- analyzer = (Analyzer) analyzerClass.newInstance();
+ defaultAnalyzer = (Analyzer) analyzerClass.newInstance();
}
catch (ClassCastException e) {
throw new SearchException(
- "Lucene analyzer does not implement " + Analyzer.class.getName() + ": " + analyzerClassName
+ "Lucene analyzer does not implement " + Analyzer.class.getName() + ": " + analyzerClassName, e
);
}
catch (Exception e) {
- throw new SearchException( "Failed to instantiate lucene analyzer with type " + analyzerClassName );
+ throw new SearchException( "Failed to instantiate lucene analyzer with type " + analyzerClassName, e );
}
Iterator iter = cfg.getClassMappings();
@@ -112,7 +112,7 @@
lockableDirectoryProviders.put( provider, new ReentrantLock() );
}
final DocumentBuilder<Object> documentBuilder = new DocumentBuilder<Object>(
- mappedXClass, analyzer, provider, reflectionManager
+ mappedXClass, defaultAnalyzer, provider, reflectionManager
);
documentBuilders.put( mappedClass, documentBuilder );
Added: trunk/HibernateExt/search/src/java/org/hibernate/search/util/ScopedAnalyzer.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/util/ScopedAnalyzer.java (rev 0)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/util/ScopedAnalyzer.java 2007-06-28 15:37:54 UTC (rev 11715)
@@ -0,0 +1,43 @@
+//$Id$
+package org.hibernate.search.util;
+
+import java.io.Reader;
+import java.util.Map;
+import java.util.HashMap;
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.TokenStream;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class ScopedAnalyzer extends Analyzer {
+ public ScopedAnalyzer() {}
+
+ private Analyzer globalAnalyzer;
+ private Map<String, Analyzer> scopedAnalyzers = new HashMap<String, Analyzer>();
+
+ public void setGlobalAnalyzer(Analyzer globalAnalyzer) {
+ this.globalAnalyzer = globalAnalyzer;
+ }
+
+ public void addScopedAnalyzer(String scope, Analyzer scopedAnalyzer) {
+ scopedAnalyzers.put( scope, scopedAnalyzer );
+ }
+
+ public TokenStream tokenStream(String fieldName, Reader reader) {
+ return getAnalyzer( fieldName ).tokenStream( fieldName, reader );
+ }
+
+ public int getPositionIncrementGap(String fieldName) {
+ return getAnalyzer( fieldName ).getPositionIncrementGap( fieldName );
+ }
+
+ private Analyzer getAnalyzer(String fieldName) {
+ Analyzer analyzer = scopedAnalyzers.get( fieldName );
+ if (analyzer == null) {
+ analyzer = globalAnalyzer;
+ }
+ return analyzer;
+ }
+}
Added: trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/AbstractTestAnalyzer.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/AbstractTestAnalyzer.java (rev 0)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/AbstractTestAnalyzer.java 2007-06-28 15:37:54 UTC (rev 11715)
@@ -0,0 +1,35 @@
+//$Id$
+package org.hibernate.search.test.analyzer;
+
+import java.io.Reader;
+import java.io.IOException;
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.analysis.Token;
+
+
+/**
+ * @author Emmanuel Bernard
+ */
+public abstract class AbstractTestAnalyzer extends Analyzer {
+
+ protected abstract String[] getTokens();
+
+ public TokenStream tokenStream(String fieldName, Reader reader) {
+ return new InternalTokenStream();
+ }
+
+ private class InternalTokenStream extends TokenStream {
+ private int position;
+
+ public Token next() throws IOException {
+ if ( position >= getTokens().length) {
+ return null;
+ }
+ else {
+ return new Token( getTokens()[position++], 0, 0 );
+ }
+ }
+ }
+}
Added: trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/AnalyzerTest.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/AnalyzerTest.java (rev 0)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/AnalyzerTest.java 2007-06-28 15:37:54 UTC (rev 11715)
@@ -0,0 +1,61 @@
+//$Id$
+package org.hibernate.search.test.analyzer;
+
+import org.hibernate.search.test.SearchTestCase;
+import org.hibernate.search.FullTextSession;
+import org.hibernate.search.Search;
+import org.hibernate.search.FullTextQuery;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.Query;
+import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class AnalyzerTest extends SearchTestCase {
+
+ public void testScopedAnalyzers() throws Exception {
+ MyEntity en = new MyEntity();
+ en.setEntity( "Entity" );
+ en.setField( "Field" );
+ en.setProperty( "Property" );
+ en.setComponent( new MyComponent() );
+ en.getComponent().setComponentProperty( "component property" );
+ FullTextSession s = Search.createFullTextSession( openSession() );
+ Transaction tx = s.beginTransaction();
+ s.persist( en );
+ tx.commit();
+
+ tx = s.beginTransaction();
+ QueryParser parser = new QueryParser("id", new StandardAnalyzer() );
+ org.apache.lucene.search.Query luceneQuery = parser.parse( "entity:alarm");
+ FullTextQuery query = s.createFullTextQuery( luceneQuery, MyEntity.class );
+ assertEquals( 1, query.getResultSize() );
+
+ luceneQuery = parser.parse( "property:cat");
+ query = s.createFullTextQuery( luceneQuery, MyEntity.class );
+ assertEquals( 1, query.getResultSize() );
+
+ luceneQuery = parser.parse( "field:energy");
+ query = s.createFullTextQuery( luceneQuery, MyEntity.class );
+ assertEquals( 1, query.getResultSize() );
+
+ luceneQuery = parser.parse( "component.componentProperty:noise");
+ query = s.createFullTextQuery( luceneQuery, MyEntity.class );
+ assertEquals( 1, query.getResultSize() );
+
+ s.delete( query.uniqueResult() );
+ tx.commit();
+
+ s.close();
+
+ }
+
+ protected Class[] getMappings() {
+ return new Class[] {
+ MyEntity.class
+ };
+ }
+}
Added: trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/MyComponent.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/MyComponent.java (rev 0)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/MyComponent.java 2007-06-28 15:37:54 UTC (rev 11715)
@@ -0,0 +1,23 @@
+//$Id$
+package org.hibernate.search.test.analyzer;
+
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Analyzer;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class MyComponent {
+ @Field(index = Index.TOKENIZED)
+ @Analyzer(impl = Test4Analyzer.class)
+ private String componentProperty;
+
+ public String getComponentProperty() {
+ return componentProperty;
+ }
+
+ public void setComponentProperty(String componentProperty) {
+ this.componentProperty = componentProperty;
+ }
+}
Added: trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/MyEntity.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/MyEntity.java (rev 0)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/MyEntity.java 2007-06-28 15:37:54 UTC (rev 11715)
@@ -0,0 +1,82 @@
+//$Id$
+package org.hibernate.search.test.analyzer;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Embedded;
+
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Analyzer;
+import org.hibernate.search.annotations.IndexedEmbedded;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Entity
+@Indexed
+@Analyzer(impl = Test1Analyzer.class)
+public class MyEntity {
+ @Id
+ @GeneratedValue
+ @DocumentId
+ private Integer id;
+
+ @Field(index = Index.TOKENIZED)
+ private String entity;
+
+ @Field(index = Index.TOKENIZED)
+ @Analyzer(impl = Test2Analyzer.class)
+ private String property;
+
+ @Field(index = Index.TOKENIZED, analyzer = @Analyzer(impl = Test3Analyzer.class) )
+ @Analyzer(impl = Test2Analyzer.class)
+ private String field;
+
+ @IndexedEmbedded
+ @Embedded
+ private MyComponent component;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getEntity() {
+ return entity;
+ }
+
+ public void setEntity(String entity) {
+ this.entity = entity;
+ }
+
+ public String getProperty() {
+ return property;
+ }
+
+ public void setProperty(String property) {
+ this.property = property;
+ }
+
+ public String getField() {
+ return field;
+ }
+
+ public void setField(String field) {
+ this.field = field;
+ }
+
+ public MyComponent getComponent() {
+ return component;
+ }
+
+ public void setComponent(MyComponent component) {
+ this.component = component;
+ }
+}
Added: trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test1Analyzer.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test1Analyzer.java (rev 0)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test1Analyzer.java 2007-06-28 15:37:54 UTC (rev 11715)
@@ -0,0 +1,13 @@
+//$Id$
+package org.hibernate.search.test.analyzer;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class Test1Analyzer extends AbstractTestAnalyzer {
+ private final String[] tokens = { "alarm", "dog", "performance" };
+
+ protected String[] getTokens() {
+ return tokens;
+ }
+}
Added: trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test2Analyzer.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test2Analyzer.java (rev 0)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test2Analyzer.java 2007-06-28 15:37:54 UTC (rev 11715)
@@ -0,0 +1,13 @@
+//$Id$
+package org.hibernate.search.test.analyzer;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class Test2Analyzer extends AbstractTestAnalyzer {
+ private final String[] tokens = { "sound", "cat", "speed" };
+
+ protected String[] getTokens() {
+ return tokens;
+ }
+}
Added: trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test3Analyzer.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test3Analyzer.java (rev 0)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test3Analyzer.java 2007-06-28 15:37:54 UTC (rev 11715)
@@ -0,0 +1,13 @@
+//$Id$
+package org.hibernate.search.test.analyzer;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class Test3Analyzer extends AbstractTestAnalyzer {
+ private final String[] tokens = { "music", "elephant", "energy" };
+
+ protected String[] getTokens() {
+ return tokens;
+ }
+}
Added: trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test4Analyzer.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test4Analyzer.java (rev 0)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/analyzer/Test4Analyzer.java 2007-06-28 15:37:54 UTC (rev 11715)
@@ -0,0 +1,13 @@
+//$Id$
+package org.hibernate.search.test.analyzer;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class Test4Analyzer extends AbstractTestAnalyzer {
+ private final String[] tokens = { "noise", "mouse", "light" };
+
+ protected String[] getTokens() {
+ return tokens;
+ }
+}
17 years, 5 months
Hibernate SVN: r11714 - in trunk/HibernateExt/search/src: java/org/hibernate/search/jpa/impl and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-06-24 14:00:46 -0400 (Sun, 24 Jun 2007)
New Revision: 11714
Added:
trunk/HibernateExt/search/src/java/org/hibernate/search/jpa/Search.java
trunk/HibernateExt/search/src/java/org/hibernate/search/jpa/impl/FullTextQueryImpl.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/jpa/
trunk/HibernateExt/search/src/test/org/hibernate/search/test/jpa/Bretzel.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/jpa/EntityManagerTest.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/jpa/JPATestCase.java
Log:
HSEARCH-89 JPA wrappers implementation
Added: trunk/HibernateExt/search/src/java/org/hibernate/search/jpa/Search.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/jpa/Search.java (rev 0)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/jpa/Search.java 2007-06-24 18:00:46 UTC (rev 11714)
@@ -0,0 +1,24 @@
+//$Id$
+package org.hibernate.search.jpa;
+
+import javax.persistence.EntityManager;
+
+import org.hibernate.search.jpa.impl.FullTextEntityManagerImpl;
+
+/**
+ * Helper class that should be used when building a FullTextEntityManager
+ *
+ * @author Emmanuel Bernard
+ */
+public final class Search {
+ private Search() {
+ }
+
+ /**
+ * Build a full text capable EntityManager
+ * The underlying EM implementation has to be Hibernate EntityManager
+ */
+ public static FullTextEntityManager createFullTextEntityManager(EntityManager em) {
+ return new FullTextEntityManagerImpl(em);
+ }
+}
\ No newline at end of file
Added: trunk/HibernateExt/search/src/java/org/hibernate/search/jpa/impl/FullTextQueryImpl.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/jpa/impl/FullTextQueryImpl.java (rev 0)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/jpa/impl/FullTextQueryImpl.java 2007-06-24 18:00:46 UTC (rev 11714)
@@ -0,0 +1,247 @@
+//$Id$
+package org.hibernate.search.jpa.impl;
+
+import java.util.List;
+import java.util.Date;
+import java.util.Calendar;
+import java.util.Set;
+import java.util.HashSet;
+import java.io.Serializable;
+import javax.persistence.Query;
+import javax.persistence.TemporalType;
+import javax.persistence.FlushModeType;
+import javax.persistence.NoResultException;
+import javax.persistence.NonUniqueResultException;
+import javax.persistence.PersistenceException;
+import javax.persistence.EntityExistsException;
+import javax.persistence.EntityNotFoundException;
+import javax.persistence.OptimisticLockException;
+
+import org.hibernate.search.jpa.FullTextQuery;
+import org.hibernate.search.SearchException;
+import org.hibernate.Criteria;
+import org.hibernate.TypeMismatchException;
+import org.hibernate.HibernateException;
+import org.hibernate.StaleStateException;
+import org.hibernate.ObjectNotFoundException;
+import org.hibernate.UnresolvableObjectException;
+import org.hibernate.QueryException;
+import org.hibernate.TransientObjectException;
+import org.hibernate.StaleObjectStateException;
+import org.hibernate.Session;
+import org.hibernate.FlushMode;
+import org.hibernate.exception.ConstraintViolationException;
+import org.hibernate.hql.QueryExecutionRequestException;
+import org.apache.lucene.search.Sort;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class FullTextQueryImpl implements FullTextQuery {
+ private final org.hibernate.search.FullTextQuery query;
+ private Session session;
+
+ public FullTextQueryImpl(org.hibernate.search.FullTextQuery query, Session session) {
+ this.query = query;
+ this.session = session;
+ }
+
+ public FullTextQuery setSort(Sort sort) {
+ query.setSort( sort );
+ return this;
+ }
+
+ public int getResultSize() {
+ return query.getResultSize();
+ }
+
+ public FullTextQuery setCriteriaQuery(Criteria criteria) {
+ query.setCriteriaQuery( criteria );
+ return this;
+ }
+
+ public FullTextQuery setIndexProjection(String... fields) {
+ query.setIndexProjection( fields );
+ return this;
+ }
+
+ public List getResultList() {
+ try {
+ return query.list();
+ }
+ catch (QueryExecutionRequestException he) {
+ //TODO when an illegal state exceptio should be raised?
+ throw new IllegalStateException(he);
+ }
+ catch( TypeMismatchException e ) {
+ //TODO when an illegal arg exceptio should be raised?
+ throw new IllegalArgumentException(e);
+ }
+ catch (SearchException he) {
+ throwPersistenceException( he );
+ throw he;
+ }
+ }
+
+ //TODO mutualize this code with the EM this will fix the rollback issues
+ private void throwPersistenceException(Exception e) {
+ if ( e instanceof StaleStateException ) {
+ PersistenceException pe = wrapStaleStateException( (StaleStateException) e );
+ throwPersistenceException( pe );
+ }
+ else if ( e instanceof ConstraintViolationException ) {
+ //FIXME this is bad cause ConstraintViolationException happens in other circumstances
+ throwPersistenceException( new EntityExistsException( e ) );
+ }
+ else if ( e instanceof ObjectNotFoundException ) {
+ throwPersistenceException( new EntityNotFoundException( e.getMessage() ) );
+ }
+ else if ( e instanceof org.hibernate.NonUniqueResultException ) {
+ throwPersistenceException( new NonUniqueResultException( e.getMessage() ) );
+ }
+ else if ( e instanceof UnresolvableObjectException ) {
+ throwPersistenceException( new EntityNotFoundException( e.getMessage() ) );
+ }
+ else if ( e instanceof QueryException ) {
+ throw new IllegalArgumentException( e );
+ }
+ else if ( e instanceof TransientObjectException ) {
+ //FIXME rollback
+ throw new IllegalStateException( e ); //Spec 3.2.3 Synchronization rules
+ }
+ else {
+ throwPersistenceException( new PersistenceException( e ) );
+ }
+ }
+
+ public void throwPersistenceException(PersistenceException e) {
+ if ( ! ( e instanceof NoResultException || e instanceof NonUniqueResultException ) ) {
+ //FIXME rollback
+ }
+ throw e;
+ }
+
+ public PersistenceException wrapStaleStateException(StaleStateException e) {
+ PersistenceException pe;
+ if ( e instanceof StaleObjectStateException ) {
+ StaleObjectStateException sose = (StaleObjectStateException) e;
+ Serializable identifier = sose.getIdentifier();
+ if (identifier != null) {
+ Object entity = session.load( sose.getEntityName(), identifier );
+ if ( entity instanceof Serializable ) {
+ //avoid some user errors regarding boundary crossing
+ pe = new OptimisticLockException( null, e, entity );
+ }
+ else {
+ pe = new OptimisticLockException( e );
+ }
+ }
+ else {
+ pe = new OptimisticLockException( e );
+ }
+ }
+ else {
+ pe = new OptimisticLockException( e );
+ }
+ return pe;
+ }
+
+ public Object getSingleResult() {
+ try {
+ List result = query.list();
+ if ( result.size() == 0 ) {
+ throwPersistenceException( new NoResultException( "No entity found for query" ) );
+ }
+ else if ( result.size() > 1 ) {
+ Set uniqueResult = new HashSet(result);
+ if ( uniqueResult.size() > 1 ) {
+ throwPersistenceException( new NonUniqueResultException( "result returns " + uniqueResult.size() + " elements") );
+ }
+ else {
+ return uniqueResult.iterator().next();
+ }
+
+ }
+ else {
+ return result.get(0);
+ }
+ return null; //should never happen
+ }
+ catch (QueryExecutionRequestException he) {
+ throw new IllegalStateException(he);
+ }
+ catch( TypeMismatchException e ) {
+ throw new IllegalArgumentException(e);
+ }
+ catch (HibernateException he) {
+ throwPersistenceException( he );
+ return null;
+ }
+ }
+
+ public Query setMaxResults(int maxResult) {
+ if ( maxResult < 0 ) {
+ throw new IllegalArgumentException(
+ "Negative ("
+ + maxResult
+ + ") parameter passed in to setMaxResults"
+ );
+ }
+ query.setMaxResults( maxResult );
+ return this;
+ }
+
+ public Query setFirstResult(int firstResult) {
+ if ( firstResult < 0 ) {
+ throw new IllegalArgumentException(
+ "Negative ("
+ + firstResult
+ + ") parameter passed in to setFirstResult"
+ );
+ }
+ query.setFirstResult( firstResult );
+ return this;
+ }
+
+ public int executeUpdate() {
+ throw new IllegalStateException( "Update not allowed in FullTextQueries" );
+ }
+
+ public Query setHint(String hintName, Object value) {
+ return this;
+ }
+
+ public Query setParameter(String name, Object value) {
+ throw new UnsupportedOperationException( "parameters not supported in fullText queries");
+ }
+
+ public Query setParameter(String name, Date value, TemporalType temporalType) {
+ throw new UnsupportedOperationException( "parameters not supported in fullText queries");
+ }
+
+ public Query setParameter(String name, Calendar value, TemporalType temporalType) {
+ throw new UnsupportedOperationException( "parameters not supported in fullText queries");
+ }
+
+ public Query setParameter(int position, Object value) {
+ throw new UnsupportedOperationException( "parameters not supported in fullText queries");
+ }
+
+ public Query setParameter(int position, Date value, TemporalType temporalType) {
+ throw new UnsupportedOperationException( "parameters not supported in fullText queries");
+ }
+
+ public Query setParameter(int position, Calendar value, TemporalType temporalType) {
+ throw new UnsupportedOperationException( "parameters not supported in fullText queries");
+ }
+
+ public Query setFlushMode(FlushModeType flushMode) {
+ if ( flushMode == FlushModeType.AUTO ) {
+ query.setFlushMode( FlushMode.AUTO );
+ }
+ else if ( flushMode == FlushModeType.COMMIT ) {
+ query.setFlushMode( FlushMode.COMMIT );
+ }
+ return this;
+ }
+}
Added: trunk/HibernateExt/search/src/test/org/hibernate/search/test/jpa/Bretzel.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/jpa/Bretzel.java (rev 0)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/jpa/Bretzel.java 2007-06-24 18:00:46 UTC (rev 11714)
@@ -0,0 +1,63 @@
+//$Id$
+package org.hibernate.search.test.jpa;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.GeneratedValue;
+
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Index;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Entity
+@Indexed
+public class Bretzel {
+ @Id
+ @GeneratedValue
+ @DocumentId
+ private Integer id;
+
+ @Field(index = Index.UN_TOKENIZED)
+ private float saltQty;
+
+ @Field(index = Index.UN_TOKENIZED)
+ private float weight;
+
+
+ public Bretzel() {
+ }
+
+ public Bretzel(float saltQty, float weight) {
+ this.saltQty = saltQty;
+ this.weight = weight;
+ }
+
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public float getSaltQty() {
+ return saltQty;
+ }
+
+ public void setSaltQty(float saltQty) {
+ this.saltQty = saltQty;
+ }
+
+ public float getWeight() {
+ return weight;
+ }
+
+ public void setWeight(float weight) {
+ this.weight = weight;
+ }
+}
Added: trunk/HibernateExt/search/src/test/org/hibernate/search/test/jpa/EntityManagerTest.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/jpa/EntityManagerTest.java (rev 0)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/jpa/EntityManagerTest.java 2007-06-24 18:00:46 UTC (rev 11714)
@@ -0,0 +1,70 @@
+//$Id$
+package org.hibernate.search.test.jpa;
+
+import javax.persistence.EntityManager;
+
+import org.hibernate.search.jpa.Search;
+import org.hibernate.search.jpa.FullTextEntityManager;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.analysis.StopAnalyzer;
+import org.apache.lucene.index.Term;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class EntityManagerTest extends JPATestCase {
+
+ public void testQuery() throws Exception {
+ FullTextEntityManager em = Search.createFullTextEntityManager( factory.createEntityManager() );
+ 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();
+ em.close();
+ }
+
+ public void testIndex() throws Exception {
+ FullTextEntityManager em = Search.createFullTextEntityManager( factory.createEntityManager() );
+ em.getTransaction().begin();
+ Bretzel bretzel = new Bretzel( 23, 34 );
+ em.persist( bretzel );
+ em.getTransaction().commit();
+ em.clear();
+
+ //Not really a unit test but a test that shows the method call wiouth failing
+ //FIXME port the index test
+ em.getTransaction().begin();
+ em.index( em.find( Bretzel.class, bretzel.getId() ) );
+ em.getTransaction().commit();
+
+ em.getTransaction().begin();
+ em.remove( em.find( Bretzel.class, bretzel.getId() ) );
+ em.getTransaction().commit();
+ em.close();
+ }
+
+ public Class[] getAnnotatedClasses() {
+ return new Class[] {
+ Bretzel.class
+ };
+ }
+}
Added: trunk/HibernateExt/search/src/test/org/hibernate/search/test/jpa/JPATestCase.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/jpa/JPATestCase.java (rev 0)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/jpa/JPATestCase.java 2007-06-24 18:00:46 UTC (rev 11714)
@@ -0,0 +1,111 @@
+//$Id$
+package org.hibernate.search.test.jpa;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Properties;
+import java.util.ArrayList;
+import java.io.InputStream;
+import java.io.IOException;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Persistence;
+
+import org.hibernate.cfg.Environment;
+import org.hibernate.ejb.HibernatePersistence;
+import org.hibernate.search.store.RAMDirectoryProvider;
+import org.apache.lucene.analysis.StopAnalyzer;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public abstract class JPATestCase extends junit.framework.TestCase {
+ protected EntityManagerFactory factory;
+
+ public JPATestCase() {
+ super();
+ }
+
+ public JPATestCase(String name) {
+ super( name );
+ }
+
+ public void setUp() {
+ factory = new HibernatePersistence().createEntityManagerFactory( getConfig() );
+ }
+
+ public void tearDown() {
+ factory.close();
+ }
+
+ public abstract Class[] getAnnotatedClasses();
+
+ public String[] getEjb3DD() {
+ return new String[]{};
+ }
+
+ public Map<Class, String> getCachedClasses() {
+ return new HashMap<Class, String>();
+ }
+
+ public Map<String, String> getCachedCollections() {
+ return new HashMap<String, String>();
+ }
+
+ public static Properties loadProperties() {
+ Properties props = new Properties();
+ InputStream stream = Persistence.class.getResourceAsStream( "/hibernate.properties" );
+ if ( stream != null ) {
+ try {
+ props.load( stream );
+ }
+ catch (Exception e) {
+ throw new RuntimeException( "could not load hibernate.properties" );
+ }
+ finally {
+ try {
+ stream.close();
+ }
+ catch (IOException ioe) {
+ }
+ }
+ }
+ props.setProperty( Environment.HBM2DDL_AUTO, "create-drop" );
+ return props;
+ }
+
+ public Map getConfig() {
+ Map config = loadProperties();
+ ArrayList<Class> classes = new ArrayList<Class>();
+
+ for ( Class clazz : getAnnotatedClasses() ) {
+ classes.add( clazz );
+ }
+ config.put( HibernatePersistence.LOADED_CLASSES, classes );
+ for ( Map.Entry<Class, String> entry : getCachedClasses().entrySet() ) {
+ config.put(
+ HibernatePersistence.CLASS_CACHE_PREFIX + "." + entry.getKey().getName(),
+ entry.getValue()
+ );
+ }
+ for ( Map.Entry<String, String> entry : getCachedCollections().entrySet() ) {
+ config.put(
+ HibernatePersistence.COLLECTION_CACHE_PREFIX + "." + entry.getKey(),
+ entry.getValue()
+ );
+ }
+ if ( getEjb3DD().length > 0 ) {
+ ArrayList<String> dds = new ArrayList<String>();
+ for ( String dd : getEjb3DD() ) {
+ dds.add( dd );
+ }
+ config.put( HibernatePersistence.XML_FILE_NAMES, dds );
+ }
+
+ //Search config
+ config.put( "hibernate.search.default.directory_provider", RAMDirectoryProvider.class.getName() );
+ config.put( org.hibernate.search.Environment.ANALYZER_CLASS, StopAnalyzer.class.getName() );
+
+ return config;
+ }
+}
+
17 years, 5 months
Hibernate SVN: r11712 - trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/resources/META-INF/plexus.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-06-24 01:32:56 -0400 (Sun, 24 Jun 2007)
New Revision: 11712
Modified:
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/resources/META-INF/plexus/components.xml
Log:
still more prep move to codehaus
Modified: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/resources/META-INF/plexus/components.xml
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/resources/META-INF/plexus/components.xml 2007-06-24 05:32:43 UTC (rev 11711)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/resources/META-INF/plexus/components.xml 2007-06-24 05:32:56 UTC (rev 11712)
@@ -56,7 +56,7 @@
<component>
<role>org.apache.maven.reporting.MavenReport</role>
<role-hint>diff</role-hint>
- <implementation>org.jboss.maven.plugin.docbook.TranslationDiffReport</implementation>
+ <implementation>org.codehaus.mojo.docbook.TranslationDiffReport</implementation>
<instantiation-strategy>per-lookup</instantiation-strategy>
</component>
17 years, 5 months