From bc861e68646a46424a55889d3003fb9ec7fbb7f5 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 17 Jan 2022 10:54:20 +0100 Subject: [PATCH] Polishing. Reformat code. Add author tags. See: #698 Original pull request: #708. --- .../data/r2dbc/query/QueryMapper.java | 10 +++------- ...AbstractR2dbcRepositoryIntegrationTests.java | 6 +++--- .../data/r2dbc/testing/OracleTestSupport.java | 2 +- .../data/r2dbc/testing/PostgresTestSupport.java | 17 ++++++++++++++++- .../r2dbc/testing/SqlServerTestSupport.java | 17 ++++++++++++++++- 5 files changed, 39 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/springframework/data/r2dbc/query/QueryMapper.java b/src/main/java/org/springframework/data/r2dbc/query/QueryMapper.java index 6d18a72..ad3e3f5 100644 --- a/src/main/java/org/springframework/data/r2dbc/query/QueryMapper.java +++ b/src/main/java/org/springframework/data/r2dbc/query/QueryMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2021 the original author or authors. + * Copyright 2019-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. @@ -21,6 +21,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.regex.Pattern; + import org.springframework.data.domain.Sort; import org.springframework.data.mapping.MappingException; import org.springframework.data.mapping.PersistentPropertyPath; @@ -55,6 +56,7 @@ import org.springframework.util.ClassUtils; * * @author Mark Paluch * @author Roman Chigvintsev + * @author Manousos Mathioudakis */ public class QueryMapper { @@ -757,12 +759,6 @@ public class QueryMapper { return path.getType().equals(Class.class) && path.getLeafProperty().getOwningType().getType().equals(Class.class); } - /* - * (non-Javadoc) - * - * @see - * org.springframework.data.r2dbc.core.convert.QueryMapper.Field#getTypeHint() - */ @Override public TypeInformation getTypeHint() { diff --git a/src/test/java/org/springframework/data/r2dbc/repository/AbstractR2dbcRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/r2dbc/repository/AbstractR2dbcRepositoryIntegrationTests.java index 9a5d39c..f5bae17 100644 --- a/src/test/java/org/springframework/data/r2dbc/repository/AbstractR2dbcRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/r2dbc/repository/AbstractR2dbcRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2021 the original author or authors. + * Copyright 2018-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. @@ -56,6 +56,7 @@ import org.springframework.transaction.reactive.TransactionalOperator; * Abstract base class for integration tests for {@link LegoSetRepository} using {@link R2dbcRepositoryFactory}. * * @author Mark Paluch + * @author Manousos Mathioudakis */ public abstract class AbstractR2dbcRepositoryIntegrationTests extends R2dbcIntegrationTestSupport { @@ -444,8 +445,7 @@ public abstract class AbstractR2dbcRepositoryIntegrationTests extends R2dbcInteg this.manual = manual; } - @PersistenceConstructor - LegoSet(Integer id, String name, Integer manual, Boolean flag) { + LegoSet(Integer id, String name, Integer manual, boolean flag) { this(id, name, manual); this.flag = flag; } diff --git a/src/test/java/org/springframework/data/r2dbc/testing/OracleTestSupport.java b/src/test/java/org/springframework/data/r2dbc/testing/OracleTestSupport.java index f53d0c2..0611201 100644 --- a/src/test/java/org/springframework/data/r2dbc/testing/OracleTestSupport.java +++ b/src/test/java/org/springframework/data/r2dbc/testing/OracleTestSupport.java @@ -55,7 +55,7 @@ public class OracleTestSupport { + " id INTEGER GENERATED by default on null as IDENTITY PRIMARY KEY,\n" // + " version INTEGER NULL,\n" // + " name VARCHAR2(255) NOT NULL,\n" // - + " flag Boolean NULL,\n" // + + " flag Boolean NULL,\n" // + " manual INTEGER NULL\n" // + ")"; diff --git a/src/test/java/org/springframework/data/r2dbc/testing/PostgresTestSupport.java b/src/test/java/org/springframework/data/r2dbc/testing/PostgresTestSupport.java index 9357a94..5e5b49c 100644 --- a/src/test/java/org/springframework/data/r2dbc/testing/PostgresTestSupport.java +++ b/src/test/java/org/springframework/data/r2dbc/testing/PostgresTestSupport.java @@ -1,3 +1,18 @@ +/* + * Copyright 2021-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 org.springframework.data.r2dbc.testing; import io.r2dbc.spi.ConnectionFactory; @@ -29,7 +44,7 @@ public class PostgresTestSupport { + " version integer NULL,\n" // + " name varchar(255) NOT NULL,\n" // + " manual integer NULL,\n" // - + " flag boolean NULL,\n" // + + " flag boolean NULL,\n" // + " cert bytea NULL\n" // + ");"; diff --git a/src/test/java/org/springframework/data/r2dbc/testing/SqlServerTestSupport.java b/src/test/java/org/springframework/data/r2dbc/testing/SqlServerTestSupport.java index 3987057..7ff5396 100644 --- a/src/test/java/org/springframework/data/r2dbc/testing/SqlServerTestSupport.java +++ b/src/test/java/org/springframework/data/r2dbc/testing/SqlServerTestSupport.java @@ -1,3 +1,18 @@ +/* + * Copyright 2021-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 org.springframework.data.r2dbc.testing; import io.r2dbc.spi.ConnectionFactory; @@ -28,7 +43,7 @@ public class SqlServerTestSupport { + " id integer IDENTITY(1,1) PRIMARY KEY,\n" // + " version integer NULL,\n" // + " name varchar(255) NOT NULL,\n" // - + " flag bit NULL\n," // + + " flag bit NULL\n," // + " extra varchar(255),\n" // + " manual integer NULL\n" // + ");";