From 75e54db3aaaa53806b7c4c5c2154c6bd4783c125 Mon Sep 17 00:00:00 2001 From: Claude Brisson Date: Sat, 30 Jul 2022 17:29:07 +0200 Subject: [PATCH] Fix postgres key columns equality tests: add explicit casts --- modality-api-client/pom.xml | 2 +- modality-core/pom.xml | 2 +- .../main/java/com/republicate/modality/impl/BaseEntity.java | 5 +++++ modality-examples/modality-example-bookshelf/pom.xml | 2 +- modality-examples/pom.xml | 2 +- modality-webapp-auth/pom.xml | 2 +- modality-webapp/pom.xml | 2 +- pom.xml | 2 +- velocity-tools-model/pom.xml | 2 +- 9 files changed, 13 insertions(+), 8 deletions(-) diff --git a/modality-api-client/pom.xml b/modality-api-client/pom.xml index 038658a..dbdd429 100644 --- a/modality-api-client/pom.xml +++ b/modality-api-client/pom.xml @@ -22,7 +22,7 @@ under the License. com.republicate.modality modality - 2.1.2 + 2.1.3 modality-api-client diff --git a/modality-core/pom.xml b/modality-core/pom.xml index ecf8123..08afc7b 100644 --- a/modality-core/pom.xml +++ b/modality-core/pom.xml @@ -24,7 +24,7 @@ com.republicate.modality modality - 2.1.2 + 2.1.3 modality-core diff --git a/modality-core/src/main/java/com/republicate/modality/impl/BaseEntity.java b/modality-core/src/main/java/com/republicate/modality/impl/BaseEntity.java index 6e18d58..1107a4d 100644 --- a/modality-core/src/main/java/com/republicate/modality/impl/BaseEntity.java +++ b/modality-core/src/main/java/com/republicate/modality/impl/BaseEntity.java @@ -329,6 +329,11 @@ private void addKeyMapToAttribute(Attribute attribute) String sqlPKColName = sqlPrimaryKey.get(i); attribute.addQueryPart(quoteIdentifier(sqlPKColName) + " = "); attribute.addParameter(translateColumnName(sqlPKColName)); + if (model.getDriverInfos().isStrictColumnTypes() && model.getDriverInfos().hasColumnMarkers()) + { + Column col = getColumn(sqlPKColName); + attribute.addQueryPart("::" + col.typeName); + } } } diff --git a/modality-examples/modality-example-bookshelf/pom.xml b/modality-examples/modality-example-bookshelf/pom.xml index fdad62c..d755e0e 100644 --- a/modality-examples/modality-example-bookshelf/pom.xml +++ b/modality-examples/modality-example-bookshelf/pom.xml @@ -22,7 +22,7 @@ under the License. com.republicate.modality modality-examples - 2.1.2 + 2.1.3 modality-example-bookshelf diff --git a/modality-examples/pom.xml b/modality-examples/pom.xml index 6e33db4..d5233c5 100644 --- a/modality-examples/pom.xml +++ b/modality-examples/pom.xml @@ -22,7 +22,7 @@ under the License. com.republicate.modality modality - 2.1.2 + 2.1.3 modality-examples diff --git a/modality-webapp-auth/pom.xml b/modality-webapp-auth/pom.xml index 8ce8214..297ec86 100644 --- a/modality-webapp-auth/pom.xml +++ b/modality-webapp-auth/pom.xml @@ -22,7 +22,7 @@ under the License. com.republicate.modality modality - 2.1.2 + 2.1.3 modality-webapp-auth diff --git a/modality-webapp/pom.xml b/modality-webapp/pom.xml index c0e0455..a1923ec 100644 --- a/modality-webapp/pom.xml +++ b/modality-webapp/pom.xml @@ -22,7 +22,7 @@ under the License. com.republicate.modality modality - 2.1.2 + 2.1.3 modality-webapp diff --git a/pom.xml b/pom.xml index 2640fd8..5914686 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ under the License. com.republicate.modality modality - 2.1.2 + 2.1.3 pom ${project.groupId}:${project.artifactId} diff --git a/velocity-tools-model/pom.xml b/velocity-tools-model/pom.xml index 50db32d..8a0a3f2 100644 --- a/velocity-tools-model/pom.xml +++ b/velocity-tools-model/pom.xml @@ -23,7 +23,7 @@ under the License. com.republicate.modality modality - 2.1.2 + 2.1.3 velocity-tools-model