diff --git a/pom.xml b/pom.xml index 1f9682f73..179594ce6 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 diff --git a/spring-data-couchbase/pom.xml b/spring-data-couchbase/pom.xml index b30294301..3186819ce 100644 --- a/spring-data-couchbase/pom.xml +++ b/spring-data-couchbase/pom.xml @@ -19,10 +19,19 @@ spring.data.couchbase 2.10.13 3.0.1 - 7.0.1.Final 1.1.3 5.0.0 3.7.4 + 3.0.0 + 7.0.1.Final + 4.0.0 + 3.0.0 + 4.0.2 + 1.0.1 + 1.2.1 + 1.5.25 + 4.8.1 + 4.0.3 @@ -67,19 +76,11 @@ ${springdata.commons} - - jakarta.enterprise jakarta.enterprise.cdi-api - 3.0.0 + ${jakarta.enterprise} @@ -92,14 +93,7 @@ org.hibernate.validator hibernate-validator - 7.0.1.Final - test - - - - org.apache.httpcomponents - httpclient - 4.5.13 + ${org.hibernate.validator} test @@ -137,7 +131,7 @@ jakarta.el jakarta.el-api - 4.0.0 + ${jakarta.el} provided true @@ -145,14 +139,14 @@ javax.el javax.el-api - 3.0.0 + ${javax.el} test org.glassfish jakarta.el - 4.0.2 + ${jakarta.el} provided true @@ -162,42 +156,35 @@ org.apache.geronimo.specs geronimo-jcdi_2.0_spec - 1.0.1 + ${org.apache.geronimo.specs} test javax.interceptor javax.interceptor-api - 1.2.1 - test - - - - org.apache.openwebbeans - openwebbeans-se - ${webbeans} + ${javax.interceptor} test com.couchbase.mock CouchbaseMock - 1.5.25 + ${com.couchbase.mock} test com.squareup.okhttp3 okhttp - 4.8.1 + ${com.squareup.okhttp3} test com.squareup.okhttp3 okhttp-tls - 4.8.1 + ${com.squareup.okhttp3} test @@ -226,7 +213,7 @@ org.awaitility awaitility - 4.0.3 + ${org.awaitility} test diff --git a/spring-data-testapp/pom.xml b/spring-data-testapp/pom.xml index f9624e705..47c0cfb6d 100644 --- a/spring-data-testapp/pom.xml +++ b/spring-data-testapp/pom.xml @@ -1,59 +1,58 @@ - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 3.0.0-SNAPSHOT - - - com.example - demo - 0.0.1-SNAPSHOT - demo - Demo project for Spring Boot - - 11 - - - - org.springframework.boot - spring-boot-starter-data-couchbase - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - - - org.springframework.data - spring-data-couchbase - 5.0.0-SNAPSHOT - + + org.springframework.boot + spring-boot-starter-parent + 3.0.0-SNAPSHOT + + + com.example + demo + 0.0.1-SNAPSHOT + demo + Demo project for Spring Boot - - org.springframework.boot - spring-boot-starter-test - test - + + 5.0.0-SNAPSHOT + - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - 2.10.1 - + + + org.springframework.boot + spring-boot-starter-data-couchbase + + + org.springframework.data + spring-data-couchbase + + + - + + org.springframework.data + spring-data-couchbase + ${springdata.couchbase} + - - - - org.springframework.boot - spring-boot-maven-plugin - - - - + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + @@ -72,24 +71,15 @@ - - - spring-snapshots - https://repo.spring.io/snapshot - - - spring-milestones - https://repo.spring.io/milestone - - - - diff --git a/spring-data-testapp/src/main/java/com/example/demo/Airport.java b/spring-data-testapp/src/main/java/com/example/demo/Airport.java index fd12eedc4..15f217ad3 100644 --- a/spring-data-testapp/src/main/java/com/example/demo/Airport.java +++ b/spring-data-testapp/src/main/java/com/example/demo/Airport.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2021 the original author or authors. + * Copyright 2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,6 @@ /** * Airport entity * - * @author Michael Nitschinger * @author Michael Reiche */ @Document @@ -79,19 +78,6 @@ public LocalDateTime getOpenDate() { return openDate; } - /* - public Airport withId(String id) { - return new Airport(id, this.iata, this.icao); - } - - public Airport withIcao(String icao) { - return new Airport(this.getId(), this.iata, icao); - } - - public Airport withIata(String iata) { - return new Airport(this.getId(), iata, this.icao); - } - */ public Airport clearVersion() { version = Long.valueOf(0); return this; diff --git a/spring-data-testapp/src/main/java/com/example/demo/AirportRepository.java b/spring-data-testapp/src/main/java/com/example/demo/AirportRepository.java index 73731a4c1..44d321658 100644 --- a/spring-data-testapp/src/main/java/com/example/demo/AirportRepository.java +++ b/spring-data-testapp/src/main/java/com/example/demo/AirportRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2021 the original author or authors. + * Copyright 2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package com.example.demo; import com.couchbase.client.java.query.QueryScanConsistency; @@ -32,10 +31,11 @@ /** * Airport repository for testing
+ * + * @author Michael Reiche */ @Repository @Document -// @ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS) public interface AirportRepository extends CouchbaseRepository { // override an annotate with REQUEST_PLUS @@ -49,7 +49,7 @@ public interface AirportRepository extends CouchbaseRepository @ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS) Airport findByIata(String iata); - @ScanConsistency(query = QueryScanConsistency.NOT_BOUNDED) + @ScanConsistency(query = QueryScanConsistency.NOT_BOUNDED) Airport iata(String iata); @Query("#{#n1ql.selectEntity} where iata = $1") diff --git a/spring-data-testapp/src/main/java/com/example/demo/AirportService.java b/spring-data-testapp/src/main/java/com/example/demo/AirportService.java index bb6043304..6c0d61180 100644 --- a/spring-data-testapp/src/main/java/com/example/demo/AirportService.java +++ b/spring-data-testapp/src/main/java/com/example/demo/AirportService.java @@ -1,3 +1,18 @@ +/* + * Copyright 2022 the original author 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 + * + * https://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 com.example.demo; import com.couchbase.client.java.transactions.TransactionResult; @@ -9,6 +24,11 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; +/** + * + * + * @author Michael Reiche + */ @Service @Transactional public class AirportService { diff --git a/spring-data-testapp/src/main/java/com/example/demo/CmdRunner.java b/spring-data-testapp/src/main/java/com/example/demo/CmdRunner.java index 25a5e66eb..662884725 100644 --- a/spring-data-testapp/src/main/java/com/example/demo/CmdRunner.java +++ b/spring-data-testapp/src/main/java/com/example/demo/CmdRunner.java @@ -1,3 +1,18 @@ +/* + * Copyright 2022 the original author 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 + * + * https://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 com.example.demo; import com.couchbase.client.java.transactions.TransactionResult; @@ -10,13 +25,13 @@ /** * Components of the type CommandLineRunner are called right after the application start up. So the method *run* is * called as soon as the application starts. + * + * @author Michael Reiche */ @Component public class CmdRunner implements CommandLineRunner { @Autowired AirportRepository airportRepository; - @Autowired - IndexDetailRepository indexDetailRepository; @Autowired CouchbaseTemplate template; @Autowired CouchbaseClientFactory couchbaseClientFactory; @Autowired AirportService airportService; diff --git a/spring-data-testapp/src/main/java/com/example/demo/Config.java b/spring-data-testapp/src/main/java/com/example/demo/Config.java index 87777033a..d368487c2 100644 --- a/spring-data-testapp/src/main/java/com/example/demo/Config.java +++ b/spring-data-testapp/src/main/java/com/example/demo/Config.java @@ -1,21 +1,33 @@ +/* + * Copyright 2022 the original author 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 + * + * https://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 com.example.demo; -import com.couchbase.client.core.env.IoEnvironment; -import com.couchbase.client.core.env.SecurityConfig; -import com.couchbase.client.core.msg.kv.DurabilityLevel; -import com.couchbase.client.java.codec.JacksonJsonSerializer; import com.couchbase.client.java.env.ClusterEnvironment; -import com.couchbase.client.java.json.JsonValueModule; import com.couchbase.client.java.transactions.config.TransactionsConfig; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import org.springframework.context.annotation.Configuration; import org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration; import org.springframework.data.couchbase.repository.config.EnableCouchbaseRepositories; -import java.time.Duration; - +/** + * + * + * @author Michael Reiche + */ @Configuration @EnableCouchbaseRepositories({"com.example.demo", "com.wu.onep.ordnrt.cbviewsrch.repository"}) public class Config extends AbstractCouchbaseConfiguration { @@ -41,18 +53,8 @@ public String getBucketName() { @Override public void configureEnvironment(ClusterEnvironment.Builder builder){ - builder.jsonSerializer(getSerializer()) - .securityConfig(SecurityConfig.enableNativeTls(false)) - .ioEnvironment(IoEnvironment.enableNativeIo(false)); // builder.transactionsConfig(TransactionsConfig.durabilityLevel(DurabilityLevel.NONE)); } - private static JacksonJsonSerializer getSerializer() { - ObjectMapper mapper = new ObjectMapper(); - mapper.registerModule(new JsonValueModule()); - mapper.registerModule(new JavaTimeModule()); // this handles LocalDateTime - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - return JacksonJsonSerializer.create(mapper); - } } diff --git a/spring-data-testapp/src/main/java/com/example/demo/DemoApplication.java b/spring-data-testapp/src/main/java/com/example/demo/DemoApplication.java index 3a221c4cb..cd3e158e8 100644 --- a/spring-data-testapp/src/main/java/com/example/demo/DemoApplication.java +++ b/spring-data-testapp/src/main/java/com/example/demo/DemoApplication.java @@ -1,19 +1,35 @@ +/* + * Copyright 2022 the original author 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 + * + * https://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 com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; +import java.util.Properties; +/** + * + * + * @author Michael Reiche + */ @SpringBootApplication public class DemoApplication { - char a = '\u00A0'; public static void main(String[] args) { - new SpringApplicationBuilder ( DemoApplication.class) - .properties("spring.main.allow-bean-definition-overriding=true") - .build() - .run(args); + SpringApplication.run( DemoApplication.class, args ); } - } diff --git a/spring-data-testapp/src/main/java/com/example/demo/Iata.java b/spring-data-testapp/src/main/java/com/example/demo/Iata.java deleted file mode 100644 index d14ee25ec..000000000 --- a/spring-data-testapp/src/main/java/com/example/demo/Iata.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.example.demo; - -public enum Iata { - vie, // must be lower-case to match "vie" as airport.iata is always specified in lowercase - xxx -} diff --git a/spring-data-testapp/src/main/resources/application.properties b/spring-data-testapp/src/main/resources/application.properties index 8e91b0ca8..e439ebd85 100644 --- a/spring-data-testapp/src/main/resources/application.properties +++ b/spring-data-testapp/src/main/resources/application.properties @@ -1 +1 @@ -#spring.main.allow-bean-definition-overriding=true +spring.main.allow-bean-definition-overriding=true diff --git a/spring-data-testapp/src/test/java/com/example/demo/DemoApplicationTests.java b/spring-data-testapp/src/test/java/com/example/demo/DemoApplicationTests.java index 2778a6a7e..2408a6191 100644 --- a/spring-data-testapp/src/test/java/com/example/demo/DemoApplicationTests.java +++ b/spring-data-testapp/src/test/java/com/example/demo/DemoApplicationTests.java @@ -1,8 +1,28 @@ +/* + * Copyright 2022 the original author 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 + * + * https://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 com.example.demo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; +/** + * + * + * @author Michael Reiche + */ @SpringBootTest class DemoApplicationTests {