You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/06/05 10:47:27 UTC
[isis] 02/02: ISIS-2340: remove utility that has only one reference
of use (2)
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/isis.git
commit 5ed089dca50c9fe1ec6daf5813a05a6f3bf2415c
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Jun 5 12:47:12 2020 +0200
ISIS-2340: remove utility that has only one reference of use (2)
---
.../org/apache/isis/core/metamodel/spec/ManagedObject.java | 11 -----------
.../jdo/datanucleus5/persistence/PersistenceSession5.java | 12 ++++++++----
2 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ManagedObject.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ManagedObject.java
index b65cb7e..70f4abd 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ManagedObject.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ManagedObject.java
@@ -229,15 +229,4 @@ public interface ManagedObject {
}
- // -- DEPRECATIONS (REFACTORING)
-
- static boolean _isParentedCollection(ManagedObject adapter) {
-
- //legacy of (FIXME not a perfect match)
- //getOid() instanceof ParentedOid;
-
- return adapter.getSpecification().getBeanSort().isCollection();
- }
-
-
}
diff --git a/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/persistence/PersistenceSession5.java b/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/persistence/PersistenceSession5.java
index fd2b3a8..7f7d790 100644
--- a/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/persistence/PersistenceSession5.java
+++ b/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/persistence/PersistenceSession5.java
@@ -571,14 +571,18 @@ implements IsisLifecycleListener.PersistenceSessionLifecycleManagement {
if (getEntityState(pojo).isAttached()) {
throw new NotPersistableException("Object already persistent: " + adapter);
}
- if (ManagedObject._isParentedCollection(adapter)) {
- //or should we just ignore this?
- throw new NotPersistableException("Cannot persist parented collection: " + adapter);
- }
val spec = adapter.getSpecification();
if (spec.isManagedBean()) {
throw new NotPersistableException("Can only persist entity beans: "+ adapter);
}
+ if (spec.getBeanSort().isCollection()) {
+ //(FIXME not a perfect match)
+ //legacy of ...
+ //getOid() instanceof ParentedOid;
+ //or should we just ignore this?
+ throw new NotPersistableException("Cannot persist parented collection: " + adapter);
+ }
+
transactionService.executeWithinTransaction(()->{
log.debug("persist {}", adapter);
val createObjectCommand = newCreateObjectCommand(adapter);