You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by ah...@apache.org on 2023/02/06 08:28:59 UTC

[causeway] branch master updated: CAUSEWAY-3349: fix to allow ManagedObject variant transition from TRANSIENT to REMOVED

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/causeway.git


The following commit(s) were added to refs/heads/master by this push:
     new 656caa3fbe CAUSEWAY-3349: fix to allow ManagedObject variant transition from TRANSIENT to REMOVED
656caa3fbe is described below

commit 656caa3fbe889ef167e435cd4ecbf98c265026a8
Author: Andi Huber <ah...@apache.org>
AuthorDate: Mon Feb 6 09:28:53 2023 +0100

    CAUSEWAY-3349: fix to allow ManagedObject variant transition from
    TRANSIENT to REMOVED
    
    - when writing this code initially, I had not thought that this could
    ever happen
---
 .../causeway/core/metamodel/object/_ManagedObjectEntityHybrid.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/object/_ManagedObjectEntityHybrid.java b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/object/_ManagedObjectEntityHybrid.java
index 6b838642d0..d7e3670a7e 100644
--- a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/object/_ManagedObjectEntityHybrid.java
+++ b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/object/_ManagedObjectEntityHybrid.java
@@ -181,7 +181,12 @@ implements _Refetchable {
             makeBookmarked(pojo);
             return;
         }
-        if(isVariantBookmarked()
+        /* if the current EntityState is REMOVED, we handle variant transition 
+         * - from BOOKMARKED 
+         * - as well as from TRANSIENT 
+         * to REMOVED */
+        if((isVariantBookmarked()
+                || isVariantTransient())
                 && entityState.isRemoved()) {
             makeRemoved();
             return;