incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmatth...@apache.org
Subject svn commit: r1083289 - in /incubator/isis/trunk: applib/src/main/java/org/apache/isis/applib/ core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/ core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ core/metamodel/...
Date Sat, 19 Mar 2011 21:11:14 GMT
Author: rmatthews
Date: Sat Mar 19 21:11:14 2011
New Revision: 1083289

URL: http://svn.apache.org/viewvc?rev=1083289&view=rev
Log:
First pass at implementing aggregated objects.

Modified:
    incubator/isis/trunk/applib/src/main/java/org/apache/isis/applib/AbstractContainedObject.java
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/AggregatedOid.java
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorAbstract.java
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/DomainObjectContainerDefault.java
    incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlObjectStore.java
    incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/ObjectReader.java
    incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/SerialNumberVersionCreator.java
    incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/WriteObjectCommand.java
    incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/memento/Memento.java
    incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionAbstract.java
    incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistorUtil.java
    incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java
    incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerDefault.java
    incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/internal/RuntimeContextFromSession.java
    incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/PersistenceSessionObjectStore.java

Modified: incubator/isis/trunk/applib/src/main/java/org/apache/isis/applib/AbstractContainedObject.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/main/java/org/apache/isis/applib/AbstractContainedObject.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/main/java/org/apache/isis/applib/AbstractContainedObject.java
(original)
+++ incubator/isis/trunk/applib/src/main/java/org/apache/isis/applib/AbstractContainedObject.java
Sat Mar 19 21:11:14 2011
@@ -41,7 +41,12 @@ public abstract class AbstractContainedO
     
     @Hidden
     protected <T> T newAggregatedInstance(final Class<T> ofType) {
-        return getContainer().newAggregatedInstance(this, ofType);
+        return newAggregatedInstance(this, ofType);
+    }
+    
+    @Hidden
+    protected <T> T newAggregatedInstance(final Object parent, final Class<T>
ofType) {
+        return getContainer().newAggregatedInstance(parent, ofType);
     }
 
     // }}

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/AggregatedOid.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/AggregatedOid.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/AggregatedOid.java
(original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/AggregatedOid.java
Sat Mar 19 21:11:14 2011
@@ -32,9 +32,6 @@ import org.apache.isis.core.commons.exce
 
 /**
  * Used as the {@link Oid} for collections, values and <tt>@Aggregated</tt> types.
- * 
- * <p>
- * The Hibernate Object Store has custom handling for collections.
  */
 public class AggregatedOid implements Oid, Serializable {
 
@@ -57,12 +54,12 @@ public class AggregatedOid implements Oi
     ///////////////////////////////////////////////////////////
     // Constructor, Encodeable
     ///////////////////////////////////////////////////////////
-
     public AggregatedOid(final Oid oid, final String id) {
         this(oid, id, -1);
     }
     
-    public AggregatedOid(final Oid oid, final String id, final int element) {
+    //public
+    private AggregatedOid(final Oid oid, final String id, final int element) {
         Assert.assertNotNull("Field required", id);
         this.parentOid = oid;
         this.fieldName = id;
@@ -71,10 +68,10 @@ public class AggregatedOid implements Oi
     }
 
     public AggregatedOid(final Oid oid, final Identifier identifier) {
-        this(oid,  
-        	ensureNotNull(identifier, "Field required").getMemberName());
+        this(oid, ensureNotNull(identifier, "Field required").getMemberName());
     }
-
+    /*
+*/
     public AggregatedOid(DataInputExtended input) throws IOException {
     	this.parentOid = input.readEncodable(Oid.class);
     	this.fieldName = input.readUTF();
@@ -99,15 +96,15 @@ public class AggregatedOid implements Oi
     public Oid getParentOid() {
         return parentOid;
     }
-
     public String getFieldName() {
         return fieldName;
     }
     
+    /*
     public int getElement() {
         return element;
     }
-
+*/
     
     ///////////////////////////////////////////////////////////
     // makePersistent

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorAbstract.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorAbstract.java
(original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorAbstract.java
Sat Mar 19 21:11:14 2011
@@ -153,9 +153,6 @@ public abstract class ServicesInjectorAb
                 methods[j].setAccessible(true);
                 
                 invokeSetMethod(methods[j], object, service);
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("injected service " + service + " into " + new ToString(object));
-                }
             }
         }
     }

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/DomainObjectContainerDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/DomainObjectContainerDefault.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/DomainObjectContainerDefault.java
(original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/DomainObjectContainerDefault.java
Sat Mar 19 21:11:14 2011
@@ -80,14 +80,22 @@ public class DomainObjectContainerDefaul
     @SuppressWarnings("unchecked")
     public <T> T newTransientInstance(final Class<T> ofClass) {
         final ObjectSpecification spec = getSpecificationLookup().loadSpecification(ofClass);
-        final ObjectAdapter adapter = doCreateTransientInstance(spec);
-        return (T) adapter.getObject();
+        // TODO check aggregation is supported
+        if (spec.isAggregated()) {
+            return newAggregatedInstance(this, ofClass);
+        } else {
+            final ObjectAdapter adapter = doCreateTransientInstance(spec);
+            return (T) adapter.getObject();
+        }
     }
     
+    @Override
+    @SuppressWarnings("unchecked")
     public <T> T newAggregatedInstance(Object parent, Class<T> ofClass) {
         final ObjectSpecification spec = getSpecificationLookup().loadSpecification(ofClass);
+        // TODO check aggregation is supported
         if (!spec.isAggregated()) {
-            throw new IsisException(); // TODO proper type
+            throw new IsisException("Cannot instantiate an object unless it is marked as
Aggregated using the newAggregatedInstance method"); // TODO proper type
         }
         final ObjectAdapter adapter = doCreateAggregatedInstance(spec, parent);
         return (T) adapter.getObject();
@@ -210,6 +218,10 @@ public class DomainObjectContainerDefaul
     @Override
     public void persist(final Object transientObject) {
         final ObjectAdapter adapter = getAdapterMap().getAdapterFor(transientObject);
+        // TODO check aggregation is supported
+        if (adapter.isAggregated()) {
+            return;
+        }
         if (isPersistent(transientObject)) {
             throw new PersistFailedException("Object already persistent: " + adapter);
         }

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlObjectStore.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlObjectStore.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlObjectStore.java
(original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlObjectStore.java
Sat Mar 19 21:11:14 2011
@@ -176,7 +176,7 @@ public class NoSqlObjectStore implements
     @Override
     public void resolveField(ObjectAdapter object, ObjectAssociation field) {
         ObjectAdapter fieldValue = field.get(object);
-        if (fieldValue != null) {
+        if (fieldValue != null && !fieldValue.getResolveState().isResolved() &&
!fieldValue.getSpecification().isAggregated()) {
             resolveImmediately(fieldValue);
         }
     }

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/ObjectReader.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/ObjectReader.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/ObjectReader.java
(original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/ObjectReader.java
Sat Mar 19 21:11:14 2011
@@ -108,10 +108,11 @@ class ObjectReader {
     }
     
     private void readAggregate(StateReader reader, KeyCreator keyCreator, OneToOneAssociation
association, ObjectAdapter object) {
-       String id = association.getId();
+      String id = association.getId();
        StateReader aggregateReader = reader.readAggregate(id);
        if (aggregateReader != null) {
-           AggregatedOid oid = new AggregatedOid(object.getOid(), id);
+           String id2 = aggregateReader.readId();
+           AggregatedOid oid = new AggregatedOid(object.getOid(), id2);
            ObjectAdapter fieldObject = restoreAggregatedObject(aggregateReader, oid, keyCreator);
            association.initAssociation(object, fieldObject);
        } else {
@@ -123,10 +124,12 @@ class ObjectReader {
            String objectType = aggregateReader.readObjectType();
            ObjectSpecification specification = IsisContext.getSpecificationLoader().loadSpecification(objectType);
            ObjectAdapter fieldObject = getAdapter(specification, oid);
-           ResolveState resolveState = ResolveState.RESOLVING;
-           fieldObject.changeState(resolveState);
-           readFields(aggregateReader, fieldObject, keyCreator);
-           fieldObject.changeState(resolveState.getEndState());
+           if (fieldObject.getResolveState().isGhost()) {
+               ResolveState resolveState = ResolveState.RESOLVING;
+               fieldObject.changeState(resolveState);
+               readFields(aggregateReader, fieldObject, keyCreator);
+               fieldObject.changeState(resolveState.getEndState());
+           }
         return fieldObject;
     }
 
@@ -161,11 +164,12 @@ class ObjectReader {
         CollectionFacet facet = collection.getSpecification().getFacet(CollectionFacet.class);
         if (association.getSpecification().isAggregated()) {
             List<StateReader> readers = reader.readCollection(association.getId());
-            String id = association.getId();
+       //     String id = association.getId();
             ObjectAdapter[] elements = new ObjectAdapter[readers.size()];
             int i = 0;
             for (StateReader elementReader : readers) {
-                AggregatedOid oid = new AggregatedOid(object.getOid(), id, i);
+                String id = elementReader.readId();
+                AggregatedOid oid = new AggregatedOid(object.getOid(), id);
                 elements[i++] = restoreAggregatedObject(elementReader, oid, keyCreator);
             }
             facet.init(collection, elements);

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/SerialNumberVersionCreator.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/SerialNumberVersionCreator.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/SerialNumberVersionCreator.java
(original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/SerialNumberVersionCreator.java
Sat Mar 19 21:11:14 2011
@@ -49,7 +49,7 @@ public class SerialNumberVersionCreator 
     }
     
     public Version nextVersion(Version version) {
-        long sequence = ((SerialNumberVersion) version).getSequence() + 1;
+            long sequence = ((SerialNumberVersion) version).getSequence() + 1;
         String user = version.getUser();
         return new SerialNumberVersion(sequence, user, new Date());
     }

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/WriteObjectCommand.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/WriteObjectCommand.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/WriteObjectCommand.java
(original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/WriteObjectCommand.java
Sat Mar 19 21:11:14 2011
@@ -25,6 +25,7 @@ import java.util.List;
 
 import org.apache.isis.core.commons.lang.ToString;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.oid.AggregatedOid;
 import org.apache.isis.core.metamodel.adapter.version.Version;
 import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacet;
 import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
@@ -105,6 +106,7 @@ final class WriteObjectCommand implement
         } else {
             String specName = field.getSpecification().getFullIdentifier();
             StateWriter aggregateWriter = writer.addAggregate(association.getId());
+            aggregateWriter.writeId(((AggregatedOid) field.getOid()).getFieldName());
             writeFields(aggregateWriter, specName, field);
         }
     }
@@ -143,6 +145,7 @@ final class WriteObjectCommand implement
             List<StateWriter> elements = new ArrayList<StateWriter>();
             for (ObjectAdapter element : collectionFacet.iterable(collection)) {
                StateWriter elementWriter = writer.createElementWriter();
+               elementWriter.writeId(((AggregatedOid) element.getOid()).getFieldName());
                writeFields(elementWriter, element.getSpecification().getFullIdentifier(),
element);
                elements.add(elementWriter);
             }

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/memento/Memento.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/memento/Memento.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/memento/Memento.java
(original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/memento/Memento.java
Sat Mar 19 21:11:14 2011
@@ -87,10 +87,7 @@ public class Memento implements Serializ
         final Data[] collData = new Data[facet.size(object)];
         int i = 0;
         for (ObjectAdapter ref : facet.iterable(object)) {
-            String resolveStateName = ref.getResolveState().name();
-            String specName = ref.getSpecification().getFullIdentifier();
-            Oid oid = ref.getOid();
-            collData[i++] = new Data(oid, resolveStateName, specName);
+            collData[i++] = createReferenceData(ref);
         }
         String elementTypeSpecName = object.getSpecification().getFullIdentifier();
         return new CollectionData(object.getOid(), object.getResolveState(), elementTypeSpecName,
collData);
@@ -144,7 +141,7 @@ public class Memento implements Serializ
             return createStandaloneData(ref);
         }
 
-        if (refOid.isTransient() && !transientObjects.contains(refOid)) {
+        if ((ref.getSpecification().isAggregated() || refOid.isTransient()) && !transientObjects.contains(refOid))
{    
             transientObjects.add(refOid);
             return createObjectData(ref);
         }
@@ -216,11 +213,11 @@ public class Memento implements Serializ
         }
 
         ObjectAdapter ref;
-        if (oid.isTransient()) {
+        if (oid.isTransient() && !spec.isAggregated()) {
             ref = getHydrator().recreateAdapter(oid, spec);
         } else {
             ref = getHydrator().recreateAdapter(oid, spec);
-            ResolveState resolveState = ResolveState.GHOST;
+            ResolveState resolveState = spec.isAggregated() ? ResolveState.TRANSIENT : ResolveState.GHOST;
             if (ref.getResolveState().isValidToChangeTo(resolveState)) {
                 ref.changeState(resolveState);
             }

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionAbstract.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionAbstract.java
(original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionAbstract.java
Sat Mar 19 21:11:14 2011
@@ -20,19 +20,11 @@
 
 package org.apache.isis.runtimes.dflt.runtime.persistence;
 
-import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
-import static org.apache.isis.core.commons.ensure.Ensure.ensureThatState;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
-
 import org.apache.isis.applib.query.Query;
 import org.apache.isis.applib.query.QueryDefault;
 import org.apache.isis.applib.query.QueryFindAllInstances;
@@ -63,6 +55,13 @@ import org.apache.isis.runtimes.dflt.run
 import org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryFindUsingApplibQuerySerializable;
 import org.apache.isis.runtimes.dflt.runtime.persistence.services.ServiceUtil;
 import org.apache.isis.runtimes.dflt.runtime.transaction.IsisTransactionManager;
+import org.apache.log4j.Logger;
+
+import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
+import static org.apache.isis.core.commons.ensure.Ensure.ensureThatState;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
 
 
 public abstract class PersistenceSessionAbstract implements PersistenceSession {

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistorUtil.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistorUtil.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistorUtil.java
(original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistorUtil.java
Sat Mar 19 21:11:14 2011
@@ -38,8 +38,8 @@ public class PersistorUtil {
     // //////////////////////////////////////////////////////////////////
 
     public static void start(final ObjectAdapter object, final ResolveState state) {
-    	if (LOG.isDebugEnabled()) {
-    		LOG.debug("start " + object + " as " + state.name());
+    	if (LOG.isTraceEnabled()) {
+    		LOG.trace("start " + object + " as " + state.name());
     	}
         object.changeState(state);
     }
@@ -51,8 +51,8 @@ public class PersistorUtil {
     public static void end(final ObjectAdapter object) {
         final ResolveState endState = object.getResolveState().getEndState();
         Assert.assertNotNull("end state required", endState);
-        if (LOG.isDebugEnabled()) {
-        	LOG.debug("end " + object + " as " + endState.name());
+        if (LOG.isTraceEnabled()) {
+        	LOG.trace("end " + object + " as " + endState.name());
         }
         object.changeState(endState);
     }

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java
(original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java
Sat Mar 19 21:11:14 2011
@@ -159,7 +159,7 @@ public class PojoAdapter extends Instanc
         // in the process of transitioning to ghost
         Assert.assertTrue("oid= " + this.getOid() + "; can't change from " + resolveState.name()
+ " to " + newState.name(), validToChangeTo);
 
-        if (LOG.isDebugEnabled()) {
+        if (LOG.isTraceEnabled()) {
             String oidString;
             if (oid == null) {
                 oidString = "";
@@ -167,7 +167,7 @@ public class PojoAdapter extends Instanc
                 // don't call toString() in case in process of transitioning to ghost
                 oidString = "for " + this.getOid() + " ";
             }
-            LOG.debug(oidString + "changing resolved state to " + newState.name());
+            LOG.trace(oidString + "changing resolved state to " + newState.name());
         }
         resolveState = newState;
     }

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerDefault.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerDefault.java
(original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerDefault.java
Sat Mar 19 21:11:14 2011
@@ -209,7 +209,8 @@ public class AdapterManagerDefault exten
     }
 
     public ObjectAdapter adapterForAggregatedObject(Object pojo, ObjectAdapter parent) {
-        final Oid aggregatedOid = new AggregatedOid(parent.getOid(), "*NEW*");
+ //       final Oid aggregatedOid = new AggregatedOid(parent.getOid(), "*NEW*");
+        final Oid aggregatedOid = new AggregatedOid(parent.getOid(), "+" + (Math.random()
* 1000000));
         ObjectAdapter aggregatedAdapter = createOrRecreateAdapter(pojo, aggregatedOid);
 /*
         // we copy over the type onto the adapter itself

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/internal/RuntimeContextFromSession.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/internal/RuntimeContextFromSession.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/internal/RuntimeContextFromSession.java
(original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/internal/RuntimeContextFromSession.java
Sat Mar 19 21:11:14 2011
@@ -155,16 +155,16 @@ public class RuntimeContextFromSession e
             
             @Override
             public ObjectAdapter createAggregatedInstance(ObjectSpecification spec, ObjectAdapter
parent) {
-                AggregatedOid oid = new AggregatedOid(parent.getOid(), "*UNKNOWN*");
+                
+                AggregatedOid oid = new AggregatedOid(parent.getOid(), "A" + Math.round(Math.random()
* 10000));
                 
                 ObjectAdapter adapter = getPersistenceSession().recreateAdapter(oid, spec);
                 if (adapter.getResolveState().isGhost()) {
-                    ResolveState resolveState = ResolveState.RESOLVING;
-                    adapter.changeState(resolveState);
-                    adapter.changeState(resolveState.getEndState());
+                    adapter.changeState(ResolveState.RESOLVING);
                 }
+                adapter.changeState(ResolveState.RESOLVED);
+                    
                 return adapter;
-
             };
 
             @Override

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/PersistenceSessionObjectStore.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/PersistenceSessionObjectStore.java?rev=1083289&r1=1083288&r2=1083289&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/PersistenceSessionObjectStore.java
(original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/PersistenceSessionObjectStore.java
Sat Mar 19 21:11:14 2011
@@ -345,7 +345,7 @@ public class PersistenceSessionObjectSto
     @Override
     public void objectChanged(final ObjectAdapter adapter) {
 
-        if (adapter.isTransient()) {
+        if (adapter.isTransient() || adapter.isAggregated()) {
             addObjectChangedForPresentationLayer(adapter);
             return;
         }



Mime
View raw message