diff --git a/src/main/asciidoc/index.adoc b/src/main/asciidoc/index.adoc index 2ef37267..983a796f 100644 --- a/src/main/asciidoc/index.adoc +++ b/src/main/asciidoc/index.adoc @@ -13,7 +13,7 @@ BioMed Central Development Team; Oliver Drotbohm; Greg Turnquist; Christoph Stro ifdef::backend-epub3[:front-cover-image: image:epub-cover.png[Front Cover,1050,1600]] :spring-data-commons-docs: ../../../../spring-data-commons/src/main/asciidoc -(C) 2013-2018 The original author(s). +(C) 2013-2019 The original author(s). NOTE: Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically. diff --git a/src/main/java/org/springframework/data/elasticsearch/ElasticsearchException.java b/src/main/java/org/springframework/data/elasticsearch/ElasticsearchException.java index 88ea9964..1d2d19c1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/ElasticsearchException.java +++ b/src/main/java/org/springframework/data/elasticsearch/ElasticsearchException.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionField.java index 7176d23b..dd750aec 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionField.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionField.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/DateFormat.java b/src/main/java/org/springframework/data/elasticsearch/annotations/DateFormat.java index 056dc148..450c33e9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/DateFormat.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/DateFormat.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java index 5e0712b1..85e1bfc1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java index 8f139f74..5fc4396c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java b/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java index d78c95b9..9c0c0663 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/GeoPointField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/GeoPointField.java index bdb8025b..5080b211 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/GeoPointField.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/GeoPointField.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java index 1f5bdfc3..e65a4225 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2018 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Mapping.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Mapping.java index 32384049..e17dae8b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Mapping.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Mapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/MultiField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/MultiField.java index 1b502457..e97d8299 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/MultiField.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/MultiField.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Parent.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Parent.java index 940e6f04..bdfedb81 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Parent.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Parent.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Query.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Query.java index d1fc2f3f..1ef24337 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Query.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Query.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Setting.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Setting.java index c2d746f0..938abb49 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Setting.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Setting.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java index 00845f11..99c46d7a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java index 6e39a986..c3987a0b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/ClientLogger.java b/src/main/java/org/springframework/data/elasticsearch/client/ClientLogger.java index 9f12731b..bfa70d1c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/ClientLogger.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/ClientLogger.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/ClusterNodes.java b/src/main/java/org/springframework/data/elasticsearch/client/ClusterNodes.java index 43ac652b..523719cb 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/ClusterNodes.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/ClusterNodes.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java index 7ed954c7..3db729e5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/ElasticsearchHost.java b/src/main/java/org/springframework/data/elasticsearch/client/ElasticsearchHost.java index e0875370..17f4d01c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/ElasticsearchHost.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/ElasticsearchHost.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/InetSocketAddressParser.java b/src/main/java/org/springframework/data/elasticsearch/client/InetSocketAddressParser.java index b6330cd8..38df18e0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/InetSocketAddressParser.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/InetSocketAddressParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/NoReachableHostException.java b/src/main/java/org/springframework/data/elasticsearch/client/NoReachableHostException.java index e6e4aa04..060d5ebd 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/NoReachableHostException.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/NoReachableHostException.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/NodeClientFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/client/NodeClientFactoryBean.java index 05b2e5eb..c96ae068 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/NodeClientFactoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/NodeClientFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2017 the original author or authors. + * Copyright 2015-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/RestClientFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/client/RestClientFactoryBean.java index bb6c6083..56c56ccd 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/RestClientFactoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/RestClientFactoryBean.java @@ -1,93 +1,93 @@ -/* - * Copyright 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.client; - -import lombok.extern.slf4j.Slf4j; - -import java.net.URL; -import java.util.ArrayList; - -import org.apache.http.HttpHost; -import org.elasticsearch.client.RestClient; -import org.elasticsearch.client.RestHighLevelClient; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.beans.factory.FactoryBean; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.util.Assert; - -/** - * RestClientFactoryBean - * - * @author Don Wellington - */ -@Slf4j -public class RestClientFactoryBean implements FactoryBean, InitializingBean, DisposableBean { - - private RestHighLevelClient client; - private String hosts = "http://localhost:9200"; - static final String COMMA = ","; - - @Override - public void destroy() throws Exception { - try { - log.info("Closing elasticSearch client"); - if (client != null) { - client.close(); - } - } catch (final Exception e) { - log.error("Error closing ElasticSearch client: ", e); - } - } - - @Override - public void afterPropertiesSet() throws Exception { - buildClient(); - } - - @Override - public RestHighLevelClient getObject() throws Exception { - return client; - } - - @Override - public Class getObjectType() { - return RestHighLevelClient.class; - } - - @Override - public boolean isSingleton() { - return false; - } - - protected void buildClient() throws Exception { - - Assert.hasText(hosts, "[Assertion Failed] At least one host must be set."); - ArrayList httpHosts = new ArrayList(); - for (String host : hosts.split(COMMA)) { - URL hostUrl = new URL(host); - httpHosts.add(new HttpHost(hostUrl.getHost(), hostUrl.getPort(), hostUrl.getProtocol())); - } - client = new RestHighLevelClient(RestClient.builder(httpHosts.toArray(new HttpHost[httpHosts.size()]))); - } - - public void setHosts(String hosts) { - this.hosts = hosts; - } - - public String getHosts() { - return this.hosts; - } -} +/* + * Copyright 2018-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.client; + +import lombok.extern.slf4j.Slf4j; + +import java.net.URL; +import java.util.ArrayList; + +import org.apache.http.HttpHost; +import org.elasticsearch.client.RestClient; +import org.elasticsearch.client.RestHighLevelClient; +import org.springframework.beans.factory.DisposableBean; +import org.springframework.beans.factory.FactoryBean; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.util.Assert; + +/** + * RestClientFactoryBean + * + * @author Don Wellington + */ +@Slf4j +public class RestClientFactoryBean implements FactoryBean, InitializingBean, DisposableBean { + + private RestHighLevelClient client; + private String hosts = "http://localhost:9200"; + static final String COMMA = ","; + + @Override + public void destroy() throws Exception { + try { + log.info("Closing elasticSearch client"); + if (client != null) { + client.close(); + } + } catch (final Exception e) { + log.error("Error closing ElasticSearch client: ", e); + } + } + + @Override + public void afterPropertiesSet() throws Exception { + buildClient(); + } + + @Override + public RestHighLevelClient getObject() throws Exception { + return client; + } + + @Override + public Class getObjectType() { + return RestHighLevelClient.class; + } + + @Override + public boolean isSingleton() { + return false; + } + + protected void buildClient() throws Exception { + + Assert.hasText(hosts, "[Assertion Failed] At least one host must be set."); + ArrayList httpHosts = new ArrayList(); + for (String host : hosts.split(COMMA)) { + URL hostUrl = new URL(host); + httpHosts.add(new HttpHost(hostUrl.getHost(), hostUrl.getPort(), hostUrl.getProtocol())); + } + client = new RestHighLevelClient(RestClient.builder(httpHosts.toArray(new HttpHost[httpHosts.size()]))); + } + + public void setHosts(String hosts) { + this.hosts = hosts; + } + + public String getHosts() { + return this.hosts; + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/client/RestClients.java b/src/main/java/org/springframework/data/elasticsearch/client/RestClients.java index d2d3a1f6..fc59fcf0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/RestClients.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/RestClients.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/TransportClientFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/client/TransportClientFactoryBean.java index 43b8fd37..a471c231 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/TransportClientFactoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/TransportClientFactoryBean.java @@ -1,152 +1,152 @@ -/* - * Copyright 2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.client; - -import java.util.Properties; - -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.transport.client.PreBuiltTransportClient; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.beans.factory.FactoryBean; +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.client; + +import java.util.Properties; + +import org.elasticsearch.client.transport.TransportClient; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.transport.client.PreBuiltTransportClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.DisposableBean; +import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; - -/** - * TransportClientFactoryBean - * - * @author Rizwan Idrees - * @author Mohsin Husen - * @author Jakub Vavrik - * @author Piotr Betkier - * @author Ilkang Na - * @author Oliver Gierke - */ -public class TransportClientFactoryBean implements FactoryBean, InitializingBean, DisposableBean { - - private static final Logger logger = LoggerFactory.getLogger(TransportClientFactoryBean.class); - private ClusterNodes clusterNodes = ClusterNodes.of("127.0.0.1:9300"); - private String clusterName = "elasticsearch"; - private Boolean clientTransportSniff = true; - private Boolean clientIgnoreClusterName = Boolean.FALSE; - private String clientPingTimeout = "5s"; - private String clientNodesSamplerInterval = "5s"; - private TransportClient client; - private Properties properties; - - @Override - public void destroy() throws Exception { - try { - logger.info("Closing elasticSearch client"); - if (client != null) { - client.close(); - } - } catch (final Exception e) { - logger.error("Error closing ElasticSearch client: ", e); - } - } - - @Override - public TransportClient getObject() throws Exception { - return client; - } - - @Override - public Class getObjectType() { - return TransportClient.class; - } - - @Override - public boolean isSingleton() { - return false; - } - - @Override - public void afterPropertiesSet() throws Exception { - buildClient(); - } - - protected void buildClient() throws Exception { - - client = new PreBuiltTransportClient(settings()); - - clusterNodes.stream() // - .peek(it -> logger.info("Adding transport node : " + it.toString())) // - .forEach(client::addTransportAddress); - - client.connectedNodes(); - } - - private Settings settings() { - if (properties != null) { - Settings.Builder builder = Settings.builder(); - - properties.forEach((key, value) -> { - builder.put(key.toString(), value.toString()); - }); - - return builder.build(); - } - return Settings.builder() - .put("cluster.name", clusterName) - .put("client.transport.sniff", clientTransportSniff) - .put("client.transport.ignore_cluster_name", clientIgnoreClusterName) - .put("client.transport.ping_timeout", clientPingTimeout) - .put("client.transport.nodes_sampler_interval", clientNodesSamplerInterval) - .build(); - } - - public void setClusterNodes(String clusterNodes) { - this.clusterNodes = ClusterNodes.of(clusterNodes); - } - - public void setClusterName(String clusterName) { - this.clusterName = clusterName; - } - - public void setClientTransportSniff(Boolean clientTransportSniff) { - this.clientTransportSniff = clientTransportSniff; - } - - public String getClientNodesSamplerInterval() { - return clientNodesSamplerInterval; - } - - public void setClientNodesSamplerInterval(String clientNodesSamplerInterval) { - this.clientNodesSamplerInterval = clientNodesSamplerInterval; - } - - public String getClientPingTimeout() { - return clientPingTimeout; - } - - public void setClientPingTimeout(String clientPingTimeout) { - this.clientPingTimeout = clientPingTimeout; - } - - public Boolean getClientIgnoreClusterName() { - return clientIgnoreClusterName; - } - - public void setClientIgnoreClusterName(Boolean clientIgnoreClusterName) { - this.clientIgnoreClusterName = clientIgnoreClusterName; - } - - public void setProperties(Properties properties) { - this.properties = properties; - } -} + +/** + * TransportClientFactoryBean + * + * @author Rizwan Idrees + * @author Mohsin Husen + * @author Jakub Vavrik + * @author Piotr Betkier + * @author Ilkang Na + * @author Oliver Gierke + */ +public class TransportClientFactoryBean implements FactoryBean, InitializingBean, DisposableBean { + + private static final Logger logger = LoggerFactory.getLogger(TransportClientFactoryBean.class); + private ClusterNodes clusterNodes = ClusterNodes.of("127.0.0.1:9300"); + private String clusterName = "elasticsearch"; + private Boolean clientTransportSniff = true; + private Boolean clientIgnoreClusterName = Boolean.FALSE; + private String clientPingTimeout = "5s"; + private String clientNodesSamplerInterval = "5s"; + private TransportClient client; + private Properties properties; + + @Override + public void destroy() throws Exception { + try { + logger.info("Closing elasticSearch client"); + if (client != null) { + client.close(); + } + } catch (final Exception e) { + logger.error("Error closing ElasticSearch client: ", e); + } + } + + @Override + public TransportClient getObject() throws Exception { + return client; + } + + @Override + public Class getObjectType() { + return TransportClient.class; + } + + @Override + public boolean isSingleton() { + return false; + } + + @Override + public void afterPropertiesSet() throws Exception { + buildClient(); + } + + protected void buildClient() throws Exception { + + client = new PreBuiltTransportClient(settings()); + + clusterNodes.stream() // + .peek(it -> logger.info("Adding transport node : " + it.toString())) // + .forEach(client::addTransportAddress); + + client.connectedNodes(); + } + + private Settings settings() { + if (properties != null) { + Settings.Builder builder = Settings.builder(); + + properties.forEach((key, value) -> { + builder.put(key.toString(), value.toString()); + }); + + return builder.build(); + } + return Settings.builder() + .put("cluster.name", clusterName) + .put("client.transport.sniff", clientTransportSniff) + .put("client.transport.ignore_cluster_name", clientIgnoreClusterName) + .put("client.transport.ping_timeout", clientPingTimeout) + .put("client.transport.nodes_sampler_interval", clientNodesSamplerInterval) + .build(); + } + + public void setClusterNodes(String clusterNodes) { + this.clusterNodes = ClusterNodes.of(clusterNodes); + } + + public void setClusterName(String clusterName) { + this.clusterName = clusterName; + } + + public void setClientTransportSniff(Boolean clientTransportSniff) { + this.clientTransportSniff = clientTransportSniff; + } + + public String getClientNodesSamplerInterval() { + return clientNodesSamplerInterval; + } + + public void setClientNodesSamplerInterval(String clientNodesSamplerInterval) { + this.clientNodesSamplerInterval = clientNodesSamplerInterval; + } + + public String getClientPingTimeout() { + return clientPingTimeout; + } + + public void setClientPingTimeout(String clientPingTimeout) { + this.clientPingTimeout = clientPingTimeout; + } + + public Boolean getClientIgnoreClusterName() { + return clientIgnoreClusterName; + } + + public void setClientIgnoreClusterName(Boolean clientIgnoreClusterName) { + this.clientIgnoreClusterName = clientIgnoreClusterName; + } + + public void setProperties(Properties properties) { + this.properties = properties; + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/client/reactive/DefaultReactiveElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/reactive/DefaultReactiveElasticsearchClient.java index d31df321..a734ef26 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/reactive/DefaultReactiveElasticsearchClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/reactive/DefaultReactiveElasticsearchClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/reactive/DefaultWebClientProvider.java b/src/main/java/org/springframework/data/elasticsearch/client/reactive/DefaultWebClientProvider.java index 89719b64..2c0b6f8d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/reactive/DefaultWebClientProvider.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/reactive/DefaultWebClientProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/reactive/HostProvider.java b/src/main/java/org/springframework/data/elasticsearch/client/reactive/HostProvider.java index b018fcb1..a5e533ed 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/reactive/HostProvider.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/reactive/HostProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/reactive/MultiNodeHostProvider.java b/src/main/java/org/springframework/data/elasticsearch/client/reactive/MultiNodeHostProvider.java index 99d30f2b..c890f146 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/reactive/MultiNodeHostProvider.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/reactive/MultiNodeHostProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/reactive/RawActionResponse.java b/src/main/java/org/springframework/data/elasticsearch/client/reactive/RawActionResponse.java index 961f3876..aa190e81 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/reactive/RawActionResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/reactive/RawActionResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClient.java index 895ff24d..500bd2d4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/reactive/ReactiveRestClients.java b/src/main/java/org/springframework/data/elasticsearch/client/reactive/ReactiveRestClients.java index c3545bce..e9f00abd 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/reactive/ReactiveRestClients.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/reactive/ReactiveRestClients.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/reactive/RequestBodyEncodingException.java b/src/main/java/org/springframework/data/elasticsearch/client/reactive/RequestBodyEncodingException.java index 43b6aa78..ffe13dab 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/reactive/RequestBodyEncodingException.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/reactive/RequestBodyEncodingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/reactive/SingleNodeHostProvider.java b/src/main/java/org/springframework/data/elasticsearch/client/reactive/SingleNodeHostProvider.java index d2e0a729..762b2f5f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/reactive/SingleNodeHostProvider.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/reactive/SingleNodeHostProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/reactive/WebClientProvider.java b/src/main/java/org/springframework/data/elasticsearch/client/reactive/WebClientProvider.java index ddec5f2b..c2291e19 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/reactive/WebClientProvider.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/reactive/WebClientProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/util/RequestConverters.java b/src/main/java/org/springframework/data/elasticsearch/client/util/RequestConverters.java index cf48a701..3e18ecce 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/util/RequestConverters.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/util/RequestConverters.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/config/AbstractElasticsearchConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/config/AbstractElasticsearchConfiguration.java index f029c31a..8d816556 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/AbstractElasticsearchConfiguration.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/AbstractElasticsearchConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/config/AbstractReactiveElasticsearchConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/config/AbstractReactiveElasticsearchConfiguration.java index 1f2c239d..178b454d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/AbstractReactiveElasticsearchConfiguration.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/AbstractReactiveElasticsearchConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java index 60479171..79c587c7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandler.java b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandler.java index f3362751..995d2795 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandler.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/config/NodeClientBeanDefinitionParser.java b/src/main/java/org/springframework/data/elasticsearch/config/NodeClientBeanDefinitionParser.java index 96cad2e1..23738c3f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/NodeClientBeanDefinitionParser.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/NodeClientBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/config/RestClientBeanDefinitionParser.java b/src/main/java/org/springframework/data/elasticsearch/config/RestClientBeanDefinitionParser.java index 5fcdf1f4..abbc20b6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/RestClientBeanDefinitionParser.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/RestClientBeanDefinitionParser.java @@ -1,47 +1,47 @@ -/* - * Copyright 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.config; - -import org.springframework.beans.factory.support.AbstractBeanDefinition; -import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; -import org.springframework.beans.factory.support.BeanDefinitionBuilder; -import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.data.elasticsearch.client.RestClientFactoryBean; -import org.w3c.dom.Element; - -/** - * @author Don Wellington - */ -public class RestClientBeanDefinitionParser extends AbstractBeanDefinitionParser { - - @Override - protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { - BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(RestClientFactoryBean.class); - setConfigurations(element, builder); - return getSourcedBeanDefinition(builder, element, parserContext); - } - - private void setConfigurations(Element element, BeanDefinitionBuilder builder) { - builder.addPropertyValue("hosts", element.getAttribute("hosts")); - } - - private AbstractBeanDefinition getSourcedBeanDefinition(BeanDefinitionBuilder builder, Element source, - ParserContext context) { - AbstractBeanDefinition definition = builder.getBeanDefinition(); - definition.setSource(context.extractSource(source)); - return definition; - } -} +/* + * Copyright 2018-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.config; + +import org.springframework.beans.factory.support.AbstractBeanDefinition; +import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; +import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.xml.ParserContext; +import org.springframework.data.elasticsearch.client.RestClientFactoryBean; +import org.w3c.dom.Element; + +/** + * @author Don Wellington + */ +public class RestClientBeanDefinitionParser extends AbstractBeanDefinitionParser { + + @Override + protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { + BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(RestClientFactoryBean.class); + setConfigurations(element, builder); + return getSourcedBeanDefinition(builder, element, parserContext); + } + + private void setConfigurations(Element element, BeanDefinitionBuilder builder) { + builder.addPropertyValue("hosts", element.getAttribute("hosts")); + } + + private AbstractBeanDefinition getSourcedBeanDefinition(BeanDefinitionBuilder builder, Element source, + ParserContext context) { + AbstractBeanDefinition definition = builder.getBeanDefinition(); + definition.setSource(context.extractSource(source)); + return definition; + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/config/TransportClientBeanDefinitionParser.java b/src/main/java/org/springframework/data/elasticsearch/config/TransportClientBeanDefinitionParser.java index 200f830c..3149b2de 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/TransportClientBeanDefinitionParser.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/TransportClientBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AbstractResultMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/AbstractResultMapper.java index 282c2331..a8321638 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/AbstractResultMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/AbstractResultMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/CriteriaFilterProcessor.java b/src/main/java/org/springframework/data/elasticsearch/core/CriteriaFilterProcessor.java index 971d6a40..5ba2dd13 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/CriteriaFilterProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/CriteriaFilterProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/CriteriaQueryProcessor.java b/src/main/java/org/springframework/data/elasticsearch/core/CriteriaQueryProcessor.java index f082e9cf..c91fd8b7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/CriteriaQueryProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/CriteriaQueryProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/DefaultEntityMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/DefaultEntityMapper.java index 54d73245..528bb7bb 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/DefaultEntityMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/DefaultEntityMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2018 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/DefaultResultMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/DefaultResultMapper.java index ec090ec0..ac294b61 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/DefaultResultMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/DefaultResultMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2018 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchExceptionTranslator.java b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchExceptionTranslator.java index b3c0cb48..fddf3f1a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchExceptionTranslator.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchExceptionTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java index eece21e0..b8d239d6 100755 --- a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java @@ -1,632 +1,632 @@ -/* - * Copyright 2013-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.core; - -import org.elasticsearch.action.update.UpdateResponse; -import org.elasticsearch.cluster.metadata.AliasMetaData; -import org.elasticsearch.common.Nullable; -import org.springframework.data.domain.Page; -import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter; -import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; -import org.springframework.data.elasticsearch.core.query.*; -import org.springframework.data.util.CloseableIterator; - -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * ElasticsearchOperations - * - * @author Rizwan Idrees - * @author Mohsin Husen - * @author Kevin Leturc - * @author Zetang Zeng - */ -public interface ElasticsearchOperations { - - /** - * @return Converter in use - */ - ElasticsearchConverter getElasticsearchConverter(); - - /** - * Create an index for a class - * - * @param clazz - * @param - */ - boolean createIndex(Class clazz); - - /** - * Create an index for given indexName - * - * @param indexName - */ - boolean createIndex(String indexName); - - /** - * Create an index for given indexName and Settings - * - * @param indexName - * @param settings - */ - boolean createIndex(String indexName, Object settings); - - /** - * Create an index for given class and Settings - * - * @param clazz - * @param settings - */ - boolean createIndex(Class clazz, Object settings); - - /** - * Create mapping for a class - * - * @param clazz - * @param - */ - boolean putMapping(Class clazz); - - /** - * Create mapping for a given indexName and type - * - * @param indexName - * @param type - * @param mappings - */ - boolean putMapping(String indexName, String type, Object mappings); - - /** - * Create mapping for a class - * - * @param clazz - * @param mappings - */ - boolean putMapping(Class clazz, Object mappings); - - - /** - * Get mapping for a class - * - * @param clazz - * @param - */ - Map getMapping(Class clazz); - - /** - * Get mapping for a given indexName and type - * - * @param indexName - * @param type - */ - Map getMapping(String indexName, String type); - - /** - * Get settings for a given indexName - * - * @param indexName - */ - Map getSetting(String indexName); - - /** - * Get settings for a given class - * - * @param clazz - */ - Map getSetting(Class clazz); - - - /** - * Execute the query against elasticsearch and return the first returned object - * - * @param query - * @param clazz - * @return the first matching object - */ - T queryForObject(GetQuery query, Class clazz); - - /** - * Execute the query against elasticsearch and return the first returned object using custom mapper - * - * @param query - * @param clazz - * @param mapper - * @return the first matching object - */ - T queryForObject(GetQuery query, Class clazz, GetResultMapper mapper); - - /** - * Execute the query against elasticsearch and return the first returned object - * - * @param query - * @param clazz - * @return the first matching object - */ - T queryForObject(CriteriaQuery query, Class clazz); - - /** - * Execute the query against elasticsearch and return the first returned object - * - * @param query - * @param clazz - * @return the first matching object - */ - T queryForObject(StringQuery query, Class clazz); - - /** - * Execute the query against elasticsearch and return result as {@link Page} - * - * @param query - * @param clazz - * @return - */ - Page queryForPage(SearchQuery query, Class clazz); - - /** - * Execute the query against elasticsearch and return result as {@link Page} using custom mapper - * - * @param query - * @param clazz - * @return - */ - Page queryForPage(SearchQuery query, Class clazz, SearchResultMapper mapper); - - /** - * Execute the multi-search against elasticsearch and return result as {@link List} of {@link Page} - * - * @param queries - * @param clazz - * @return - */ - List> queryForPage(List queries, Class clazz); - - /** - * Execute the multi-search against elasticsearch and return result as {@link List} of {@link Page} using custom mapper - * - * @param queries - * @param clazz - * @return - */ - List> queryForPage(List queries, Class clazz, SearchResultMapper mapper); - - /** - * Execute the multi-search against elasticsearch and return result as {@link List} of {@link Page} - * - * @param queries - * @param classes - * @return - */ - List> queryForPage(List queries, List> classes); - - /** - * Execute the multi-search against elasticsearch and return result as {@link List} of {@link Page} using custom mapper - * - * @param queries - * @param classes - * @return - */ - List> queryForPage(List queries, List> classes, SearchResultMapper mapper); - - /** - * Execute the query against elasticsearch and return result as {@link Page} - * - * @param query - * @param clazz - * @return - */ - Page queryForPage(CriteriaQuery query, Class clazz); - - /** - * Execute the query against elasticsearch and return result as {@link Page} - * - * @param query - * @param clazz - * @return - */ - Page queryForPage(StringQuery query, Class clazz); - - /** - * Execute the query against elasticsearch and return result as {@link Page} using custom mapper - * - * @param query - * @param clazz - * @return - */ - Page queryForPage(StringQuery query, Class clazz, SearchResultMapper mapper); - - /** - * Executes the given {@link CriteriaQuery} against elasticsearch and return result as {@link CloseableIterator}. - *

- * Returns a {@link CloseableIterator} that wraps an Elasticsearch scroll context that needs to be closed in case of error. - * - * @param element return type - * @param query - * @param clazz - * @return - * @since 1.3 - */ - CloseableIterator stream(CriteriaQuery query, Class clazz); - - /** - * Executes the given {@link SearchQuery} against elasticsearch and return result as {@link CloseableIterator}. - *

- * Returns a {@link CloseableIterator} that wraps an Elasticsearch scroll context that needs to be closed in case of error. - * - * @param element return type - * @param query - * @param clazz - * @return - * @since 1.3 - */ - CloseableIterator stream(SearchQuery query, Class clazz); - - /** - * Executes the given {@link SearchQuery} against elasticsearch and return result as {@link CloseableIterator} using custom mapper. - *

- * Returns a {@link CloseableIterator} that wraps an Elasticsearch scroll context that needs to be closed in case of error. - * - * @param element return type - * @param query - * @param clazz - * @param mapper - * @return - * @since 1.3 - */ - CloseableIterator stream(SearchQuery query, Class clazz, SearchResultMapper mapper); - - /** - * Execute the criteria query against elasticsearch and return result as {@link List} - * - * @param query - * @param clazz - * @param - * @return - */ - List queryForList(CriteriaQuery query, Class clazz); - - /** - * Execute the string query against elasticsearch and return result as {@link List} - * - * @param query - * @param clazz - * @param - * @return - */ - List queryForList(StringQuery query, Class clazz); - - /** - * Execute the search query against elasticsearch and return result as {@link List} - * - * @param query - * @param clazz - * @param - * @return - */ - List queryForList(SearchQuery query, Class clazz); - - /** - * Execute the multi search query against elasticsearch and return result as {@link List} - * - * @param queries - * @param clazz - * @param - * @return - */ - default List> queryForList(List queries, Class clazz) { - return queryForPage(queries, clazz).stream().map(Page::getContent).collect(Collectors.toList()); - } - - /** - * Execute the multi search query against elasticsearch and return result as {@link List} - * - * @param queries - * @param classes - * @return - */ - default List> queryForList(List queries, List> classes) { - return queryForPage(queries, classes).stream().map(Page::getContent).collect(Collectors.toList()); - } - - /** - * Execute the query against elasticsearch and return ids - * - * @param query - * @return - */ - List queryForIds(SearchQuery query); - - /** - * return number of elements found by given query - * - * @param query - * @param clazz - * @return - */ - long count(CriteriaQuery query, Class clazz); - - /** - * return number of elements found by given query - * - * @param query - * @return - */ - long count(CriteriaQuery query); - - /** - * return number of elements found by given query - * - * @param query - * @param clazz - * @return - */ - long count(SearchQuery query, Class clazz); - - /** - * return number of elements found by given query - * - * @param query - * @return - */ - long count(SearchQuery query); - - /** - * Execute a multiGet against elasticsearch for the given ids - * - * @param searchQuery - * @param clazz - * @return - */ - LinkedList multiGet(SearchQuery searchQuery, Class clazz); - - /** - * Execute a multiGet against elasticsearch for the given ids with MultiGetResultMapper - * - * @param searchQuery - * @param clazz - * @param multiGetResultMapper - * @return - */ - LinkedList multiGet(SearchQuery searchQuery, Class clazz, MultiGetResultMapper multiGetResultMapper); - - /** - * Index an object. Will do save or update - * - * @param query - * @return returns the document id - */ - String index(IndexQuery query); - - /** - * Partial update of the document - * - * @param updateQuery - * @return - */ - UpdateResponse update(UpdateQuery updateQuery); - - /** - * Bulk index all objects. Will do save or update - * - * @param queries - */ - void bulkIndex(List queries); - - /** - * Bulk update all objects. Will do update - * - * @param queries - */ - void bulkUpdate(List queries); - - /** - * Delete the one object with provided id - * - * @param indexName - * @param type - * @param id - * @return documentId of the document deleted - */ - String delete(String indexName, String type, String id); - - - /** - * Delete all records matching the criteria - * - * @param clazz - * @param criteriaQuery - */ - void delete(CriteriaQuery criteriaQuery, Class clazz); - /** - * Delete the one object with provided id - * - * @param clazz - * @param id - * @return documentId of the document deleted - */ - String delete(Class clazz, String id); - - /** - * Delete all records matching the query - * - * @param clazz - * @param query - */ - void delete(DeleteQuery query, Class clazz); - - /** - * Delete all records matching the query - * - * @param query - */ - void delete(DeleteQuery query); - - /** - * Deletes an index for given entity - * - * @param clazz - * @param - * @return - */ - boolean deleteIndex(Class clazz); - - /** - * Deletes an index for given indexName - * - * @param indexName - * @return - */ - boolean deleteIndex(String indexName); - - /** - * check if index is exists - * - * @param clazz - * @param - * @return - */ - boolean indexExists(Class clazz); - - /** - * check if index is exists for given IndexName - * - * @param indexName - * @return - */ - boolean indexExists(String indexName); - - /** - * check if type is exists in an index - * - * @param index - * @param type - * @return - */ - boolean typeExists(String index, String type); - - /** - * refresh the index - * - * @param indexName - * - */ - void refresh(String indexName); - - /** - * refresh the index - * - * @param clazz - * - */ - void refresh(Class clazz); - - /** - * Returns scrolled page for given query - * - * @param query The search query. - * @param scrollTimeInMillis The time in millisecond for scroll feature - * {@link org.elasticsearch.action.search.SearchRequestBuilder#setScroll(org.elasticsearch.common.unit.TimeValue)}. - * @param clazz The class of entity to retrieve. - * @return The scan id for input query. - */ - Page startScroll(long scrollTimeInMillis, SearchQuery query, Class clazz); - - /** - * Returns scrolled page for given query - * - * @param query The search query. - * @param scrollTimeInMillis The time in millisecond for scroll feature - * {@link org.elasticsearch.action.search.SearchRequestBuilder#setScroll(org.elasticsearch.common.unit.TimeValue)}. - * @param mapper Custom impl to map result to entities - * @return The scan id for input query. - */ - Page startScroll(long scrollTimeInMillis, SearchQuery query, Class clazz, SearchResultMapper mapper); - - /** - * Returns scrolled page for given query - * - * @param criteriaQuery The search query. - * @param scrollTimeInMillis The time in millisecond for scroll feature - * {@link org.elasticsearch.action.search.SearchRequestBuilder#setScroll(org.elasticsearch.common.unit.TimeValue)}. - * @param clazz The class of entity to retrieve. - * @return The scan id for input query. - */ - Page startScroll(long scrollTimeInMillis, CriteriaQuery criteriaQuery, Class clazz); - - /** - * Returns scrolled page for given query - * - * @param criteriaQuery The search query. - * @param scrollTimeInMillis The time in millisecond for scroll feature - * {@link org.elasticsearch.action.search.SearchRequestBuilder#setScroll(org.elasticsearch.common.unit.TimeValue)}. - * @param mapper Custom impl to map result to entities - * @return The scan id for input query. - */ - Page startScroll(long scrollTimeInMillis, CriteriaQuery criteriaQuery, Class clazz, SearchResultMapper mapper); - - - Page continueScroll(@Nullable String scrollId, long scrollTimeInMillis, Class clazz); - Page continueScroll(@Nullable String scrollId, long scrollTimeInMillis, Class clazz, SearchResultMapper mapper); - /** - * Clears the search contexts associated with specified scroll ids. - * - * @param scrollId - * - */ - void clearScroll(String scrollId); - - /** - * more like this query to search for documents that are "like" a specific document. - * - * @param query - * @param clazz - * @param - * @return - */ - Page moreLikeThis(MoreLikeThisQuery query, Class clazz); - - /** - * adding new alias - * - * @param query - * @return - */ - Boolean addAlias(AliasQuery query); - - /** - * removing previously created alias - * - * @param query - * @return - */ - Boolean removeAlias(AliasQuery query); - - /** - * get all the alias pointing to specified index - * - * @param indexName - * @return - */ - List queryForAlias(String indexName); - - - T query(SearchQuery query, ResultsExtractor resultsExtractor); - - - ElasticsearchPersistentEntity getPersistentEntityFor(Class clazz); -} +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.core; + +import org.elasticsearch.action.update.UpdateResponse; +import org.elasticsearch.cluster.metadata.AliasMetaData; +import org.elasticsearch.common.Nullable; +import org.springframework.data.domain.Page; +import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter; +import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; +import org.springframework.data.elasticsearch.core.query.*; +import org.springframework.data.util.CloseableIterator; + +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * ElasticsearchOperations + * + * @author Rizwan Idrees + * @author Mohsin Husen + * @author Kevin Leturc + * @author Zetang Zeng + */ +public interface ElasticsearchOperations { + + /** + * @return Converter in use + */ + ElasticsearchConverter getElasticsearchConverter(); + + /** + * Create an index for a class + * + * @param clazz + * @param + */ + boolean createIndex(Class clazz); + + /** + * Create an index for given indexName + * + * @param indexName + */ + boolean createIndex(String indexName); + + /** + * Create an index for given indexName and Settings + * + * @param indexName + * @param settings + */ + boolean createIndex(String indexName, Object settings); + + /** + * Create an index for given class and Settings + * + * @param clazz + * @param settings + */ + boolean createIndex(Class clazz, Object settings); + + /** + * Create mapping for a class + * + * @param clazz + * @param + */ + boolean putMapping(Class clazz); + + /** + * Create mapping for a given indexName and type + * + * @param indexName + * @param type + * @param mappings + */ + boolean putMapping(String indexName, String type, Object mappings); + + /** + * Create mapping for a class + * + * @param clazz + * @param mappings + */ + boolean putMapping(Class clazz, Object mappings); + + + /** + * Get mapping for a class + * + * @param clazz + * @param + */ + Map getMapping(Class clazz); + + /** + * Get mapping for a given indexName and type + * + * @param indexName + * @param type + */ + Map getMapping(String indexName, String type); + + /** + * Get settings for a given indexName + * + * @param indexName + */ + Map getSetting(String indexName); + + /** + * Get settings for a given class + * + * @param clazz + */ + Map getSetting(Class clazz); + + + /** + * Execute the query against elasticsearch and return the first returned object + * + * @param query + * @param clazz + * @return the first matching object + */ + T queryForObject(GetQuery query, Class clazz); + + /** + * Execute the query against elasticsearch and return the first returned object using custom mapper + * + * @param query + * @param clazz + * @param mapper + * @return the first matching object + */ + T queryForObject(GetQuery query, Class clazz, GetResultMapper mapper); + + /** + * Execute the query against elasticsearch and return the first returned object + * + * @param query + * @param clazz + * @return the first matching object + */ + T queryForObject(CriteriaQuery query, Class clazz); + + /** + * Execute the query against elasticsearch and return the first returned object + * + * @param query + * @param clazz + * @return the first matching object + */ + T queryForObject(StringQuery query, Class clazz); + + /** + * Execute the query against elasticsearch and return result as {@link Page} + * + * @param query + * @param clazz + * @return + */ + Page queryForPage(SearchQuery query, Class clazz); + + /** + * Execute the query against elasticsearch and return result as {@link Page} using custom mapper + * + * @param query + * @param clazz + * @return + */ + Page queryForPage(SearchQuery query, Class clazz, SearchResultMapper mapper); + + /** + * Execute the multi-search against elasticsearch and return result as {@link List} of {@link Page} + * + * @param queries + * @param clazz + * @return + */ + List> queryForPage(List queries, Class clazz); + + /** + * Execute the multi-search against elasticsearch and return result as {@link List} of {@link Page} using custom mapper + * + * @param queries + * @param clazz + * @return + */ + List> queryForPage(List queries, Class clazz, SearchResultMapper mapper); + + /** + * Execute the multi-search against elasticsearch and return result as {@link List} of {@link Page} + * + * @param queries + * @param classes + * @return + */ + List> queryForPage(List queries, List> classes); + + /** + * Execute the multi-search against elasticsearch and return result as {@link List} of {@link Page} using custom mapper + * + * @param queries + * @param classes + * @return + */ + List> queryForPage(List queries, List> classes, SearchResultMapper mapper); + + /** + * Execute the query against elasticsearch and return result as {@link Page} + * + * @param query + * @param clazz + * @return + */ + Page queryForPage(CriteriaQuery query, Class clazz); + + /** + * Execute the query against elasticsearch and return result as {@link Page} + * + * @param query + * @param clazz + * @return + */ + Page queryForPage(StringQuery query, Class clazz); + + /** + * Execute the query against elasticsearch and return result as {@link Page} using custom mapper + * + * @param query + * @param clazz + * @return + */ + Page queryForPage(StringQuery query, Class clazz, SearchResultMapper mapper); + + /** + * Executes the given {@link CriteriaQuery} against elasticsearch and return result as {@link CloseableIterator}. + *

+ * Returns a {@link CloseableIterator} that wraps an Elasticsearch scroll context that needs to be closed in case of error. + * + * @param element return type + * @param query + * @param clazz + * @return + * @since 1.3 + */ + CloseableIterator stream(CriteriaQuery query, Class clazz); + + /** + * Executes the given {@link SearchQuery} against elasticsearch and return result as {@link CloseableIterator}. + *

+ * Returns a {@link CloseableIterator} that wraps an Elasticsearch scroll context that needs to be closed in case of error. + * + * @param element return type + * @param query + * @param clazz + * @return + * @since 1.3 + */ + CloseableIterator stream(SearchQuery query, Class clazz); + + /** + * Executes the given {@link SearchQuery} against elasticsearch and return result as {@link CloseableIterator} using custom mapper. + *

+ * Returns a {@link CloseableIterator} that wraps an Elasticsearch scroll context that needs to be closed in case of error. + * + * @param element return type + * @param query + * @param clazz + * @param mapper + * @return + * @since 1.3 + */ + CloseableIterator stream(SearchQuery query, Class clazz, SearchResultMapper mapper); + + /** + * Execute the criteria query against elasticsearch and return result as {@link List} + * + * @param query + * @param clazz + * @param + * @return + */ + List queryForList(CriteriaQuery query, Class clazz); + + /** + * Execute the string query against elasticsearch and return result as {@link List} + * + * @param query + * @param clazz + * @param + * @return + */ + List queryForList(StringQuery query, Class clazz); + + /** + * Execute the search query against elasticsearch and return result as {@link List} + * + * @param query + * @param clazz + * @param + * @return + */ + List queryForList(SearchQuery query, Class clazz); + + /** + * Execute the multi search query against elasticsearch and return result as {@link List} + * + * @param queries + * @param clazz + * @param + * @return + */ + default List> queryForList(List queries, Class clazz) { + return queryForPage(queries, clazz).stream().map(Page::getContent).collect(Collectors.toList()); + } + + /** + * Execute the multi search query against elasticsearch and return result as {@link List} + * + * @param queries + * @param classes + * @return + */ + default List> queryForList(List queries, List> classes) { + return queryForPage(queries, classes).stream().map(Page::getContent).collect(Collectors.toList()); + } + + /** + * Execute the query against elasticsearch and return ids + * + * @param query + * @return + */ + List queryForIds(SearchQuery query); + + /** + * return number of elements found by given query + * + * @param query + * @param clazz + * @return + */ + long count(CriteriaQuery query, Class clazz); + + /** + * return number of elements found by given query + * + * @param query + * @return + */ + long count(CriteriaQuery query); + + /** + * return number of elements found by given query + * + * @param query + * @param clazz + * @return + */ + long count(SearchQuery query, Class clazz); + + /** + * return number of elements found by given query + * + * @param query + * @return + */ + long count(SearchQuery query); + + /** + * Execute a multiGet against elasticsearch for the given ids + * + * @param searchQuery + * @param clazz + * @return + */ + LinkedList multiGet(SearchQuery searchQuery, Class clazz); + + /** + * Execute a multiGet against elasticsearch for the given ids with MultiGetResultMapper + * + * @param searchQuery + * @param clazz + * @param multiGetResultMapper + * @return + */ + LinkedList multiGet(SearchQuery searchQuery, Class clazz, MultiGetResultMapper multiGetResultMapper); + + /** + * Index an object. Will do save or update + * + * @param query + * @return returns the document id + */ + String index(IndexQuery query); + + /** + * Partial update of the document + * + * @param updateQuery + * @return + */ + UpdateResponse update(UpdateQuery updateQuery); + + /** + * Bulk index all objects. Will do save or update + * + * @param queries + */ + void bulkIndex(List queries); + + /** + * Bulk update all objects. Will do update + * + * @param queries + */ + void bulkUpdate(List queries); + + /** + * Delete the one object with provided id + * + * @param indexName + * @param type + * @param id + * @return documentId of the document deleted + */ + String delete(String indexName, String type, String id); + + + /** + * Delete all records matching the criteria + * + * @param clazz + * @param criteriaQuery + */ + void delete(CriteriaQuery criteriaQuery, Class clazz); + /** + * Delete the one object with provided id + * + * @param clazz + * @param id + * @return documentId of the document deleted + */ + String delete(Class clazz, String id); + + /** + * Delete all records matching the query + * + * @param clazz + * @param query + */ + void delete(DeleteQuery query, Class clazz); + + /** + * Delete all records matching the query + * + * @param query + */ + void delete(DeleteQuery query); + + /** + * Deletes an index for given entity + * + * @param clazz + * @param + * @return + */ + boolean deleteIndex(Class clazz); + + /** + * Deletes an index for given indexName + * + * @param indexName + * @return + */ + boolean deleteIndex(String indexName); + + /** + * check if index is exists + * + * @param clazz + * @param + * @return + */ + boolean indexExists(Class clazz); + + /** + * check if index is exists for given IndexName + * + * @param indexName + * @return + */ + boolean indexExists(String indexName); + + /** + * check if type is exists in an index + * + * @param index + * @param type + * @return + */ + boolean typeExists(String index, String type); + + /** + * refresh the index + * + * @param indexName + * + */ + void refresh(String indexName); + + /** + * refresh the index + * + * @param clazz + * + */ + void refresh(Class clazz); + + /** + * Returns scrolled page for given query + * + * @param query The search query. + * @param scrollTimeInMillis The time in millisecond for scroll feature + * {@link org.elasticsearch.action.search.SearchRequestBuilder#setScroll(org.elasticsearch.common.unit.TimeValue)}. + * @param clazz The class of entity to retrieve. + * @return The scan id for input query. + */ + Page startScroll(long scrollTimeInMillis, SearchQuery query, Class clazz); + + /** + * Returns scrolled page for given query + * + * @param query The search query. + * @param scrollTimeInMillis The time in millisecond for scroll feature + * {@link org.elasticsearch.action.search.SearchRequestBuilder#setScroll(org.elasticsearch.common.unit.TimeValue)}. + * @param mapper Custom impl to map result to entities + * @return The scan id for input query. + */ + Page startScroll(long scrollTimeInMillis, SearchQuery query, Class clazz, SearchResultMapper mapper); + + /** + * Returns scrolled page for given query + * + * @param criteriaQuery The search query. + * @param scrollTimeInMillis The time in millisecond for scroll feature + * {@link org.elasticsearch.action.search.SearchRequestBuilder#setScroll(org.elasticsearch.common.unit.TimeValue)}. + * @param clazz The class of entity to retrieve. + * @return The scan id for input query. + */ + Page startScroll(long scrollTimeInMillis, CriteriaQuery criteriaQuery, Class clazz); + + /** + * Returns scrolled page for given query + * + * @param criteriaQuery The search query. + * @param scrollTimeInMillis The time in millisecond for scroll feature + * {@link org.elasticsearch.action.search.SearchRequestBuilder#setScroll(org.elasticsearch.common.unit.TimeValue)}. + * @param mapper Custom impl to map result to entities + * @return The scan id for input query. + */ + Page startScroll(long scrollTimeInMillis, CriteriaQuery criteriaQuery, Class clazz, SearchResultMapper mapper); + + + Page continueScroll(@Nullable String scrollId, long scrollTimeInMillis, Class clazz); + Page continueScroll(@Nullable String scrollId, long scrollTimeInMillis, Class clazz, SearchResultMapper mapper); + /** + * Clears the search contexts associated with specified scroll ids. + * + * @param scrollId + * + */ + void clearScroll(String scrollId); + + /** + * more like this query to search for documents that are "like" a specific document. + * + * @param query + * @param clazz + * @param + * @return + */ + Page moreLikeThis(MoreLikeThisQuery query, Class clazz); + + /** + * adding new alias + * + * @param query + * @return + */ + Boolean addAlias(AliasQuery query); + + /** + * removing previously created alias + * + * @param query + * @return + */ + Boolean removeAlias(AliasQuery query); + + /** + * get all the alias pointing to specified index + * + * @param indexName + * @return + */ + List queryForAlias(String indexName); + + + T query(SearchQuery query, ResultsExtractor resultsExtractor); + + + ElasticsearchPersistentEntity getPersistentEntityFor(Class clazz); +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchRestTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchRestTemplate.java index a53f6720..5884eb47 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchRestTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchRestTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplate.java index dd4eb381..b146d6f4 100755 --- a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/EntityMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/EntityMapper.java index d3d5ac91..3bddc64b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/EntityMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/EntityMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java index 420b2eb3..075efc29 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/EsClient.java b/src/main/java/org/springframework/data/elasticsearch/core/EsClient.java index d5d253df..5bd2d273 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/EsClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/EsClient.java @@ -1,26 +1,26 @@ -/* - * Copyright 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.core; - -/** - * EsClient interface. Specify what client an ElasticSearchTemplate will return from getClient(). - * - * @author Don Wellington - * @param - */ -public interface EsClient { - C getClient(); -} +/* + * Copyright 2018-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.core; + +/** + * EsClient interface. Specify what client an ElasticSearchTemplate will return from getClient(). + * + * @author Don Wellington + * @param + */ +public interface EsClient { + C getClient(); +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/FacetedPage.java b/src/main/java/org/springframework/data/elasticsearch/core/FacetedPage.java index d1fad475..f9ef1573 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/FacetedPage.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/FacetedPage.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/FacetedPageImpl.java b/src/main/java/org/springframework/data/elasticsearch/core/FacetedPageImpl.java index a3de48b4..3f2ed38f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/FacetedPageImpl.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/FacetedPageImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2017 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/GetResultMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/GetResultMapper.java index 58fb0583..eaa0c040 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/GetResultMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/GetResultMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/MappingBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/MappingBuilder.java index 7d059d57..b8474dfb 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/MappingBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/MappingBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2017 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/MultiGetResultMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/MultiGetResultMapper.java index c5169ed7..584e982a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/MultiGetResultMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/MultiGetResultMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java index 53824742..0f42cd28 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplate.java index 3719df22..e20a735c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ResultsExtractor.java b/src/main/java/org/springframework/data/elasticsearch/core/ResultsExtractor.java index 65856675..89d6602d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ResultsExtractor.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ResultsExtractor.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ResultsMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/ResultsMapper.java index 07a14811..25dccf6c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ResultsMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ResultsMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ScoredPage.java b/src/main/java/org/springframework/data/elasticsearch/core/ScoredPage.java index aa8d28f8..8197451f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ScoredPage.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ScoredPage.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchResultMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchResultMapper.java index 4e63f53f..ebda7aae 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchResultMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchResultMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/aggregation/impl/AggregatedPageImpl.java b/src/main/java/org/springframework/data/elasticsearch/core/aggregation/impl/AggregatedPageImpl.java index caf8b845..faaa350f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/aggregation/impl/AggregatedPageImpl.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/aggregation/impl/AggregatedPageImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 the original author or authors. + * Copyright 2017-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/client/support/AliasData.java b/src/main/java/org/springframework/data/elasticsearch/core/client/support/AliasData.java index e16e0047..972987d0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/client/support/AliasData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/client/support/AliasData.java @@ -1,34 +1,34 @@ -/* - * Copyright 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.core.client.support; - -import lombok.Data; -import lombok.Getter; - -import org.elasticsearch.cluster.metadata.AliasMetaData; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown=true) -@Data -public class AliasData { - String filter = null; - String routing = null; - String search_routing = null; - String index_routing= null; -} +/* + * Copyright 2018-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.core.client.support; + +import lombok.Data; +import lombok.Getter; + +import org.elasticsearch.cluster.metadata.AliasMetaData; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +@JsonIgnoreProperties(ignoreUnknown=true) +@Data +public class AliasData { + String filter = null; + String routing = null; + String search_routing = null; + String index_routing= null; +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/DateTimeConverters.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/DateTimeConverters.java index ce81d6d3..455bd4cd 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/DateTimeConverters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/DateTimeConverters.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java index c649585b..422e4a8a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java index d591f808..4594300c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java index 496e5bcf..9cb7eaf3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/AbstractFacetRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/AbstractFacetRequest.java index 2d0cbcd6..174a13aa 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/AbstractFacetRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/AbstractFacetRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,4 +47,4 @@ public abstract class AbstractFacetRequest implements FacetRequest { public boolean applyQueryFilter() { return applyQueryFilter; } -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/AbstractFacetResult.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/AbstractFacetResult.java index 0dd050dc..4045da4a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/AbstractFacetResult.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/AbstractFacetResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/FacetRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/FacetRequest.java index 8827d719..9643cc61 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/FacetRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/FacetRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/FacetResult.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/FacetResult.java index 84cd5593..238a8109 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/FacetResult.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/FacetResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/FacetType.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/FacetType.java index 4a6914e0..dd296df5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/FacetType.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/FacetType.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/HistogramFacetRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/HistogramFacetRequest.java index eeae2423..b6cce7f8 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/HistogramFacetRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/HistogramFacetRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,4 +69,4 @@ public class HistogramFacetRequest extends AbstractFacetRequest { return dateHistogramBuilder; } -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/HistogramFacetRequestBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/HistogramFacetRequestBuilder.java index 0c339cc2..7060ea24 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/HistogramFacetRequestBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/HistogramFacetRequestBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,4 +55,4 @@ public class HistogramFacetRequestBuilder { result.setApplyQueryFilter(true); return this; } -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/NativeFacetRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/NativeFacetRequest.java index efba14a0..b78acaa0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/NativeFacetRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/NativeFacetRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/RangeFacetRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/RangeFacetRequest.java index d8d5e5b1..a5d5e23a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/RangeFacetRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/RangeFacetRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2017 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/RangeFacetRequestBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/RangeFacetRequestBuilder.java index 63b8ce91..09a30673 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/RangeFacetRequestBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/RangeFacetRequestBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,4 +82,4 @@ public class RangeFacetRequestBuilder { public FacetRequest build() { return result; } -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/StatisticalFacetRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/StatisticalFacetRequest.java index d514bece..e66accd5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/StatisticalFacetRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/StatisticalFacetRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,4 +49,4 @@ public class StatisticalFacetRequest extends AbstractFacetRequest { Assert.isTrue(!StringUtils.isEmpty(field) && fields == null, "Please select field or fields on which to build the facets !!!"); return AggregationBuilders.extendedStats(getName()).field(field); } -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/StatisticalFacetRequestBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/StatisticalFacetRequestBuilder.java index 8baa9102..67aa09c4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/StatisticalFacetRequestBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/StatisticalFacetRequestBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,4 +49,4 @@ public class StatisticalFacetRequestBuilder { public FacetRequest build() { return result; } -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/TermFacetOrder.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/TermFacetOrder.java index 064c4024..501f3c19 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/TermFacetOrder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/TermFacetOrder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/TermFacetRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/TermFacetRequest.java index 19bef148..d42cf7a0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/TermFacetRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/TermFacetRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/TermFacetRequestBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/TermFacetRequestBuilder.java index 343db81a..a6b7beb1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/request/TermFacetRequestBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/request/TermFacetRequestBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,4 +85,4 @@ public class TermFacetRequestBuilder { public FacetRequest build() { return result; } -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/result/HistogramResult.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/result/HistogramResult.java index 1114158a..e5e4197a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/result/HistogramResult.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/result/HistogramResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/result/IntervalUnit.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/result/IntervalUnit.java index b439a881..9212fa4a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/result/IntervalUnit.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/result/IntervalUnit.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/result/Range.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/result/Range.java index 166e97e5..0a1cbf1f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/result/Range.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/result/Range.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/result/RangeResult.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/result/RangeResult.java index db2b2e2c..97ea4ba8 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/result/RangeResult.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/result/RangeResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/result/StatisticalResult.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/result/StatisticalResult.java index 28f18868..d5ad314f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/result/StatisticalResult.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/result/StatisticalResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/result/Term.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/result/Term.java index 6bc87bfd..ed2312f6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/result/Term.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/result/Term.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/facet/result/TermResult.java b/src/main/java/org/springframework/data/elasticsearch/core/facet/result/TermResult.java index 12653abb..313e62e2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/facet/result/TermResult.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/facet/result/TermResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoBox.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoBox.java index 82ac41ca..ea59e398 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoBox.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoBox.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoPoint.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoPoint.java index bbc862a9..f53bb936 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoPoint.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoPoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java index 6d07c3b1..d0e1d0db 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentProperty.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentProperty.java index fb38c8eb..0dd8ca02 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentProperty.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchMappingContext.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchMappingContext.java index 1de14ef9..2ebb8bf9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchMappingContext.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchMappingContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java index cbefb745..39a2fd47 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java index d9ab47f9..4ae6dc1c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/AbstractQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/AbstractQuery.java index b8bcfd52..ea76497b 100755 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/AbstractQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/AbstractQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/AliasBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/AliasBuilder.java index d139cf5e..f4dd696e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/AliasBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/AliasBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/AliasQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/AliasQuery.java index 4b65c72e..1a3be8ec 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/AliasQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/AliasQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java b/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java index 8da40560..d20b28b1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/CriteriaQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/CriteriaQuery.java index 00b5cb15..cda1a9dc 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/CriteriaQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/CriteriaQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/DeleteQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/DeleteQuery.java index be2cae43..3e787a7b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/DeleteQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/DeleteQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java b/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java index 75e94f67..e8e87a84 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilterBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilterBuilder.java index fe288985..7e71c392 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilterBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilterBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/Field.java b/src/main/java/org/springframework/data/elasticsearch/core/query/Field.java index 33c097da..8abb380f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/Field.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/Field.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/GetQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/GetQuery.java index 322ccaf6..68157cd4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/GetQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/GetQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexBoost.java b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexBoost.java index fd2e0c3a..a1b529ec 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexBoost.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexBoost.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java index 69a0b911..8981d417 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQueryBuilder.java index 1e82a2a6..13559789 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQueryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/MoreLikeThisQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/MoreLikeThisQuery.java index 610e3171..88c3abeb 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/MoreLikeThisQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/MoreLikeThisQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/NativeSearchQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/NativeSearchQuery.java index a54b8011..b500f970 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/NativeSearchQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/NativeSearchQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/NativeSearchQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/NativeSearchQueryBuilder.java index 4326fb44..ed799f10 100755 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/NativeSearchQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/NativeSearchQueryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/Query.java b/src/main/java/org/springframework/data/elasticsearch/core/query/Query.java index 27d2aeae..173edf94 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/Query.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/Query.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SearchQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SearchQuery.java index 2e648776..58c514a4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SearchQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SearchQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SimpleField.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SimpleField.java index c4bf7596..cded72c0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SimpleField.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SimpleField.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,4 +38,4 @@ public class SimpleField implements Field { public String toString() { return this.name; } -} \ No newline at end of file +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java index 7b232db5..d8da44dd 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/StringQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/StringQuery.java index 5ad65075..ed087277 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/StringQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/StringQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java index e6e79bd8..8044ae11 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQueryBuilder.java index f68ac21b..aa89b71a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQueryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchCrudRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchCrudRepository.java index 19f70fdd..70a5d475 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchCrudRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchCrudRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchRepository.java index 1fd9ab55..e6da8ac0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryBean.java b/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryBean.java index 770dff2e..ec255989 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryExtension.java b/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryExtension.java index aaf37dbe..ac819716 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryExtension.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoriesRegistrar.java b/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoriesRegistrar.java index 1ff41a65..49bdd39c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoriesRegistrar.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoryConfigExtension.java b/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoryConfigExtension.java index ea6baebd..824f20a9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoryConfigExtension.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoryConfigExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/config/EnableElasticsearchRepositories.java b/src/main/java/org/springframework/data/elasticsearch/repository/config/EnableElasticsearchRepositories.java index 9974401b..651d05ec 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/config/EnableElasticsearchRepositories.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/config/EnableElasticsearchRepositories.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java index 5f9a9b54..ca95b93e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java index b4123d94..bef93f43 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java index 0aa6ba0d..22a97375 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java index c7555ae8..8dcbfb2c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/ElasticsearchQueryCreator.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/ElasticsearchQueryCreator.java index 65616df8..5f6191df 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/ElasticsearchQueryCreator.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/ElasticsearchQueryCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/AbstractElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/AbstractElasticsearchRepository.java index e51de0e1..2b9dda99 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/AbstractElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/AbstractElasticsearchRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformation.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformation.java index c30ee73d..8b19dc98 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformation.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformation.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreator.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreator.java index 6bdc78b2..22899b0f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreator.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImpl.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImpl.java index 46421e0e..d91a354a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImpl.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java index ddc5861a..0c705042 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryBean.java index 991c263b..515c7766 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/MappingElasticsearchEntityInformation.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/MappingElasticsearchEntityInformation.java index b1e82b08..bde63ca3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/MappingElasticsearchEntityInformation.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/MappingElasticsearchEntityInformation.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java index 1e3eb506..75a802e2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/resources/notice.txt b/src/main/resources/notice.txt index 5922c578..da988b6a 100644 --- a/src/main/resources/notice.txt +++ b/src/main/resources/notice.txt @@ -1,5 +1,5 @@ Spring Data Elasticsearch 3.2 M1 -Copyright (c) [2013-2016] Pivotal Software, Inc. +Copyright (c) [2013-2019] Pivotal Software, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). You may not use this product except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/ElasticsearchVersion.java b/src/test/java/org/springframework/data/elasticsearch/ElasticsearchVersion.java index 6675e602..81664125 100644 --- a/src/test/java/org/springframework/data/elasticsearch/ElasticsearchVersion.java +++ b/src/test/java/org/springframework/data/elasticsearch/ElasticsearchVersion.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/ElasticsearchVersionRule.java b/src/test/java/org/springframework/data/elasticsearch/ElasticsearchVersionRule.java index 19c6f179..8e1ce09f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/ElasticsearchVersionRule.java +++ b/src/test/java/org/springframework/data/elasticsearch/ElasticsearchVersionRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/InnerObjectTests.java b/src/test/java/org/springframework/data/elasticsearch/InnerObjectTests.java index 024059ee..bd1b4c6e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/InnerObjectTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/InnerObjectTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2017 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/NestedObjectTests.java b/src/test/java/org/springframework/data/elasticsearch/NestedObjectTests.java index 066178c8..0c41ba76 100644 --- a/src/test/java/org/springframework/data/elasticsearch/NestedObjectTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/NestedObjectTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/NonDocumentEntityTests.java b/src/test/java/org/springframework/data/elasticsearch/NonDocumentEntityTests.java index e1ce1bdf..12d1e52f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/NonDocumentEntityTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/NonDocumentEntityTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/SpELEntityTests.java b/src/test/java/org/springframework/data/elasticsearch/SpELEntityTests.java index 7968b0c5..25fb2ddc 100644 --- a/src/test/java/org/springframework/data/elasticsearch/SpELEntityTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/SpELEntityTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/TestUtils.java b/src/test/java/org/springframework/data/elasticsearch/TestUtils.java index d8db1e71..7f61eb09 100644 --- a/src/test/java/org/springframework/data/elasticsearch/TestUtils.java +++ b/src/test/java/org/springframework/data/elasticsearch/TestUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/Utils.java b/src/test/java/org/springframework/data/elasticsearch/Utils.java index a11a2a3d..cab46a82 100644 --- a/src/test/java/org/springframework/data/elasticsearch/Utils.java +++ b/src/test/java/org/springframework/data/elasticsearch/Utils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/builder/SampleInheritedEntityBuilder.java b/src/test/java/org/springframework/data/elasticsearch/builder/SampleInheritedEntityBuilder.java index e36672ff..68cae473 100644 --- a/src/test/java/org/springframework/data/elasticsearch/builder/SampleInheritedEntityBuilder.java +++ b/src/test/java/org/springframework/data/elasticsearch/builder/SampleInheritedEntityBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java index 58ef1630..97ca2763 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/ClusterNodesUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/ClusterNodesUnitTests.java index 6159516c..877c5a27 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/ClusterNodesUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/ClusterNodesUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java index 5b2ae5cb..47268005 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/reactive/DefaultWebClientProviderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/reactive/DefaultWebClientProviderUnitTests.java index 86bb568e..ead3c390 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/reactive/DefaultWebClientProviderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/reactive/DefaultWebClientProviderUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/reactive/MultiNodeHostProviderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/reactive/MultiNodeHostProviderUnitTests.java index 6662b5ae..d7ce5b32 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/reactive/MultiNodeHostProviderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/reactive/MultiNodeHostProviderUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientTests.java b/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientTests.java index 83fdb4d9..13bbc5be 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientUnitTests.java index 803ee24c..0e1334d2 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveMockClientTestsUtils.java b/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveMockClientTestsUtils.java index 2cc6b9bd..7dce1a63 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveMockClientTestsUtils.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveMockClientTestsUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/reactive/SingleNodeHostProviderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/reactive/SingleNodeHostProviderUnitTests.java index 8532ed77..a10515ee 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/reactive/SingleNodeHostProviderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/reactive/SingleNodeHostProviderUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupportUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupportUnitTests.java index 45bc18dd..e245edc5 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupportUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupportUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandlerTests.java b/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandlerTests.java index 9c948d7f..4485fef1 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandlerTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandlerTests.java @@ -1,63 +1,63 @@ -/* - * Copyright 2013-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.config; - -import static org.hamcrest.CoreMatchers.*; -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.*; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; -import org.springframework.data.elasticsearch.client.RestClientFactoryBean; -import org.springframework.data.elasticsearch.client.TransportClientFactoryBean; -import org.springframework.data.elasticsearch.repositories.sample.SampleElasticsearchRepository; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -/** - * @author Rizwan Idrees - * @author Mohsin Husen - * @author Don Wellington - */ - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration("namespace.xml") -public class ElasticsearchNamespaceHandlerTests { - - @Autowired - private ApplicationContext context; - - @Test - public void shouldCreateTransportClient() { - assertThat(context.getBean(TransportClientFactoryBean.class), is(notNullValue())); - assertThat(context.getBean(TransportClientFactoryBean.class), is(instanceOf(TransportClientFactoryBean.class))); - } - - @Test - public void shouldCreateRepository() { - assertThat(context.getBean(TransportClientFactoryBean.class), is(notNullValue())); - assertThat(context.getBean(SampleElasticsearchRepository.class), - is(instanceOf(SampleElasticsearchRepository.class))); - } - - @Test - public void shouldCreateRestClient() { - assertThat(context.getBean(RestClientFactoryBean.class), is(notNullValue())); - assertThat(context.getBean(RestClientFactoryBean.class), is(instanceOf(RestClientFactoryBean.class))); - } -} +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.config; + +import static org.hamcrest.CoreMatchers.*; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.*; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.data.elasticsearch.client.RestClientFactoryBean; +import org.springframework.data.elasticsearch.client.TransportClientFactoryBean; +import org.springframework.data.elasticsearch.repositories.sample.SampleElasticsearchRepository; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +/** + * @author Rizwan Idrees + * @author Mohsin Husen + * @author Don Wellington + */ + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("namespace.xml") +public class ElasticsearchNamespaceHandlerTests { + + @Autowired + private ApplicationContext context; + + @Test + public void shouldCreateTransportClient() { + assertThat(context.getBean(TransportClientFactoryBean.class), is(notNullValue())); + assertThat(context.getBean(TransportClientFactoryBean.class), is(instanceOf(TransportClientFactoryBean.class))); + } + + @Test + public void shouldCreateRepository() { + assertThat(context.getBean(TransportClientFactoryBean.class), is(notNullValue())); + assertThat(context.getBean(SampleElasticsearchRepository.class), + is(instanceOf(SampleElasticsearchRepository.class))); + } + + @Test + public void shouldCreateRestClient() { + assertThat(context.getBean(RestClientFactoryBean.class), is(notNullValue())); + assertThat(context.getBean(RestClientFactoryBean.class), is(instanceOf(RestClientFactoryBean.class))); + } +} diff --git a/src/test/java/org/springframework/data/elasticsearch/config/EnableNestedElasticsearchRepositoriesTests.java b/src/test/java/org/springframework/data/elasticsearch/config/EnableNestedElasticsearchRepositoriesTests.java index d611e889..840238ea 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/EnableNestedElasticsearchRepositoriesTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/EnableNestedElasticsearchRepositoriesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/AliasTests.java b/src/test/java/org/springframework/data/elasticsearch/core/AliasTests.java index d866ddee..f59788c1 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/AliasTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/AliasTests.java @@ -1,5 +1,5 @@ /* -* Copyright 2014-2017 the original author or authors. +* Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/CustomEntityMapper.java b/src/test/java/org/springframework/data/elasticsearch/core/CustomEntityMapper.java index 45c108cf..4cd6390b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/CustomEntityMapper.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/CustomEntityMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/CustomResultMapper.java b/src/test/java/org/springframework/data/elasticsearch/core/CustomResultMapper.java index 5b86cdfe..5417843b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/CustomResultMapper.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/CustomResultMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/DefaultEntityMapperTests.java b/src/test/java/org/springframework/data/elasticsearch/core/DefaultEntityMapperTests.java index b07cb1eb..bf248424 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/DefaultEntityMapperTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/DefaultEntityMapperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/DefaultResultMapperTests.java b/src/test/java/org/springframework/data/elasticsearch/core/DefaultResultMapperTests.java index 38ba2f7b..6f7cce3a 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/DefaultResultMapperTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/DefaultResultMapperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchRestTemplateTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchRestTemplateTests.java index 6bd7fbed..8d8abe50 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchRestTemplateTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchRestTemplateTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2018 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateCustomMapperTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateCustomMapperTests.java index dc269263..65d2a0d6 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateCustomMapperTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateCustomMapperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateParentChildTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateParentChildTests.java index 71d0eab5..5354280f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateParentChildTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateParentChildTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateTests.java index d3a1b13b..58ef688b 100755 --- a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2018 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/LogEntityTests.java b/src/test/java/org/springframework/data/elasticsearch/core/LogEntityTests.java index ae110ad3..4c76a936 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/LogEntityTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/LogEntityTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/MappingBuilderTests.java b/src/test/java/org/springframework/data/elasticsearch/core/MappingBuilderTests.java index c9311270..2d410dd8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/MappingBuilderTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/MappingBuilderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplateTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplateTests.java index 580bf8a7..5cd3f073 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplateTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplateTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplateUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplateUnitTests.java index 86ba07a4..e4cae19d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplateUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplateUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/SimpleElasticsearchDateMappingTests.java b/src/test/java/org/springframework/data/elasticsearch/core/SimpleElasticsearchDateMappingTests.java index 1262e201..62043001 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/SimpleElasticsearchDateMappingTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/SimpleElasticsearchDateMappingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregatedPageImplTest.java b/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregatedPageImplTest.java index 9c9d1204..e66513d7 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregatedPageImplTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregatedPageImplTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/aggregation/ElasticsearchTemplateAggregationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/aggregation/ElasticsearchTemplateAggregationTests.java index 6cace539..86bd3c62 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/aggregation/ElasticsearchTemplateAggregationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/aggregation/ElasticsearchTemplateAggregationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/completion/AnnotatedCompletionEntityBuilder.java b/src/test/java/org/springframework/data/elasticsearch/core/completion/AnnotatedCompletionEntityBuilder.java index ed621714..348542f8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/completion/AnnotatedCompletionEntityBuilder.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/completion/AnnotatedCompletionEntityBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/completion/CompletionEntityAnnotatedBuilder.java b/src/test/java/org/springframework/data/elasticsearch/core/completion/CompletionEntityAnnotatedBuilder.java index f075c32c..b9ec4174 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/completion/CompletionEntityAnnotatedBuilder.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/completion/CompletionEntityAnnotatedBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/completion/CompletionEntityBuilder.java b/src/test/java/org/springframework/data/elasticsearch/core/completion/CompletionEntityBuilder.java index 9d0db095..584f01ed 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/completion/CompletionEntityBuilder.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/completion/CompletionEntityBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/completion/ElasticsearchTemplateCompletionTests.java b/src/test/java/org/springframework/data/elasticsearch/core/completion/ElasticsearchTemplateCompletionTests.java index b83d52b5..326db56d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/completion/ElasticsearchTemplateCompletionTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/completion/ElasticsearchTemplateCompletionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/convert/DateTimeConvertersTests.java b/src/test/java/org/springframework/data/elasticsearch/core/convert/DateTimeConvertersTests.java index 5c53b3e1..f7cdf82f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/convert/DateTimeConvertersTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/convert/DateTimeConvertersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterTests.java b/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterTests.java index f0f76988..a304c424 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/facet/ArticleEntity.java b/src/test/java/org/springframework/data/elasticsearch/core/facet/ArticleEntity.java index 5a64c1eb..1181f526 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/facet/ArticleEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/facet/ArticleEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2017 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/facet/ArticleEntityBuilder.java b/src/test/java/org/springframework/data/elasticsearch/core/facet/ArticleEntityBuilder.java index 65d00f72..53896fac 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/facet/ArticleEntityBuilder.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/facet/ArticleEntityBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/facet/ElasticsearchTemplateFacetTests.java b/src/test/java/org/springframework/data/elasticsearch/core/facet/ElasticsearchTemplateFacetTests.java index c398e979..24e2c840 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/facet/ElasticsearchTemplateFacetTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/facet/ElasticsearchTemplateFacetTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/facet/LogEntity.java b/src/test/java/org/springframework/data/elasticsearch/core/facet/LogEntity.java index fe584569..82afddab 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/facet/LogEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/facet/LogEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/facet/LogEntityBuilder.java b/src/test/java/org/springframework/data/elasticsearch/core/facet/LogEntityBuilder.java index 65032e4d..dde6c0bc 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/facet/LogEntityBuilder.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/facet/LogEntityBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/AuthorMarkerEntity.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/AuthorMarkerEntity.java index 82be3b62..0cdd5057 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/AuthorMarkerEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/AuthorMarkerEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/AuthorMarkerEntityBuilder.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/AuthorMarkerEntityBuilder.java index 209e5e5a..d38776f8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/AuthorMarkerEntityBuilder.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/AuthorMarkerEntityBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/ElasticsearchTemplateGeoTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/ElasticsearchTemplateGeoTests.java index 97c86025..94332dca 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/ElasticsearchTemplateGeoTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/ElasticsearchTemplateGeoTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/LocationMarkerEntity.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/LocationMarkerEntity.java index 2d53a312..3bf8bafd 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/LocationMarkerEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/LocationMarkerEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntityTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntityTests.java index 72a0e3be..7e1143bb 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntityTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntityTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2018 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentPropertyUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentPropertyUnitTests.java index d7927492..5ef14991 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentPropertyUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentPropertyUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryTests.java index 319973d3..cff10684 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/AbstractInheritedEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/AbstractInheritedEntity.java index a11d33a8..8407e589 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/AbstractInheritedEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/AbstractInheritedEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/Author.java b/src/test/java/org/springframework/data/elasticsearch/entities/Author.java index 5507385e..bbecfa16 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/Author.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/Author.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/Book.java b/src/test/java/org/springframework/data/elasticsearch/entities/Book.java index 43d4ab20..263049ce 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/Book.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/Book.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/Car.java b/src/test/java/org/springframework/data/elasticsearch/entities/Car.java index 9a8d82ce..466dc45e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/Car.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/Car.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/CopyToEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/CopyToEntity.java index d11551ec..21c7af31 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/CopyToEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/CopyToEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/DoubleIDEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/DoubleIDEntity.java index 09b477ac..c78d77d9 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/DoubleIDEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/DoubleIDEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/DynamicSettingAndMappingEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/DynamicSettingAndMappingEntity.java index 6778eb54..6139c060 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/DynamicSettingAndMappingEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/DynamicSettingAndMappingEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/FieldDynamicMappingEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/FieldDynamicMappingEntity.java index 53400b42..5a97b72a 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/FieldDynamicMappingEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/FieldDynamicMappingEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/GirlFriend.java b/src/test/java/org/springframework/data/elasticsearch/entities/GirlFriend.java index 9613678c..a2ac1bb9 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/GirlFriend.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/GirlFriend.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/Group.java b/src/test/java/org/springframework/data/elasticsearch/entities/Group.java index 148048e8..2e1bc6d4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/Group.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/Group.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 the original author or authors. + * Copyright 2017-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/HetroEntity1.java b/src/test/java/org/springframework/data/elasticsearch/entities/HetroEntity1.java index ea16d072..aaeccbca 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/HetroEntity1.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/HetroEntity1.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/HetroEntity2.java b/src/test/java/org/springframework/data/elasticsearch/entities/HetroEntity2.java index 9b4eea1b..34497db4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/HetroEntity2.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/HetroEntity2.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/IntegerIDEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/IntegerIDEntity.java index 4dabee8f..f1faabc7 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/IntegerIDEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/IntegerIDEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/MinimalEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/MinimalEntity.java index ab4884d1..4a34b14f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/MinimalEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/MinimalEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/NonDocumentEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/NonDocumentEntity.java index 7391fb8f..5cd5ccf0 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/NonDocumentEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/NonDocumentEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/NormalizerEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/NormalizerEntity.java index 9cf75c07..32273023 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/NormalizerEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/NormalizerEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 the original author or authors. + * Copyright 2018-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/ParentEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/ParentEntity.java index e02e2b38..d54aaa95 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/ParentEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/ParentEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/Person.java b/src/test/java/org/springframework/data/elasticsearch/entities/Person.java index 6bfa325d..b39f4cc4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/Person.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/Person.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/PersonMultipleLevelNested.java b/src/test/java/org/springframework/data/elasticsearch/entities/PersonMultipleLevelNested.java index c37b88e6..7d7ee13a 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/PersonMultipleLevelNested.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/PersonMultipleLevelNested.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/Product.java b/src/test/java/org/springframework/data/elasticsearch/entities/Product.java index 352a4038..219332df 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/Product.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/Product.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntity.java index 344735f0..2c5042d8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntityUUIDKeyed.java b/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntityUUIDKeyed.java index d88f909b..fd6c4ce1 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntityUUIDKeyed.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntityUUIDKeyed.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/SampleInheritedEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/SampleInheritedEntity.java index 08400ded..f351da61 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/SampleInheritedEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/SampleInheritedEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/SampleMappingEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/SampleMappingEntity.java index d6624566..b50aa1e2 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/SampleMappingEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/SampleMappingEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/SampleTransientEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/SampleTransientEntity.java index 7dc73908..495c90e0 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/SampleTransientEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/SampleTransientEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/SimpleRecursiveEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/SimpleRecursiveEntity.java index e0f9d314..94202b16 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/SimpleRecursiveEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/SimpleRecursiveEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/SpELEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/SpELEntity.java index b423727a..b03e3842 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/SpELEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/SpELEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/StockPrice.java b/src/test/java/org/springframework/data/elasticsearch/entities/StockPrice.java index b1ce5926..5ea74064 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/StockPrice.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/StockPrice.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/SynonymEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/SynonymEntity.java index 684d29c5..cb8ced45 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/SynonymEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/SynonymEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/User.java b/src/test/java/org/springframework/data/elasticsearch/entities/User.java index 9d3ba386..c35e3f08 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/User.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/User.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 the original author or authors. + * Copyright 2017-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableElasticsearchRepository.java b/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableElasticsearchRepository.java index 41f39be1..9b00e08f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableElasticsearchRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableElasticsearchRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableElasticsearchRepositoryTests.java b/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableElasticsearchRepositoryTests.java index d9ff3aba..afd8a98d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableElasticsearchRepositoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableElasticsearchRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2017 the original author or authors. + * Copyright 2016-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableEntity.java b/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableEntity.java index f066c3ec..3e159a5a 100644 --- a/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/CustomMethodRepositoryBaseTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/CustomMethodRepositoryBaseTests.java index 76d4b961..07820114 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/CustomMethodRepositoryBaseTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/CustomMethodRepositoryBaseTests.java @@ -1,1202 +1,1202 @@ -/* - * Copyright 2013-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.repositories; - -import static org.apache.commons.lang.RandomStringUtils.*; -import static org.hamcrest.Matchers.*; -import static org.junit.Assert.*; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Stream; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; -import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; -import org.springframework.data.elasticsearch.core.geo.GeoPoint; -import org.springframework.data.elasticsearch.entities.SampleEntity; -import org.springframework.data.elasticsearch.repositories.custom.SampleCustomMethodRepository; -import org.springframework.data.geo.Box; -import org.springframework.data.geo.Distance; -import org.springframework.data.geo.Metrics; -import org.springframework.data.geo.Point; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -/** - * @author Rizwan Idrees - * @author Mohsin Husen - * @author Franck Marchand - * @author Kevin Leturc - * @author Christoph Strobl - * @author Don Wellington - */ - -public abstract class CustomMethodRepositoryBaseTests { - - @Autowired private SampleCustomMethodRepository repository; - - @Test - public void shouldExecuteCustomMethod() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setMessage("some message"); - repository.save(sampleEntity); - // when - Page page = repository.findByType("test", new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(greaterThanOrEqualTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodForNot() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("some"); - sampleEntity.setMessage("some message"); - repository.save(sampleEntity); - // when - Page page = repository.findByTypeNot("test", new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodWithQuery() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - String searchTerm = "customQuery"; - sampleEntity.setMessage(searchTerm); - repository.save(sampleEntity); - // when - Page page = repository.findByMessage(searchTerm.toLowerCase(), new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(greaterThanOrEqualTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodWithLessThan() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(9); - sampleEntity.setMessage("some message"); - repository.save(sampleEntity); - - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setType("test"); - sampleEntity2.setRate(20); - sampleEntity2.setMessage("some message"); - repository.save(sampleEntity2); - - // when - Page page = repository.findByRateLessThan(10, new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodWithBefore() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("some message"); - repository.save(sampleEntity); - - // when - Page page = repository.findByRateBefore(10, new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodWithAfter() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("some message"); - repository.save(sampleEntity); - - // when - Page page = repository.findByRateAfter(10, new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodWithLike() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - repository.save(sampleEntity); - - // when - Page page = repository.findByMessageLike("fo", new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodForStartingWith() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - repository.save(sampleEntity); - - // when - Page page = repository.findByMessageStartingWith("fo", new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodForEndingWith() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - repository.save(sampleEntity); - - // when - Page page = repository.findByMessageEndingWith("o", new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodForContains() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - repository.save(sampleEntity); - - // when - Page page = repository.findByMessageContaining("fo", new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodForIn() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setMessage("foo"); - repository.save(sampleEntity); - - // given - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setType("test"); - sampleEntity2.setMessage("bar"); - repository.save(sampleEntity2); - - List ids = Arrays.asList(documentId, documentId2); - - // when - Page page = repository.findByIdIn(ids, new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(2L))); - } - - @Test - public void shouldExecuteCustomMethodForNotIn() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setMessage("foo"); - repository.save(sampleEntity); - - // given - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setType("test"); - sampleEntity2.setMessage("bar"); - repository.save(sampleEntity2); - - List ids = Arrays.asList(documentId); - - // when - Page page = repository.findByIdNotIn(ids, new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - assertThat(page.getContent().get(0).getId(), is(documentId2)); - } - - @Test - public void shouldExecuteCustomMethodForTrue() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setMessage("foo"); - sampleEntity.setAvailable(true); - repository.save(sampleEntity); - - // given - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setType("test"); - sampleEntity2.setMessage("bar"); - sampleEntity2.setAvailable(false); - repository.save(sampleEntity2); - // when - Page page = repository.findByAvailableTrue(new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodForFalse() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setMessage("foo"); - sampleEntity.setAvailable(true); - repository.save(sampleEntity); - - // given - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setType("test"); - sampleEntity2.setMessage("bar"); - sampleEntity2.setAvailable(false); - repository.save(sampleEntity2); - // when - Page page = repository.findByAvailableFalse(new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodForOrderBy() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("abc"); - sampleEntity.setMessage("test"); - sampleEntity.setAvailable(true); - repository.save(sampleEntity); - - // document 2 - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setType("xyz"); - sampleEntity2.setMessage("bar"); - sampleEntity2.setAvailable(false); - repository.save(sampleEntity2); - - // document 3 - String documentId3 = randomNumeric(5); - SampleEntity sampleEntity3 = new SampleEntity(); - sampleEntity3.setId(documentId3); - sampleEntity3.setType("def"); - sampleEntity3.setMessage("foo"); - sampleEntity3.setAvailable(false); - repository.save(sampleEntity3); - - // when - Page page = repository.findByMessageOrderByTypeAsc("foo", new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodWithBooleanParameter() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setMessage("foo"); - sampleEntity.setAvailable(true); - repository.save(sampleEntity); - - // given - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setType("test"); - sampleEntity2.setMessage("bar"); - sampleEntity2.setAvailable(false); - repository.save(sampleEntity2); - // when - Page page = repository.findByAvailable(false, new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldReturnPageableResultsWithQueryAnnotationExpectedPageSize() { - // given - for (int i = 0; i < 30; i++) { - String documentId = String.valueOf(i); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setMessage("message"); - sampleEntity.setVersion(System.currentTimeMillis()); - repository.save(sampleEntity); - } - // when - Page pageResult = repository.findByMessage("message", new PageRequest(0, 23)); - // then - assertThat(pageResult.getTotalElements(), is(equalTo(30L))); - assertThat(pageResult.getContent().size(), is(equalTo(23))); - } - - @Test - public void shouldReturnPageableResultsWithGivenSortingOrder() { - // given - String documentId = random(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setMessage("abc"); - sampleEntity.setVersion(System.currentTimeMillis()); - repository.save(sampleEntity); - - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setMessage("abd"); - sampleEntity.setVersion(System.currentTimeMillis()); - repository.save(sampleEntity2); - - String documentId3 = randomNumeric(5); - SampleEntity sampleEntity3 = new SampleEntity(); - sampleEntity3.setId(documentId3); - sampleEntity3.setMessage("abe"); - sampleEntity.setVersion(System.currentTimeMillis()); - repository.save(sampleEntity3); - // when - Page pageResult = repository.findByMessageContaining("a", - new PageRequest(0, 23, new Sort(new Sort.Order(Sort.Direction.DESC, "message")))); - // then - assertThat(pageResult.getContent().isEmpty(), is(false)); - assertThat(pageResult.getContent().get(0).getMessage(), is(sampleEntity3.getMessage())); - } - - @Test - public void shouldReturnListForMessage() { - // given - String documentId = random(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setMessage("abc"); - sampleEntity.setVersion(System.currentTimeMillis()); - repository.save(sampleEntity); - - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setMessage("abd"); - sampleEntity.setVersion(System.currentTimeMillis()); - repository.save(sampleEntity2); - - String documentId3 = randomNumeric(5); - SampleEntity sampleEntity3 = new SampleEntity(); - sampleEntity3.setId(documentId3); - sampleEntity3.setMessage("abe"); - sampleEntity.setVersion(System.currentTimeMillis()); - repository.save(sampleEntity3); - // when - List sampleEntities = repository.findByMessage("abc"); - // then - assertThat(sampleEntities.isEmpty(), is(false)); - assertThat(sampleEntities.size(), is(1)); - } - - @Test - public void shouldExecuteCustomMethodWithGeoPoint() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); - - repository.save(sampleEntity); - - // when - Page page = repository.findByLocation(new GeoPoint(45.7806d, 3.0875d), new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodWithGeoPointAndString() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); - - repository.save(sampleEntity); - - documentId = randomNumeric(5); - sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - sampleEntity.setLocation(new GeoPoint(48.7806d, 3.0875d)); - - repository.save(sampleEntity); - - // when - Page page = repository.findByLocationAndMessage(new GeoPoint(45.7806d, 3.0875d), "foo", - new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodWithWithinGeoPoint() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); - - repository.save(sampleEntity); - - // when - Page page = repository.findByLocationWithin(new GeoPoint(45.7806d, 3.0875d), "2km", - new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodWithWithinPoint() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); - - repository.save(sampleEntity); - - // when - Page page = repository.findByLocationWithin(new Point(45.7806d, 3.0875d), - new Distance(2, Metrics.KILOMETERS), new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodWithNearBox() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); - - repository.save(sampleEntity); - - documentId = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId); - sampleEntity2.setType("test2"); - sampleEntity2.setRate(10); - sampleEntity2.setMessage("foo"); - sampleEntity2.setLocation(new GeoPoint(30.7806d, 0.0875d)); - - repository.save(sampleEntity2); - - // when - Page pageAll = repository.findAll(new PageRequest(0, 10)); - // then - assertThat(pageAll, is(notNullValue())); - assertThat(pageAll.getTotalElements(), is(equalTo(2L))); - - // when - Page page = repository.findByLocationNear(new Box(new Point(46d, 3d), new Point(45d, 4d)), - new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - @Test - public void shouldExecuteCustomMethodWithNearPointAndDistance() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); - - repository.save(sampleEntity); - - // when - Page page = repository.findByLocationNear(new Point(45.7806d, 3.0875d), - new Distance(2, Metrics.KILOMETERS), new PageRequest(0, 10)); - // then - assertThat(page, is(notNullValue())); - assertThat(page.getTotalElements(), is(equalTo(1L))); - } - - /* - DATAES-165 - */ - @Test - public void shouldAllowReturningJava8StreamInCustomQuery() { - // given - List entities = createSampleEntities("abc", 30); - repository.saveAll(entities); - - // when - Stream stream = repository.findByType("abc"); - // then - assertThat(stream, is(notNullValue())); - assertThat(stream.count(), is(equalTo(30L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethod() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setMessage("some message"); - - repository.save(sampleEntity); - - documentId = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId); - sampleEntity2.setType("test2"); - sampleEntity2.setMessage("some message"); - - repository.save(sampleEntity2); - - // when - long count = repository.countByType("test"); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodForNot() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("some"); - sampleEntity.setMessage("some message"); - - repository.save(sampleEntity); - - documentId = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId); - sampleEntity2.setType("test"); - sampleEntity2.setMessage("some message"); - - repository.save(sampleEntity2); - - // when - long count = repository.countByTypeNot("test"); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodWithBooleanParameter() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setMessage("foo"); - sampleEntity.setAvailable(true); - repository.save(sampleEntity); - - // given - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setType("test"); - sampleEntity2.setMessage("bar"); - sampleEntity2.setAvailable(false); - repository.save(sampleEntity2); - // when - long count = repository.countByAvailable(false); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodWithLessThan() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(9); - sampleEntity.setMessage("some message"); - repository.save(sampleEntity); - - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setType("test"); - sampleEntity2.setRate(20); - sampleEntity2.setMessage("some message"); - repository.save(sampleEntity2); - - // when - long count = repository.countByRateLessThan(10); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodWithBefore() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("some message"); - - repository.save(sampleEntity); - - documentId = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId); - sampleEntity2.setType("test"); - sampleEntity2.setRate(20); - sampleEntity2.setMessage("some message"); - - repository.save(sampleEntity2); - - // when - long count = repository.countByRateBefore(10); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodWithAfter() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("some message"); - - repository.save(sampleEntity); - - documentId = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId); - sampleEntity2.setType("test"); - sampleEntity2.setRate(0); - sampleEntity2.setMessage("some message"); - - repository.save(sampleEntity2); - - // when - long count = repository.countByRateAfter(10); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodWithLike() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - - repository.save(sampleEntity); - - documentId = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId); - sampleEntity2.setType("test"); - sampleEntity2.setRate(10); - sampleEntity2.setMessage("some message"); - - repository.save(sampleEntity2); - - // when - long count = repository.countByMessageLike("fo"); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodForStartingWith() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - - repository.save(sampleEntity); - - documentId = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId); - sampleEntity2.setType("test"); - sampleEntity2.setRate(10); - sampleEntity2.setMessage("some message"); - - repository.save(sampleEntity2); - - // when - long count = repository.countByMessageStartingWith("fo"); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodForEndingWith() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - - repository.save(sampleEntity); - - documentId = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId); - sampleEntity2.setType("test"); - sampleEntity2.setRate(10); - sampleEntity2.setMessage("some message"); - - repository.save(sampleEntity2); - - // when - long count = repository.countByMessageEndingWith("o"); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodForContains() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - - repository.save(sampleEntity); - - documentId = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId); - sampleEntity2.setType("test"); - sampleEntity2.setRate(10); - sampleEntity2.setMessage("some message"); - - repository.save(sampleEntity2); - - // when - long count = repository.countByMessageContaining("fo"); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodForIn() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setMessage("foo"); - repository.save(sampleEntity); - - // given - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setType("test"); - sampleEntity2.setMessage("bar"); - repository.save(sampleEntity2); - - List ids = Arrays.asList(documentId, documentId2); - - // when - long count = repository.countByIdIn(ids); - // then - assertThat(count, is(equalTo(2L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodForNotIn() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setMessage("foo"); - repository.save(sampleEntity); - - // given - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setType("test"); - sampleEntity2.setMessage("bar"); - repository.save(sampleEntity2); - - List ids = Arrays.asList(documentId); - - // when - long count = repository.countByIdNotIn(ids); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodForTrue() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setMessage("foo"); - sampleEntity.setAvailable(true); - repository.save(sampleEntity); - - // given - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setType("test"); - sampleEntity2.setMessage("bar"); - sampleEntity2.setAvailable(false); - repository.save(sampleEntity2); - // when - long count = repository.countByAvailableTrue(); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodForFalse() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setMessage("foo"); - sampleEntity.setAvailable(true); - repository.save(sampleEntity); - - // given - String documentId2 = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId2); - sampleEntity2.setType("test"); - sampleEntity2.setMessage("bar"); - sampleEntity2.setAvailable(false); - repository.save(sampleEntity2); - // when - long count = repository.countByAvailableFalse(); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodWithWithinGeoPoint() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); - - repository.save(sampleEntity); - - documentId = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId); - sampleEntity2.setType("test"); - sampleEntity2.setRate(10); - sampleEntity2.setMessage("foo"); - sampleEntity2.setLocation(new GeoPoint(30.7806d, 0.0875d)); - - repository.save(sampleEntity2); - - // when - long count = repository.countByLocationWithin(new GeoPoint(45.7806d, 3.0875d), "2km"); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodWithWithinPoint() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); - - repository.save(sampleEntity); - - documentId = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId); - sampleEntity2.setType("test"); - sampleEntity2.setRate(10); - sampleEntity2.setMessage("foo"); - sampleEntity2.setLocation(new GeoPoint(30.7806d, 0.0875d)); - - repository.save(sampleEntity2); - - // when - long count = repository.countByLocationWithin(new Point(45.7806d, 3.0875d), new Distance(2, Metrics.KILOMETERS)); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodWithNearBox() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); - - repository.save(sampleEntity); - - documentId = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId); - sampleEntity2.setType("test2"); - sampleEntity2.setRate(10); - sampleEntity2.setMessage("foo"); - sampleEntity2.setLocation(new GeoPoint(30.7806d, 0.0875d)); - - repository.save(sampleEntity2); - - // when - long count = repository.countByLocationNear(new Box(new Point(46d, 3d), new Point(45d, 4d))); - // then - assertThat(count, is(equalTo(1L))); - } - - /* - DATAES-106 - */ - @Test - public void shouldCountCustomMethodWithNearPointAndDistance() { - // given - String documentId = randomNumeric(5); - SampleEntity sampleEntity = new SampleEntity(); - sampleEntity.setId(documentId); - sampleEntity.setType("test"); - sampleEntity.setRate(10); - sampleEntity.setMessage("foo"); - sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); - - repository.save(sampleEntity); - - documentId = randomNumeric(5); - SampleEntity sampleEntity2 = new SampleEntity(); - sampleEntity2.setId(documentId); - sampleEntity2.setType("test"); - sampleEntity2.setRate(10); - sampleEntity2.setMessage("foo"); - sampleEntity2.setLocation(new GeoPoint(30.7806d, 0.0875d)); - - repository.save(sampleEntity2); - - // when - long count = repository.countByLocationNear(new Point(45.7806d, 3.0875d), new Distance(2, Metrics.KILOMETERS)); - // then - assertThat(count, is(equalTo(1L))); - } - - private List createSampleEntities(String type, int numberOfEntities) { - List entities = new ArrayList<>(); - for (int i = 0; i < numberOfEntities; i++) { - SampleEntity entity = new SampleEntity(); - entity.setId(randomNumeric(numberOfEntities)); - entity.setAvailable(true); - entity.setMessage("Message"); - entity.setType(type); - entities.add(entity); - } - return entities; - } -} +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repositories; + +import static org.apache.commons.lang.RandomStringUtils.*; +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Stream; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; +import org.springframework.data.elasticsearch.core.geo.GeoPoint; +import org.springframework.data.elasticsearch.entities.SampleEntity; +import org.springframework.data.elasticsearch.repositories.custom.SampleCustomMethodRepository; +import org.springframework.data.geo.Box; +import org.springframework.data.geo.Distance; +import org.springframework.data.geo.Metrics; +import org.springframework.data.geo.Point; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +/** + * @author Rizwan Idrees + * @author Mohsin Husen + * @author Franck Marchand + * @author Kevin Leturc + * @author Christoph Strobl + * @author Don Wellington + */ + +public abstract class CustomMethodRepositoryBaseTests { + + @Autowired private SampleCustomMethodRepository repository; + + @Test + public void shouldExecuteCustomMethod() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setMessage("some message"); + repository.save(sampleEntity); + // when + Page page = repository.findByType("test", new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(greaterThanOrEqualTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodForNot() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("some"); + sampleEntity.setMessage("some message"); + repository.save(sampleEntity); + // when + Page page = repository.findByTypeNot("test", new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodWithQuery() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + String searchTerm = "customQuery"; + sampleEntity.setMessage(searchTerm); + repository.save(sampleEntity); + // when + Page page = repository.findByMessage(searchTerm.toLowerCase(), new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(greaterThanOrEqualTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodWithLessThan() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(9); + sampleEntity.setMessage("some message"); + repository.save(sampleEntity); + + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setType("test"); + sampleEntity2.setRate(20); + sampleEntity2.setMessage("some message"); + repository.save(sampleEntity2); + + // when + Page page = repository.findByRateLessThan(10, new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodWithBefore() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("some message"); + repository.save(sampleEntity); + + // when + Page page = repository.findByRateBefore(10, new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodWithAfter() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("some message"); + repository.save(sampleEntity); + + // when + Page page = repository.findByRateAfter(10, new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodWithLike() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + repository.save(sampleEntity); + + // when + Page page = repository.findByMessageLike("fo", new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodForStartingWith() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + repository.save(sampleEntity); + + // when + Page page = repository.findByMessageStartingWith("fo", new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodForEndingWith() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + repository.save(sampleEntity); + + // when + Page page = repository.findByMessageEndingWith("o", new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodForContains() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + repository.save(sampleEntity); + + // when + Page page = repository.findByMessageContaining("fo", new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodForIn() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setMessage("foo"); + repository.save(sampleEntity); + + // given + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setType("test"); + sampleEntity2.setMessage("bar"); + repository.save(sampleEntity2); + + List ids = Arrays.asList(documentId, documentId2); + + // when + Page page = repository.findByIdIn(ids, new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(2L))); + } + + @Test + public void shouldExecuteCustomMethodForNotIn() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setMessage("foo"); + repository.save(sampleEntity); + + // given + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setType("test"); + sampleEntity2.setMessage("bar"); + repository.save(sampleEntity2); + + List ids = Arrays.asList(documentId); + + // when + Page page = repository.findByIdNotIn(ids, new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + assertThat(page.getContent().get(0).getId(), is(documentId2)); + } + + @Test + public void shouldExecuteCustomMethodForTrue() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setMessage("foo"); + sampleEntity.setAvailable(true); + repository.save(sampleEntity); + + // given + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setType("test"); + sampleEntity2.setMessage("bar"); + sampleEntity2.setAvailable(false); + repository.save(sampleEntity2); + // when + Page page = repository.findByAvailableTrue(new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodForFalse() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setMessage("foo"); + sampleEntity.setAvailable(true); + repository.save(sampleEntity); + + // given + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setType("test"); + sampleEntity2.setMessage("bar"); + sampleEntity2.setAvailable(false); + repository.save(sampleEntity2); + // when + Page page = repository.findByAvailableFalse(new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodForOrderBy() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("abc"); + sampleEntity.setMessage("test"); + sampleEntity.setAvailable(true); + repository.save(sampleEntity); + + // document 2 + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setType("xyz"); + sampleEntity2.setMessage("bar"); + sampleEntity2.setAvailable(false); + repository.save(sampleEntity2); + + // document 3 + String documentId3 = randomNumeric(5); + SampleEntity sampleEntity3 = new SampleEntity(); + sampleEntity3.setId(documentId3); + sampleEntity3.setType("def"); + sampleEntity3.setMessage("foo"); + sampleEntity3.setAvailable(false); + repository.save(sampleEntity3); + + // when + Page page = repository.findByMessageOrderByTypeAsc("foo", new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodWithBooleanParameter() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setMessage("foo"); + sampleEntity.setAvailable(true); + repository.save(sampleEntity); + + // given + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setType("test"); + sampleEntity2.setMessage("bar"); + sampleEntity2.setAvailable(false); + repository.save(sampleEntity2); + // when + Page page = repository.findByAvailable(false, new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldReturnPageableResultsWithQueryAnnotationExpectedPageSize() { + // given + for (int i = 0; i < 30; i++) { + String documentId = String.valueOf(i); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setMessage("message"); + sampleEntity.setVersion(System.currentTimeMillis()); + repository.save(sampleEntity); + } + // when + Page pageResult = repository.findByMessage("message", new PageRequest(0, 23)); + // then + assertThat(pageResult.getTotalElements(), is(equalTo(30L))); + assertThat(pageResult.getContent().size(), is(equalTo(23))); + } + + @Test + public void shouldReturnPageableResultsWithGivenSortingOrder() { + // given + String documentId = random(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setMessage("abc"); + sampleEntity.setVersion(System.currentTimeMillis()); + repository.save(sampleEntity); + + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setMessage("abd"); + sampleEntity.setVersion(System.currentTimeMillis()); + repository.save(sampleEntity2); + + String documentId3 = randomNumeric(5); + SampleEntity sampleEntity3 = new SampleEntity(); + sampleEntity3.setId(documentId3); + sampleEntity3.setMessage("abe"); + sampleEntity.setVersion(System.currentTimeMillis()); + repository.save(sampleEntity3); + // when + Page pageResult = repository.findByMessageContaining("a", + new PageRequest(0, 23, new Sort(new Sort.Order(Sort.Direction.DESC, "message")))); + // then + assertThat(pageResult.getContent().isEmpty(), is(false)); + assertThat(pageResult.getContent().get(0).getMessage(), is(sampleEntity3.getMessage())); + } + + @Test + public void shouldReturnListForMessage() { + // given + String documentId = random(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setMessage("abc"); + sampleEntity.setVersion(System.currentTimeMillis()); + repository.save(sampleEntity); + + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setMessage("abd"); + sampleEntity.setVersion(System.currentTimeMillis()); + repository.save(sampleEntity2); + + String documentId3 = randomNumeric(5); + SampleEntity sampleEntity3 = new SampleEntity(); + sampleEntity3.setId(documentId3); + sampleEntity3.setMessage("abe"); + sampleEntity.setVersion(System.currentTimeMillis()); + repository.save(sampleEntity3); + // when + List sampleEntities = repository.findByMessage("abc"); + // then + assertThat(sampleEntities.isEmpty(), is(false)); + assertThat(sampleEntities.size(), is(1)); + } + + @Test + public void shouldExecuteCustomMethodWithGeoPoint() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); + + repository.save(sampleEntity); + + // when + Page page = repository.findByLocation(new GeoPoint(45.7806d, 3.0875d), new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodWithGeoPointAndString() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); + + repository.save(sampleEntity); + + documentId = randomNumeric(5); + sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + sampleEntity.setLocation(new GeoPoint(48.7806d, 3.0875d)); + + repository.save(sampleEntity); + + // when + Page page = repository.findByLocationAndMessage(new GeoPoint(45.7806d, 3.0875d), "foo", + new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodWithWithinGeoPoint() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); + + repository.save(sampleEntity); + + // when + Page page = repository.findByLocationWithin(new GeoPoint(45.7806d, 3.0875d), "2km", + new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodWithWithinPoint() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); + + repository.save(sampleEntity); + + // when + Page page = repository.findByLocationWithin(new Point(45.7806d, 3.0875d), + new Distance(2, Metrics.KILOMETERS), new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodWithNearBox() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); + + repository.save(sampleEntity); + + documentId = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId); + sampleEntity2.setType("test2"); + sampleEntity2.setRate(10); + sampleEntity2.setMessage("foo"); + sampleEntity2.setLocation(new GeoPoint(30.7806d, 0.0875d)); + + repository.save(sampleEntity2); + + // when + Page pageAll = repository.findAll(new PageRequest(0, 10)); + // then + assertThat(pageAll, is(notNullValue())); + assertThat(pageAll.getTotalElements(), is(equalTo(2L))); + + // when + Page page = repository.findByLocationNear(new Box(new Point(46d, 3d), new Point(45d, 4d)), + new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + @Test + public void shouldExecuteCustomMethodWithNearPointAndDistance() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); + + repository.save(sampleEntity); + + // when + Page page = repository.findByLocationNear(new Point(45.7806d, 3.0875d), + new Distance(2, Metrics.KILOMETERS), new PageRequest(0, 10)); + // then + assertThat(page, is(notNullValue())); + assertThat(page.getTotalElements(), is(equalTo(1L))); + } + + /* + DATAES-165 + */ + @Test + public void shouldAllowReturningJava8StreamInCustomQuery() { + // given + List entities = createSampleEntities("abc", 30); + repository.saveAll(entities); + + // when + Stream stream = repository.findByType("abc"); + // then + assertThat(stream, is(notNullValue())); + assertThat(stream.count(), is(equalTo(30L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethod() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setMessage("some message"); + + repository.save(sampleEntity); + + documentId = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId); + sampleEntity2.setType("test2"); + sampleEntity2.setMessage("some message"); + + repository.save(sampleEntity2); + + // when + long count = repository.countByType("test"); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodForNot() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("some"); + sampleEntity.setMessage("some message"); + + repository.save(sampleEntity); + + documentId = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId); + sampleEntity2.setType("test"); + sampleEntity2.setMessage("some message"); + + repository.save(sampleEntity2); + + // when + long count = repository.countByTypeNot("test"); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodWithBooleanParameter() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setMessage("foo"); + sampleEntity.setAvailable(true); + repository.save(sampleEntity); + + // given + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setType("test"); + sampleEntity2.setMessage("bar"); + sampleEntity2.setAvailable(false); + repository.save(sampleEntity2); + // when + long count = repository.countByAvailable(false); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodWithLessThan() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(9); + sampleEntity.setMessage("some message"); + repository.save(sampleEntity); + + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setType("test"); + sampleEntity2.setRate(20); + sampleEntity2.setMessage("some message"); + repository.save(sampleEntity2); + + // when + long count = repository.countByRateLessThan(10); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodWithBefore() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("some message"); + + repository.save(sampleEntity); + + documentId = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId); + sampleEntity2.setType("test"); + sampleEntity2.setRate(20); + sampleEntity2.setMessage("some message"); + + repository.save(sampleEntity2); + + // when + long count = repository.countByRateBefore(10); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodWithAfter() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("some message"); + + repository.save(sampleEntity); + + documentId = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId); + sampleEntity2.setType("test"); + sampleEntity2.setRate(0); + sampleEntity2.setMessage("some message"); + + repository.save(sampleEntity2); + + // when + long count = repository.countByRateAfter(10); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodWithLike() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + + repository.save(sampleEntity); + + documentId = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId); + sampleEntity2.setType("test"); + sampleEntity2.setRate(10); + sampleEntity2.setMessage("some message"); + + repository.save(sampleEntity2); + + // when + long count = repository.countByMessageLike("fo"); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodForStartingWith() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + + repository.save(sampleEntity); + + documentId = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId); + sampleEntity2.setType("test"); + sampleEntity2.setRate(10); + sampleEntity2.setMessage("some message"); + + repository.save(sampleEntity2); + + // when + long count = repository.countByMessageStartingWith("fo"); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodForEndingWith() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + + repository.save(sampleEntity); + + documentId = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId); + sampleEntity2.setType("test"); + sampleEntity2.setRate(10); + sampleEntity2.setMessage("some message"); + + repository.save(sampleEntity2); + + // when + long count = repository.countByMessageEndingWith("o"); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodForContains() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + + repository.save(sampleEntity); + + documentId = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId); + sampleEntity2.setType("test"); + sampleEntity2.setRate(10); + sampleEntity2.setMessage("some message"); + + repository.save(sampleEntity2); + + // when + long count = repository.countByMessageContaining("fo"); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodForIn() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setMessage("foo"); + repository.save(sampleEntity); + + // given + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setType("test"); + sampleEntity2.setMessage("bar"); + repository.save(sampleEntity2); + + List ids = Arrays.asList(documentId, documentId2); + + // when + long count = repository.countByIdIn(ids); + // then + assertThat(count, is(equalTo(2L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodForNotIn() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setMessage("foo"); + repository.save(sampleEntity); + + // given + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setType("test"); + sampleEntity2.setMessage("bar"); + repository.save(sampleEntity2); + + List ids = Arrays.asList(documentId); + + // when + long count = repository.countByIdNotIn(ids); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodForTrue() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setMessage("foo"); + sampleEntity.setAvailable(true); + repository.save(sampleEntity); + + // given + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setType("test"); + sampleEntity2.setMessage("bar"); + sampleEntity2.setAvailable(false); + repository.save(sampleEntity2); + // when + long count = repository.countByAvailableTrue(); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodForFalse() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setMessage("foo"); + sampleEntity.setAvailable(true); + repository.save(sampleEntity); + + // given + String documentId2 = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId2); + sampleEntity2.setType("test"); + sampleEntity2.setMessage("bar"); + sampleEntity2.setAvailable(false); + repository.save(sampleEntity2); + // when + long count = repository.countByAvailableFalse(); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodWithWithinGeoPoint() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); + + repository.save(sampleEntity); + + documentId = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId); + sampleEntity2.setType("test"); + sampleEntity2.setRate(10); + sampleEntity2.setMessage("foo"); + sampleEntity2.setLocation(new GeoPoint(30.7806d, 0.0875d)); + + repository.save(sampleEntity2); + + // when + long count = repository.countByLocationWithin(new GeoPoint(45.7806d, 3.0875d), "2km"); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodWithWithinPoint() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); + + repository.save(sampleEntity); + + documentId = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId); + sampleEntity2.setType("test"); + sampleEntity2.setRate(10); + sampleEntity2.setMessage("foo"); + sampleEntity2.setLocation(new GeoPoint(30.7806d, 0.0875d)); + + repository.save(sampleEntity2); + + // when + long count = repository.countByLocationWithin(new Point(45.7806d, 3.0875d), new Distance(2, Metrics.KILOMETERS)); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodWithNearBox() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); + + repository.save(sampleEntity); + + documentId = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId); + sampleEntity2.setType("test2"); + sampleEntity2.setRate(10); + sampleEntity2.setMessage("foo"); + sampleEntity2.setLocation(new GeoPoint(30.7806d, 0.0875d)); + + repository.save(sampleEntity2); + + // when + long count = repository.countByLocationNear(new Box(new Point(46d, 3d), new Point(45d, 4d))); + // then + assertThat(count, is(equalTo(1L))); + } + + /* + DATAES-106 + */ + @Test + public void shouldCountCustomMethodWithNearPointAndDistance() { + // given + String documentId = randomNumeric(5); + SampleEntity sampleEntity = new SampleEntity(); + sampleEntity.setId(documentId); + sampleEntity.setType("test"); + sampleEntity.setRate(10); + sampleEntity.setMessage("foo"); + sampleEntity.setLocation(new GeoPoint(45.7806d, 3.0875d)); + + repository.save(sampleEntity); + + documentId = randomNumeric(5); + SampleEntity sampleEntity2 = new SampleEntity(); + sampleEntity2.setId(documentId); + sampleEntity2.setType("test"); + sampleEntity2.setRate(10); + sampleEntity2.setMessage("foo"); + sampleEntity2.setLocation(new GeoPoint(30.7806d, 0.0875d)); + + repository.save(sampleEntity2); + + // when + long count = repository.countByLocationNear(new Point(45.7806d, 3.0875d), new Distance(2, Metrics.KILOMETERS)); + // then + assertThat(count, is(equalTo(1L))); + } + + private List createSampleEntities(String type, int numberOfEntities) { + List entities = new ArrayList<>(); + for (int i = 0; i < numberOfEntities; i++) { + SampleEntity entity = new SampleEntity(); + entity.setId(randomNumeric(numberOfEntities)); + entity.setAvailable(true); + entity.setMessage("Message"); + entity.setType(type); + entities.add(entity); + } + return entities; + } +} diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/CustomMethodRepositoryRestTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/CustomMethodRepositoryRestTests.java index 5c3de102..4403bad1 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/CustomMethodRepositoryRestTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/CustomMethodRepositoryRestTests.java @@ -1,42 +1,42 @@ -/* - * Copyright 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */package org.springframework.data.elasticsearch.repositories; - -import org.junit.Before; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; -import org.springframework.data.elasticsearch.entities.SampleEntity; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -/** - * - * @author Don Wellington - * - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:custom-method-repository-rest-test.xml") -public class CustomMethodRepositoryRestTests extends CustomMethodRepositoryBaseTests { - @Autowired private ElasticsearchRestTemplate elasticsearchTemplate; - - @Before - public void before() { - elasticsearchTemplate.deleteIndex(SampleEntity.class); - elasticsearchTemplate.createIndex(SampleEntity.class); - elasticsearchTemplate.putMapping(SampleEntity.class); - elasticsearchTemplate.refresh(SampleEntity.class); - } -} +/* + * Copyright 2018-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */package org.springframework.data.elasticsearch.repositories; + +import org.junit.Before; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; +import org.springframework.data.elasticsearch.entities.SampleEntity; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +/** + * + * @author Don Wellington + * + */ +@RunWith(SpringRunner.class) +@ContextConfiguration("classpath:custom-method-repository-rest-test.xml") +public class CustomMethodRepositoryRestTests extends CustomMethodRepositoryBaseTests { + @Autowired private ElasticsearchRestTemplate elasticsearchTemplate; + + @Before + public void before() { + elasticsearchTemplate.deleteIndex(SampleEntity.class); + elasticsearchTemplate.createIndex(SampleEntity.class); + elasticsearchTemplate.putMapping(SampleEntity.class); + elasticsearchTemplate.refresh(SampleEntity.class); + } +} diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/CustomMethodRepositoryTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/CustomMethodRepositoryTests.java index 42a1ff42..dadad052 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/CustomMethodRepositoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/CustomMethodRepositoryTests.java @@ -1,43 +1,43 @@ -/* - * Copyright 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.repositories; - -import org.junit.Before; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; -import org.springframework.data.elasticsearch.entities.SampleEntity; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -/** - * - * @author Don Wellington - * - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:custom-method-repository-test.xml") -public class CustomMethodRepositoryTests extends CustomMethodRepositoryBaseTests { - @Autowired private ElasticsearchTemplate elasticsearchTemplate; - - @Before - public void before() { - elasticsearchTemplate.deleteIndex(SampleEntity.class); - elasticsearchTemplate.createIndex(SampleEntity.class); - elasticsearchTemplate.putMapping(SampleEntity.class); - elasticsearchTemplate.refresh(SampleEntity.class); - } -} +/* + * Copyright 2018-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repositories; + +import org.junit.Before; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; +import org.springframework.data.elasticsearch.entities.SampleEntity; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +/** + * + * @author Don Wellington + * + */ +@RunWith(SpringRunner.class) +@ContextConfiguration("classpath:custom-method-repository-test.xml") +public class CustomMethodRepositoryTests extends CustomMethodRepositoryBaseTests { + @Autowired private ElasticsearchTemplate elasticsearchTemplate; + + @Before + public void before() { + elasticsearchTemplate.deleteIndex(SampleEntity.class); + elasticsearchTemplate.createIndex(SampleEntity.class); + elasticsearchTemplate.putMapping(SampleEntity.class); + elasticsearchTemplate.refresh(SampleEntity.class); + } +} diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/book/SampleElasticSearchBookRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/book/SampleElasticSearchBookRepository.java index eb5b6f81..63844fba 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/book/SampleElasticSearchBookRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/book/SampleElasticSearchBookRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiProductRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiProductRepository.java index d7c6108c..c6ba54f9 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiProductRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiProductRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2017 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryClient.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryClient.java index 72b99707..c2ca6800 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryClient.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryTests.java index afb5eb64..7e7fcee2 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2017 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/ElasticsearchTemplateProducer.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/ElasticsearchTemplateProducer.java index a2dc536c..58fa3735 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/ElasticsearchTemplateProducer.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/ElasticsearchTemplateProducer.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/OtherQualifier.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/OtherQualifier.java index 04e2b10f..f328ae41 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/OtherQualifier.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/OtherQualifier.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/PersonDB.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/PersonDB.java index a0c320e8..3e81d45b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/PersonDB.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/PersonDB.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/QualifiedProductRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/QualifiedProductRepository.java index 47aca797..54688f80 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/QualifiedProductRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/QualifiedProductRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepository.java index 0d9c67b7..21576ccb 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryCustom.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryCustom.java index 8c805820..c730c766 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryCustom.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryCustom.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryImpl.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryImpl.java index a2ae819c..dfa5b81e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryImpl.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/custom/SampleCustomMethodRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/custom/SampleCustomMethodRepository.java index 47ebfe70..2e9f5aee 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/custom/SampleCustomMethodRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/custom/SampleCustomMethodRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/doubleid/DoubleIDRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/doubleid/DoubleIDRepository.java index 2fca7ddb..df0dcf37 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/doubleid/DoubleIDRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/doubleid/DoubleIDRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/geo/SpringDataGeoRepositoryTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/geo/SpringDataGeoRepositoryTests.java index cf6ac116..9f7cfaa0 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/geo/SpringDataGeoRepositoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/geo/SpringDataGeoRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2017 the original author or authors. + * Copyright 2016-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/integer/IntegerIDRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/integer/IntegerIDRepository.java index e871674e..b1c4add3 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/integer/IntegerIDRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/integer/IntegerIDRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/nondocument/NonDocumentEntityRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/nondocument/NonDocumentEntityRepository.java index 998e3786..7ab0e861 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/nondocument/NonDocumentEntityRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/nondocument/NonDocumentEntityRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/sample/SampleElasticsearchRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/sample/SampleElasticsearchRepository.java index 420a7b58..777ad98a 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/sample/SampleElasticsearchRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/sample/SampleElasticsearchRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/sample/SampleUUIDKeyedElasticsearchRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/sample/SampleUUIDKeyedElasticsearchRepository.java index cafa8440..387ecf27 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/sample/SampleUUIDKeyedElasticsearchRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/sample/SampleUUIDKeyedElasticsearchRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/DynamicSettingAndMappingEntityRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/DynamicSettingAndMappingEntityRepository.java index 77862764..29f48288 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/DynamicSettingAndMappingEntityRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/DynamicSettingAndMappingEntityRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/DynamicSettingAndMappingEntityRepositoryTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/DynamicSettingAndMappingEntityRepositoryTests.java index 0afbbe7c..6dcb58af 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/DynamicSettingAndMappingEntityRepositoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/DynamicSettingAndMappingEntityRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/FieldDynamicMappingEntityRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/FieldDynamicMappingEntityRepository.java index 27a3939d..8a4123f2 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/FieldDynamicMappingEntityRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/FieldDynamicMappingEntityRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/FieldDynamicMappingEntityRepositoryTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/FieldDynamicMappingEntityRepositoryTests.java index 36b8162e..261b0817 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/FieldDynamicMappingEntityRepositoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/FieldDynamicMappingEntityRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/spel/SpELRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/spel/SpELRepository.java index 69d6cb9e..43424b92 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/spel/SpELRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/spel/SpELRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepository.java index 8be19e09..54bce822 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryTests.java index 18bbc209..6430a98f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexCustomMethodRepositoryManualWiringTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexCustomMethodRepositoryManualWiringTests.java index 30d8d48e..3a653543 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexCustomMethodRepositoryManualWiringTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexCustomMethodRepositoryManualWiringTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexCustomMethodRepositoryTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexCustomMethodRepositoryTests.java index d1abb74d..bdc5d45a 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexCustomMethodRepositoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexCustomMethodRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepository.java b/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepository.java index 2e4d2df0..88ef57bf 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepositoryCustom.java b/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepositoryCustom.java index 4c7f47a8..becb6972 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepositoryCustom.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepositoryCustom.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepositoryManualWiring.java b/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepositoryManualWiring.java index 9bbe8ae6..7b8b7e04 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepositoryManualWiring.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepositoryManualWiring.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepositoryManualWiringImpl.java b/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepositoryManualWiringImpl.java index 5ac91047..2a0e0de1 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepositoryManualWiringImpl.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/complex/ComplexElasticsearchRepositoryManualWiringImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/DoubleIDRepositoryTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/DoubleIDRepositoryTests.java index ee18d4ac..23ca5a28 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/DoubleIDRepositoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/DoubleIDRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImplTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImplTests.java index f35fc634..f1ea413e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImplTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImplTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2017 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryTests.java index c4f2fb0a..9a0b8cc4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/IntegerIDRepositoryTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/IntegerIDRepositoryTests.java index 8b59b489..bb6b87c3 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/IntegerIDRepositoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/IntegerIDRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/QueryKeywordsTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/QueryKeywordsTests.java index 25eeb7c7..0367b791 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/QueryKeywordsTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/QueryKeywordsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2017 the original author or authors. + * Copyright 2016-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepositoryTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepositoryTests.java index 4741711f..1162455e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepositoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/UUIDElasticsearchRepositoryTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/UUIDElasticsearchRepositoryTests.java index a2c077d7..3d526be1 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/UUIDElasticsearchRepositoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/UUIDElasticsearchRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.