diff --git a/pom.xml b/pom.xml index 2fbe058d..13caf956 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.tynamo tynamo-parent - 0.2.2 + 0.2.3 @@ -31,7 +31,7 @@ - 5.4-rc-1 + 5.4.1 @@ -62,11 +62,6 @@ tapestry-model-test 0.6.1-SNAPSHOT - - org.tynamo - tapestry-model-web - 0.6.0-SNAPSHOT - org.tynamo tynamo-test diff --git a/tapestry-model-example/.gitignore b/tapestry-model-example/.gitignore index 289d9e9a..e490446b 100644 --- a/tapestry-model-example/.gitignore +++ b/tapestry-model-example/.gitignore @@ -1,2 +1,3 @@ +/build/ /target/ /test-output/ diff --git a/tapestry-model-example/pom.xml b/tapestry-model-example/pom.xml index ccbb264b..b0fecd1e 100644 --- a/tapestry-model-example/pom.xml +++ b/tapestry-model-example/pom.xml @@ -107,8 +107,8 @@ org.hibernate - hibernate-search - 4.3.0.Final + hibernate-search-orm + 5.0.0.Final @@ -124,23 +124,15 @@ org.eclipse.persistence eclipselink - 2.5.1 + 2.6.3 org.hibernate hibernate-validator - 4.3.0.Final + 4.3.2.Final - - org.tynamo tynamo-test @@ -150,7 +142,7 @@ org.tynamo tapestry-routing - 0.1.0 + 0.1.1 org.apache.tapestry @@ -165,20 +157,15 @@ 1.7.2 - + + + xml-apis + xml-apis + 1.4.01 + test + + - - - repositories - - - EclipseLink Repo - - http://download.eclipse.org/rt/eclipselink/maven.repo - - - - - + \ No newline at end of file diff --git a/tapestry-model-hibernate/.gitignore b/tapestry-model-hibernate/.gitignore index b83d2226..289d9e9a 100644 --- a/tapestry-model-hibernate/.gitignore +++ b/tapestry-model-hibernate/.gitignore @@ -1 +1,2 @@ /target/ +/test-output/ diff --git a/tapestry-model-hibernate/pom.xml b/tapestry-model-hibernate/pom.xml index 245a5b06..5b9e3536 100644 --- a/tapestry-model-hibernate/pom.xml +++ b/tapestry-model-hibernate/pom.xml @@ -47,7 +47,7 @@ org.hibernate hibernate-core - 4.2.2.Final + 4.3.6.Final true @@ -61,7 +61,7 @@ org.hibernate hibernate-validator - 4.3.0.Final + 4.3.2.Final @@ -71,12 +71,21 @@ + org.hibernate - hibernate-search - 4.3.0.Final + hibernate-search-orm + 5.0.0.Final true + + + + org.apache.lucene + lucene-queryparser + 4.10.2 + org.apache.tapestry diff --git a/tapestry-model-hibernate/src/main/java/org/tynamo/hibernate/services/internal/SearchableHibernateGridDataSourceProvider.java b/tapestry-model-hibernate/src/main/java/org/tynamo/hibernate/services/internal/SearchableHibernateGridDataSourceProvider.java index c8cf14a8..c7342f79 100644 --- a/tapestry-model-hibernate/src/main/java/org/tynamo/hibernate/services/internal/SearchableHibernateGridDataSourceProvider.java +++ b/tapestry-model-hibernate/src/main/java/org/tynamo/hibernate/services/internal/SearchableHibernateGridDataSourceProvider.java @@ -6,8 +6,8 @@ import java.util.Set; import org.apache.lucene.analysis.standard.StandardAnalyzer; -import org.apache.lucene.queryParser.MultiFieldQueryParser; -import org.apache.lucene.queryParser.ParseException; +import org.apache.lucene.queryparser.classic.MultiFieldQueryParser; +import org.apache.lucene.queryparser.classic.ParseException; import org.apache.lucene.util.Version; import org.apache.tapestry5.grid.GridDataSource; import org.apache.tapestry5.hibernate.HibernateGridDataSource; @@ -49,8 +49,8 @@ public GridDataSource createGridDataSource(Class entityType, // don't bother with a text query if there are no @Fields if (fieldNames.size() <= 0) return createGridDataSource(entityType); - MultiFieldQueryParser parser = new MultiFieldQueryParser(Version.LUCENE_35, fieldNames.toArray(new String[fieldNames.size()]), - new StandardAnalyzer(Version.LUCENE_35)); + MultiFieldQueryParser parser = new MultiFieldQueryParser(fieldNames.toArray(new String[fieldNames.size()]), + new StandardAnalyzer(Version.LUCENE_4_10_2)); // parser.setDefaultOperator(QueryParser.AND_OPERATOR); // overrides the default OR_OPERATOR, so that all words in the search are // required try { diff --git a/tapestry-model-hibernate/src/test/java/org/tynamo/hibernate/DescriptorServiceAndEmbeddalesTest.java b/tapestry-model-hibernate/src/test/java/org/tynamo/hibernate/DescriptorServiceAndEmbeddalesTest.java index b612e912..b7d333c2 100644 --- a/tapestry-model-hibernate/src/test/java/org/tynamo/hibernate/DescriptorServiceAndEmbeddalesTest.java +++ b/tapestry-model-hibernate/src/test/java/org/tynamo/hibernate/DescriptorServiceAndEmbeddalesTest.java @@ -32,7 +32,6 @@ public class DescriptorServiceAndEmbeddalesTest private static Registry registry; - @SuppressWarnings("unchecked") @BeforeSuite public final void setup_registry() { diff --git a/tapestry-model-jpa/pom.xml b/tapestry-model-jpa/pom.xml index b75c6c2e..568660c7 100644 --- a/tapestry-model-jpa/pom.xml +++ b/tapestry-model-jpa/pom.xml @@ -56,8 +56,8 @@ org.eclipse.persistence eclipselink - 2.5.1 - + 2.6.3 + provided @@ -70,8 +70,16 @@ org.elasticsearch elasticsearch - 0.20.0.RC1 + 1.7.5 + org.slf4j diff --git a/tapestry-model-jpa/src/main/java/org/tynamo/model/elasticsearch/mapping/MappingUtil.java b/tapestry-model-jpa/src/main/java/org/tynamo/model/elasticsearch/mapping/MappingUtil.java index 694ab7a0..3ca26029 100644 --- a/tapestry-model-jpa/src/main/java/org/tynamo/model/elasticsearch/mapping/MappingUtil.java +++ b/tapestry-model-jpa/src/main/java/org/tynamo/model/elasticsearch/mapping/MappingUtil.java @@ -1,5 +1,10 @@ package org.tynamo.model.elasticsearch.mapping; +import java.io.IOException; +import java.lang.annotation.Annotation; +import java.math.BigDecimal; +import java.util.Date; + import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.Validate; @@ -12,11 +17,6 @@ import org.tynamo.model.elasticsearch.annotations.ElasticSearchField.Store; import org.tynamo.model.elasticsearch.descriptor.ElasticSearchFieldDescriptor; -import java.io.IOException; -import java.lang.annotation.Annotation; -import java.math.BigDecimal; -import java.util.Date; - public abstract class MappingUtil { diff --git a/tapestry-model-jpa/src/main/java/org/tynamo/model/jpa/components/ElasticModelSearch.java b/tapestry-model-jpa/src/main/java/org/tynamo/model/jpa/components/ElasticModelSearch.java index 31e4c21b..a85c560e 100644 --- a/tapestry-model-jpa/src/main/java/org/tynamo/model/jpa/components/ElasticModelSearch.java +++ b/tapestry-model-jpa/src/main/java/org/tynamo/model/jpa/components/ElasticModelSearch.java @@ -1,5 +1,8 @@ package org.tynamo.model.jpa.components; +import java.util.HashSet; +import java.util.Set; + import org.apache.tapestry5.grid.GridDataSource; import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.ioc.services.TypeCoercer; @@ -16,9 +19,6 @@ import org.tynamo.model.elasticsearch.descriptor.ElasticSearchFieldDescriptor; import org.tynamo.services.DescriptorService; -import java.util.HashSet; -import java.util.Set; - public class ElasticModelSearch extends GenericModelSearch { @Inject @@ -46,7 +46,8 @@ protected GridDataSource createGridDataSource() { // FIXME consider whether we should .setTypes("entityType") SearchResponse searchResponse = client.prepareSearch(elasticDescriptor.getIndexName()) .setTypes(elasticDescriptor.getTypeName()) - .setQuery(QueryBuilders.boolQuery().must(QueryBuilders.queryString(getSearchTerms()))).execute().actionGet(); + .setQuery(QueryBuilders.boolQuery().must(QueryBuilders.queryStringQuery(getSearchTerms()))).execute() + .actionGet(); if (searchResponse.getHits().getTotalHits() <= 0) return new EmptyGridDataSource(getBeanType()); diff --git a/tapestry-model-jpa/src/main/java/org/tynamo/model/jpa/services/ElasticSearchModule.java b/tapestry-model-jpa/src/main/java/org/tynamo/model/jpa/services/ElasticSearchModule.java index 8f83bf32..427a8d8d 100644 --- a/tapestry-model-jpa/src/main/java/org/tynamo/model/jpa/services/ElasticSearchModule.java +++ b/tapestry-model-jpa/src/main/java/org/tynamo/model/jpa/services/ElasticSearchModule.java @@ -1,12 +1,14 @@ package org.tynamo.model.jpa.services; +import java.net.InetAddress; +import java.net.UnknownHostException; + import org.apache.tapestry5.ioc.MappedConfiguration; import org.apache.tapestry5.ioc.ServiceBinder; import org.apache.tapestry5.ioc.annotations.Autobuild; import org.apache.tapestry5.ioc.annotations.Startup; import org.apache.tapestry5.ioc.annotations.Symbol; import org.apache.tapestry5.ioc.services.RegistryShutdownHub; -import org.elasticsearch.common.network.NetworkUtils; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.node.Node; import org.elasticsearch.node.NodeBuilder; @@ -33,13 +35,14 @@ public static void contributeFactoryDefaults(MappedConfiguration public Node buildNode(@Symbol(TynamoJpaSymbols.ELASTICSEARCH_HOME) String pathHome, @Symbol(TynamoJpaSymbols.ELASTICSEARCH_HTTP_ENABLED) boolean httpEnabled, - RegistryShutdownHub registryShutdownHub) { + RegistryShutdownHub registryShutdownHub) throws UnknownHostException { + // Settings.Builder settings = Settings.settingsBuilder(); ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder(); if (!pathHome.isEmpty()) settings.put("path.home", pathHome); settings.put("http.enabled", httpEnabled); settings.put("number_of_shards", 1); settings.put("number_of_replicas", 0); - settings.put("cluster.name", "tynamo-model-search-" + NetworkUtils.getLocalAddress().getHostName()).build(); + settings.put("cluster.name", "tynamo-model-search-" + InetAddress.getLocalHost().getHostName()).build(); final Node node = NodeBuilder.nodeBuilder().local(true).data(true).settings(settings).build(); node.start();