Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion marketplace/release-notes/11.0.1.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- The StringFromFile Java action now removes BOM from strings. (Ticket #242904)
- We have upgraded the Guava dependency to 33.4.7. This also removes the dependency on the jsr305 version 3.0.2 dependency, which causes some code quality scanning tools to report issues.
- We have added a warning about possible deadlocks to the commitInSeparateDatabaseTransaction Java action.
- We added the objectHasChangedMemberValue and memberHasChangedValue Java actions. These actions can be used to check if an object or member has a changed value that is different from the original value.
- We added the objectHasChangedMemberValue and memberHasChangedValue Java actions. These actions can be used to check if an object or member has a changed value that is different from the original value.
- We added the ORM.cloneObject(IContext, IMendixObject, IMendixObject, Boolean, Boolean) method. This is an overload for the ORM.cloneObject with an extra Boolean parameter 'skipIsBoth' that can be used to skip 1-on-1 associations.
9 changes: 9 additions & 0 deletions src/CommunityCommons/javasource/communitycommons/ORM.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ private static boolean isFileDocument(IMendixObject object) {

public static Boolean cloneObject(IContext c, IMendixObject source,
IMendixObject target, Boolean withAssociations) {
return cloneObject(c, source, target, withAssociations, false);
}

public static Boolean cloneObject(IContext c, IMendixObject source,
IMendixObject target, Boolean withAssociations, Boolean skipIsBoth) {
Map<String, ? extends IMendixObjectMember<?>> members = source.getMembers(c);

for (var entry : members.entrySet()) {
Expand All @@ -290,6 +295,10 @@ public static Boolean cloneObject(IContext c, IMendixObject source,
continue;
}
if (withAssociations || ((!(m instanceof MendixObjectReference) && !(m instanceof MendixObjectReferenceSet) && !(m instanceof MendixAutoNumber)))) {
if (skipIsBoth && (
(m instanceof MendixObjectReference && ((MendixObjectReference) m).isBoth()) ||
(m instanceof MendixObjectReferenceSet && ((MendixObjectReferenceSet) m).isBoth())))
continue;
target.setValue(c, entry.getKey(), m.getValue(c));
}
}
Expand Down