This is an automated email from the ASF dual-hosted git repository.
ntimofeev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git
The following commit(s) were added to refs/heads/master by this push:
new bd0bf2687 CAY-2783 DbEntity to ObjEntity synchronization should check
mandatory flag for primitive java types
bd0bf2687 is described below
commit bd0bf2687b373704bcb53997fc98e626f4a6c164
Author: Nikita Timofeev <[email protected]>
AuthorDate: Mon Dec 5 18:18:47 2022 +0300
CAY-2783 DbEntity to ObjEntity synchronization should check mandatory flag
for primitive java types
---
RELEASE-NOTES.txt | 1 +
.../org/apache/cayenne/dbsync/merge/context/EntityMergeSupport.java | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index f01d7de0c..516af8519 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -45,3 +45,4 @@ CAY-2764 Split expressions do not work with DB relationships
CAY-2765 dbimport: check excluded catalogs and schemas for the SQLServer
CAY-2774 Overriding service ordering in DI List causes DIRuntimeException
CAY-2782 Modeler: save button becomes active on DataMap comment field focus
+CAY-2783 DbEntity to ObjEntity synchronization should check mandatory flag for
primitive java types
diff --git
a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/EntityMergeSupport.java
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/EntityMergeSupport.java
index 80af49e80..66981773e 100644
---
a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/EntityMergeSupport.java
+++
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/EntityMergeSupport.java
@@ -305,7 +305,7 @@ public class EntityMergeSupport {
String type = TypesMapping.getJavaBySqlType(dbAttribute);
String primitiveType;
- if (usingPrimitives && (primitiveType = CLASS_TO_PRIMITIVE.get(type))
!= null) {
+ if (usingPrimitives && dbAttribute.isMandatory() && (primitiveType =
CLASS_TO_PRIMITIVE.get(type)) != null) {
return primitiveType;
}
return type;