You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2012/07/12 17:05:46 UTC
svn commit: r1360713 [4/4] - in /incubator/isis/trunk/framework:
runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/
runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apach...
Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/DataNucleusIdentifierGenerator.java (from r1359418, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/spi/DataNucleusIdentifierGenerator.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/DataNucleusIdentifierGenerator.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/DataNucleusIdentifierGenerator.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/spi/DataNucleusIdentifierGenerator.java&r1=1359418&r2=1360713&rev=1360713&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/spi/DataNucleusIdentifierGenerator.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/DataNucleusIdentifierGenerator.java Thu Jul 12 15:05:44 2012
@@ -1,113 +1,113 @@
-package org.apache.isis.runtimes.dflt.objectstores.datanucleus.persistence.spi;
-
-import java.util.UUID;
-
-import javax.jdo.PersistenceManager;
-
-import org.apache.log4j.Logger;
-
-import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.map.AdapterMap;
-import org.apache.isis.core.metamodel.adapter.map.AdapterMapAware;
-import org.apache.isis.core.metamodel.adapter.oid.RootOid;
-import org.apache.isis.core.metamodel.spec.ObjectSpecId;
-import org.apache.isis.core.metamodel.spec.SpecificationLookup;
-import org.apache.isis.core.metamodel.spec.SpecificationLookupAware;
-import org.apache.isis.runtimes.dflt.objectstores.datanucleus.DataNucleusObjectStore;
-import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
-import org.apache.isis.runtimes.dflt.runtime.system.persistence.IdentifierGenerator;
-
-public class DataNucleusIdentifierGenerator implements IdentifierGenerator, AdapterMapAware, SpecificationLookupAware {
-
- @SuppressWarnings("unused")
- private static final Logger LOG = Logger.getLogger(DataNucleusIdentifierGenerator.class);
-
- @SuppressWarnings("unused")
- private AdapterMap adapterMap;
-
- @SuppressWarnings("unused")
- private SpecificationLookup specificationLookup;
-
-
- // //////////////////////////////////////////////////////////////
- // main api
- // //////////////////////////////////////////////////////////////
-
- @Override
- public String createTransientIdentifierFor(ObjectSpecId objectSpecId, Object pojo) {
- return UUID.randomUUID().toString();
- }
-
-
- @Override
- public String createAggregateLocalId(ObjectSpecId objectSpecId, Object pojo, ObjectAdapter parentAdapter) {
- return UUID.randomUUID().toString();
- }
-
-
- @Override
- public String createPersistentIdentifierFor(ObjectSpecId objectSpecId, Object pojo, RootOid transientRootOid) {
-
- final Object identifier = getPersistenceManager().getObjectId(pojo);
-
- if(identifier == null) {
- // is a service
- return "1";
- }
-
-
-
- // for now, just using toString(). Suspect will need to review this
- return identifier.toString();
- }
-
-
-
- // //////////////////////////////////////////////////////////////
- // Debugging
- // //////////////////////////////////////////////////////////////
-
-
- public String debugTitle() {
- return "DataNucleus Identifier Generator";
- }
-
-
- @Override
- public void debugData(DebugBuilder debug) {
-
- }
-
-
- // //////////////////////////////////////////////////////////////
- // Dependencies (injected by setter)
- // //////////////////////////////////////////////////////////////
-
- @Override
- public void setAdapterMap(AdapterMap adapterMap) {
- this.adapterMap = adapterMap;
- }
-
- @Override
- public void setSpecificationLookup(SpecificationLookup specificationLookup) {
- this.specificationLookup = specificationLookup;
- }
-
- // //////////////////////////////////////////////////////////////
- // Dependencies (from context)
- // //////////////////////////////////////////////////////////////
-
-
- protected PersistenceManager getPersistenceManager() {
- final DataNucleusObjectStore objectStore = getObjectStore();
- return objectStore.getPersistenceManager();
- }
-
-
- protected DataNucleusObjectStore getObjectStore() {
- return (DataNucleusObjectStore) IsisContext.getPersistenceSession().getObjectStore();
- }
-
-}
-// Copyright (c) Naked Objects Group Ltd.
+package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.persistence.spi;
+
+import java.util.UUID;
+
+import javax.jdo.PersistenceManager;
+
+import org.apache.log4j.Logger;
+
+import org.apache.isis.core.commons.debug.DebugBuilder;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.map.AdapterMap;
+import org.apache.isis.core.metamodel.adapter.map.AdapterMapAware;
+import org.apache.isis.core.metamodel.adapter.oid.RootOid;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
+import org.apache.isis.core.metamodel.spec.SpecificationLookup;
+import org.apache.isis.core.metamodel.spec.SpecificationLookupAware;
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.DataNucleusObjectStore;
+import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.IdentifierGenerator;
+
+public class DataNucleusIdentifierGenerator implements IdentifierGenerator, AdapterMapAware, SpecificationLookupAware {
+
+ @SuppressWarnings("unused")
+ private static final Logger LOG = Logger.getLogger(DataNucleusIdentifierGenerator.class);
+
+ @SuppressWarnings("unused")
+ private AdapterMap adapterMap;
+
+ @SuppressWarnings("unused")
+ private SpecificationLookup specificationLookup;
+
+
+ // //////////////////////////////////////////////////////////////
+ // main api
+ // //////////////////////////////////////////////////////////////
+
+ @Override
+ public String createTransientIdentifierFor(ObjectSpecId objectSpecId, Object pojo) {
+ return UUID.randomUUID().toString();
+ }
+
+
+ @Override
+ public String createAggregateLocalId(ObjectSpecId objectSpecId, Object pojo, ObjectAdapter parentAdapter) {
+ return UUID.randomUUID().toString();
+ }
+
+
+ @Override
+ public String createPersistentIdentifierFor(ObjectSpecId objectSpecId, Object pojo, RootOid transientRootOid) {
+
+ final Object identifier = getPersistenceManager().getObjectId(pojo);
+
+ if(identifier == null) {
+ // is a service
+ return "1";
+ }
+
+
+
+ // for now, just using toString(). Suspect will need to review this
+ return identifier.toString();
+ }
+
+
+
+ // //////////////////////////////////////////////////////////////
+ // Debugging
+ // //////////////////////////////////////////////////////////////
+
+
+ public String debugTitle() {
+ return "DataNucleus Identifier Generator";
+ }
+
+
+ @Override
+ public void debugData(DebugBuilder debug) {
+
+ }
+
+
+ // //////////////////////////////////////////////////////////////
+ // Dependencies (injected by setter)
+ // //////////////////////////////////////////////////////////////
+
+ @Override
+ public void setAdapterMap(AdapterMap adapterMap) {
+ this.adapterMap = adapterMap;
+ }
+
+ @Override
+ public void setSpecificationLookup(SpecificationLookup specificationLookup) {
+ this.specificationLookup = specificationLookup;
+ }
+
+ // //////////////////////////////////////////////////////////////
+ // Dependencies (from context)
+ // //////////////////////////////////////////////////////////////
+
+
+ protected PersistenceManager getPersistenceManager() {
+ final DataNucleusObjectStore objectStore = getObjectStore();
+ return objectStore.getPersistenceManager();
+ }
+
+
+ protected DataNucleusObjectStore getObjectStore() {
+ return (DataNucleusObjectStore) IsisContext.getPersistenceSession().getObjectStore();
+ }
+
+}
+// Copyright (c) Naked Objects Group Ltd.
Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/DataNucleusSimplePersistAlgorithm.java (from r1359418, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/spi/DataNucleusSimplePersistAlgorithm.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/DataNucleusSimplePersistAlgorithm.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/DataNucleusSimplePersistAlgorithm.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/spi/DataNucleusSimplePersistAlgorithm.java&r1=1359418&r2=1360713&rev=1360713&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/spi/DataNucleusSimplePersistAlgorithm.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/DataNucleusSimplePersistAlgorithm.java Thu Jul 12 15:05:44 2012
@@ -1,62 +1,62 @@
-package org.apache.isis.runtimes.dflt.objectstores.datanucleus.persistence.spi;
-
-import org.apache.log4j.Logger;
-
-import org.apache.isis.core.commons.lang.ToString;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facets.object.callbacks.CallbackUtils;
-import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacet;
-import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.algorithm.PersistAlgorithm;
-import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.algorithm.PersistAlgorithmAbstract;
-import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.algorithm.ToPersistObjectSet;
-
-
-/**
- * A {@link PersistAlgorithm} which simply saves the object made persistent.
- */
-public class DataNucleusSimplePersistAlgorithm extends PersistAlgorithmAbstract {
-
- private static final Logger LOG = Logger
- .getLogger(DataNucleusSimplePersistAlgorithm.class);
-
-
- // ////////////////////////////////////////////////////////////////
- // name
- // ////////////////////////////////////////////////////////////////
-
- public String name() {
- return "SimplePersistAlgorithm";
- }
-
-
- // ////////////////////////////////////////////////////////////////
- // makePersistent
- // ////////////////////////////////////////////////////////////////
-
- /**
- * @see NakedInsertPostEventListener#onPostInsert(org.hibernate.event.PostInsertEvent)
- */
- public void makePersistent(final ObjectAdapter adapter,
- final ToPersistObjectSet toPersistObjectSet) {
- if (alreadyPersistedOrNotPersistable(adapter)) {
- return;
- }
- if (LOG.isInfoEnabled()) {
- LOG.info("persist " + adapter);
- }
- CallbackUtils.callCallback(adapter, PersistingCallbackFacet.class);
- toPersistObjectSet.addCreateObjectCommand(adapter);
- }
-
-
- // ////////////////////////////////////////////////////////////////
- // toString
- // ////////////////////////////////////////////////////////////////
-
- @Override
- public String toString() {
- final ToString toString = new ToString(this);
- return toString.toString();
- }
-}
-// Copyright (c) Naked Objects Group Ltd.
+package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.persistence.spi;
+
+import org.apache.log4j.Logger;
+
+import org.apache.isis.core.commons.lang.ToString;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facets.object.callbacks.CallbackUtils;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacet;
+import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.algorithm.PersistAlgorithm;
+import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.algorithm.PersistAlgorithmAbstract;
+import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.algorithm.ToPersistObjectSet;
+
+
+/**
+ * A {@link PersistAlgorithm} which simply saves the object made persistent.
+ */
+public class DataNucleusSimplePersistAlgorithm extends PersistAlgorithmAbstract {
+
+ private static final Logger LOG = Logger
+ .getLogger(DataNucleusSimplePersistAlgorithm.class);
+
+
+ // ////////////////////////////////////////////////////////////////
+ // name
+ // ////////////////////////////////////////////////////////////////
+
+ public String name() {
+ return "SimplePersistAlgorithm";
+ }
+
+
+ // ////////////////////////////////////////////////////////////////
+ // makePersistent
+ // ////////////////////////////////////////////////////////////////
+
+ /**
+ * @see NakedInsertPostEventListener#onPostInsert(org.hibernate.event.PostInsertEvent)
+ */
+ public void makePersistent(final ObjectAdapter adapter,
+ final ToPersistObjectSet toPersistObjectSet) {
+ if (alreadyPersistedOrNotPersistable(adapter)) {
+ return;
+ }
+ if (LOG.isInfoEnabled()) {
+ LOG.info("persist " + adapter);
+ }
+ CallbackUtils.callCallback(adapter, PersistingCallbackFacet.class);
+ toPersistObjectSet.addCreateObjectCommand(adapter);
+ }
+
+
+ // ////////////////////////////////////////////////////////////////
+ // toString
+ // ////////////////////////////////////////////////////////////////
+
+ @Override
+ public String toString() {
+ final ToString toString = new ToString(this);
+ return toString.toString();
+ }
+}
+// Copyright (c) Naked Objects Group Ltd.
Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/ResolveStateUtil.java (from r1359418, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/spi/ResolveStateUtil.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/ResolveStateUtil.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/ResolveStateUtil.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/spi/ResolveStateUtil.java&r1=1359418&r2=1360713&rev=1360713&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/spi/ResolveStateUtil.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/persistence/spi/ResolveStateUtil.java Thu Jul 12 15:05:44 2012
@@ -1,104 +1,104 @@
-package org.apache.isis.runtimes.dflt.objectstores.datanucleus.persistence.spi;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.ResolveState;
-
-public final class ResolveStateUtil {
-
- private ResolveStateUtil() {}
-
-
- public static void moveToResolving(final ObjectAdapter adapter) {
-
- moveUpToResolving(adapter);
- }
-
- public static void markAsResolved(final ObjectAdapter adapter) {
-
- moveUpToResolving(adapter);
-
- // move to ResolveState.RESOLVED;
-
- if (adapter.isResolving()) {
- adapter.changeState(ResolveState.RESOLVED);
-
- } else if (adapter.isResolved()) {
- // nothing to do.
-
-// } else if (adapter.getResolveState().isPartlyResolved()) {
-// adapter.changeState(ResolveState.RESOLVED);
-
- } else if (adapter.isUpdating()) {
- adapter.changeState(ResolveState.RESOLVED);
- }
- }
-
-
- private static void moveUpToResolving(final ObjectAdapter adapter) {
- // move these on so we can get to part_resolved or resolved.
- if (adapter.isTransient()) {
- adapter.changeState(ResolveState.RESOLVED);
- adapter.changeState(ResolveState.GHOST);
- adapter.changeState(ResolveState.RESOLVING);
-
- } else if (adapter.isNew()) {
- adapter.changeState(ResolveState.GHOST);
- adapter.changeState(ResolveState.RESOLVING);
-
- } else if (adapter.isGhost()) {
- adapter.changeState(ResolveState.RESOLVING);
- }
- }
-
- public static void markAsGhost(final ObjectAdapter adapter) {
-
- if (adapter.isValue()) {
- // TODO: what should we do here? throw exception?
- }
- if (adapter.isDestroyed()) {
- // TODO: what should we do here? throw exception?
- }
-
- if (adapter.isTransient()) {
- adapter.changeState(ResolveState.RESOLVED);
- adapter.changeState(ResolveState.GHOST);
-
- } else if (adapter.isNew()) {
- adapter.changeState(ResolveState.GHOST);
-
-// } else if (adapter.getResolveState().isPartlyResolved()) {
-// adapter.changeState(ResolveState.RESOLVING);
-// adapter.changeState(ResolveState.RESOLVED);
-// adapter.changeState(ResolveState.GHOST);
-
- } else if (adapter.isResolving()) {
- adapter.changeState(ResolveState.RESOLVED);
- adapter.changeState(ResolveState.GHOST);
-
- } else if (adapter.isUpdating()) {
- adapter.changeState(ResolveState.RESOLVED);
- adapter.changeState(ResolveState.GHOST);
-
- } else if (adapter.isResolved()) {
- adapter.changeState(ResolveState.GHOST);
-
- } else if (adapter.isGhost()) {
- // nothing to do.
- }
- }
-
-
- public static void markAsUpdating(final ObjectAdapter adapter) {
-
- if (adapter.isTransient()) {
- adapter.changeState(ResolveState.RESOLVED);
- }
- if (adapter.isResolved()) {
- adapter.changeState(ResolveState.UPDATING);
- }
- }
-
-}
-
-
-// Copyright (c) Naked Objects Group Ltd.
+package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.persistence.spi;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.ResolveState;
+
+public final class ResolveStateUtil {
+
+ private ResolveStateUtil() {}
+
+
+ public static void moveToResolving(final ObjectAdapter adapter) {
+
+ moveUpToResolving(adapter);
+ }
+
+ public static void markAsResolved(final ObjectAdapter adapter) {
+
+ moveUpToResolving(adapter);
+
+ // move to ResolveState.RESOLVED;
+
+ if (adapter.isResolving()) {
+ adapter.changeState(ResolveState.RESOLVED);
+
+ } else if (adapter.isResolved()) {
+ // nothing to do.
+
+// } else if (adapter.getResolveState().isPartlyResolved()) {
+// adapter.changeState(ResolveState.RESOLVED);
+
+ } else if (adapter.isUpdating()) {
+ adapter.changeState(ResolveState.RESOLVED);
+ }
+ }
+
+
+ private static void moveUpToResolving(final ObjectAdapter adapter) {
+ // move these on so we can get to part_resolved or resolved.
+ if (adapter.isTransient()) {
+ adapter.changeState(ResolveState.RESOLVED);
+ adapter.changeState(ResolveState.GHOST);
+ adapter.changeState(ResolveState.RESOLVING);
+
+ } else if (adapter.isNew()) {
+ adapter.changeState(ResolveState.GHOST);
+ adapter.changeState(ResolveState.RESOLVING);
+
+ } else if (adapter.isGhost()) {
+ adapter.changeState(ResolveState.RESOLVING);
+ }
+ }
+
+ public static void markAsGhost(final ObjectAdapter adapter) {
+
+ if (adapter.isValue()) {
+ // TODO: what should we do here? throw exception?
+ }
+ if (adapter.isDestroyed()) {
+ // TODO: what should we do here? throw exception?
+ }
+
+ if (adapter.isTransient()) {
+ adapter.changeState(ResolveState.RESOLVED);
+ adapter.changeState(ResolveState.GHOST);
+
+ } else if (adapter.isNew()) {
+ adapter.changeState(ResolveState.GHOST);
+
+// } else if (adapter.getResolveState().isPartlyResolved()) {
+// adapter.changeState(ResolveState.RESOLVING);
+// adapter.changeState(ResolveState.RESOLVED);
+// adapter.changeState(ResolveState.GHOST);
+
+ } else if (adapter.isResolving()) {
+ adapter.changeState(ResolveState.RESOLVED);
+ adapter.changeState(ResolveState.GHOST);
+
+ } else if (adapter.isUpdating()) {
+ adapter.changeState(ResolveState.RESOLVED);
+ adapter.changeState(ResolveState.GHOST);
+
+ } else if (adapter.isResolved()) {
+ adapter.changeState(ResolveState.GHOST);
+
+ } else if (adapter.isGhost()) {
+ // nothing to do.
+ }
+ }
+
+
+ public static void markAsUpdating(final ObjectAdapter adapter) {
+
+ if (adapter.isTransient()) {
+ adapter.changeState(ResolveState.RESOLVED);
+ }
+ if (adapter.isResolved()) {
+ adapter.changeState(ResolveState.UPDATING);
+ }
+ }
+
+}
+
+
+// Copyright (c) Naked Objects Group Ltd.
Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/DataNucleusPersistenceMechanismInstallerTest_getName.java (from r1359418, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/DataNucleusPersistenceMechanismInstallerTest_getName.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/DataNucleusPersistenceMechanismInstallerTest_getName.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/DataNucleusPersistenceMechanismInstallerTest_getName.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/DataNucleusPersistenceMechanismInstallerTest_getName.java&r1=1359418&r2=1360713&rev=1360713&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/DataNucleusPersistenceMechanismInstallerTest_getName.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/DataNucleusPersistenceMechanismInstallerTest_getName.java Thu Jul 12 15:05:44 2012
@@ -1,28 +1,30 @@
-package org.apache.isis.runtimes.dflt.objectstores.datanucleus;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class DataNucleusPersistenceMechanismInstallerTest_getName {
-
- private DataNucleusPersistenceMechanismInstaller installer;
-
- @Before
- public void setUp() throws Exception {
- installer = new DataNucleusPersistenceMechanismInstaller();
- }
-
- @After
- public void tearDown() throws Exception {
- }
-
- @Test
- public void isSet() {
- assertThat(installer.getName(), is("datanucleus"));
- }
-
-}
+package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
+
+public class DataNucleusPersistenceMechanismInstallerTest_getName {
+
+ private DataNucleusPersistenceMechanismInstaller installer;
+
+ @Before
+ public void setUp() throws Exception {
+ installer = new DataNucleusPersistenceMechanismInstaller();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void isSet() {
+ assertThat(installer.getName(), is("datanucleus"));
+ }
+
+}
Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/DataNucleusPersistenceMechanismInstallerTest_services.java (from r1359418, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/DataNucleusPersistenceMechanismInstallerTest_services.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/DataNucleusPersistenceMechanismInstallerTest_services.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/DataNucleusPersistenceMechanismInstallerTest_services.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/DataNucleusPersistenceMechanismInstallerTest_services.java&r1=1359418&r2=1360713&rev=1360713&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/DataNucleusPersistenceMechanismInstallerTest_services.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/DataNucleusPersistenceMechanismInstallerTest_services.java Thu Jul 12 15:05:44 2012
@@ -1,44 +1,44 @@
-package org.apache.isis.runtimes.dflt.objectstores.datanucleus;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-import java.util.List;
-
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.oid.Oid;
-import org.apache.isis.core.metamodel.adapter.oid.RootOidDefault;
-import org.apache.isis.core.metamodel.spec.ObjectSpecId;
-import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
-import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
-import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
-
-public class DataNucleusPersistenceMechanismInstallerTest_services {
-
- private PrimitiveValuedEntityRepository repo = new PrimitiveValuedEntityRepository();
-
- @Rule
- public IsisSystemWithFixtures iswf = Utils.systemBuilder()
- .withServices(repo)
- .build();
-
- @Test
- public void servicesBootstrapped() {
- final List<Object> services = IsisContext.getServices();
- assertThat(services.size(), is(1));
- assertThat(services.get(0), is((Object)repo));
-
- final ObjectAdapter serviceAdapter = IsisContext.getPersistenceSession().getAdapterManager().getAdapterFor(repo);
- assertThat(serviceAdapter, is(not(nullValue())));
-
- assertThat(serviceAdapter.getOid(), is(equalTo((Oid)RootOidDefault.create(ObjectSpecId.of("PrimitiveValuedEntities"), "1"))));
- }
-
-
-}
+package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.oid.Oid;
+import org.apache.isis.core.metamodel.adapter.oid.RootOidDefault;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
+import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
+
+public class DataNucleusPersistenceMechanismInstallerTest_services {
+
+ private PrimitiveValuedEntityRepository repo = new PrimitiveValuedEntityRepository();
+
+ @Rule
+ public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+ .withServices(repo)
+ .build();
+
+ @Test
+ public void servicesBootstrapped() {
+ final List<Object> services = IsisContext.getServices();
+ assertThat(services.size(), is(1));
+ assertThat(services.get(0), is((Object)repo));
+
+ final ObjectAdapter serviceAdapter = IsisContext.getPersistenceSession().getAdapterManager().getAdapterFor(repo);
+ assertThat(serviceAdapter, is(not(nullValue())));
+
+ assertThat(serviceAdapter.getOid(), is(equalTo((Oid)RootOidDefault.create(ObjectSpecId.of("PrimitiveValuedEntities"), "1"))));
+ }
+
+
+}
Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_allInstances.java (from r1359418, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/DataNucleusPersistenceMechanismInstallerTest_persist.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_allInstances.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_allInstances.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/DataNucleusPersistenceMechanismInstallerTest_persist.java&r1=1359418&r2=1360713&rev=1360713&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/DataNucleusPersistenceMechanismInstallerTest_persist.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_allInstances.java Thu Jul 12 15:05:44 2012
@@ -1,95 +1,67 @@
-package org.apache.isis.runtimes.dflt.objectstores.datanucleus;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.util.List;
-
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.ResolveState;
-import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
-import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntity;
-import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
-
-public class DataNucleusPersistenceMechanismInstallerTest_persist {
-
- private PrimitiveValuedEntityRepository repo = new PrimitiveValuedEntityRepository();
-
- @Rule
- public IsisSystemWithFixtures iswf = Utils.systemBuilder()
- .with(Utils.listenerToDeleteFrom("PRIMITIVEVALUEDENTITY"))
- .withServices(repo)
- .build();
-
- @Test
- public void emptyList() {
- iswf.beginTran();
- final List<PrimitiveValuedEntity> list = repo.list();
- assertThat(list.size(), is(0));
- iswf.commitTran();
- }
-
- @Test
- public void retrieveWithoutBouncing() throws Exception {
- iswf.beginTran();
- PrimitiveValuedEntity entity = repo.newEntity();
- entity.setId(1);
- entity = repo.newEntity();
- entity.setId(2);
- iswf.commitTran();
-
- // don't bounce
- iswf.beginTran();
- List<PrimitiveValuedEntity> list = repo.list();
- assertThat(list.size(), is(2));
- iswf.commitTran();
- }
-
- @Test
- public void retrieveAfterBouncingSystem() throws Exception {
- iswf.beginTran();
- PrimitiveValuedEntity entity = repo.newEntity();
- entity.setId(1);
- entity = repo.newEntity();
- entity.setId(2);
- iswf.commitTran();
-
- iswf.bounceSystem();
-
- iswf.beginTran();
- List<PrimitiveValuedEntity> list = repo.list();
- assertThat(list.size(), is(2));
- iswf.commitTran();
- }
-
- @Test
- public void adapterResolveStateChanges() throws Exception {
- iswf.beginTran();
- PrimitiveValuedEntity entity = repo.newEntity();
- ObjectAdapter adapter = iswf.adapterFor(entity);
-
- assertThat(adapter.isTransient(), is(true));
- assertThat(adapter.getResolveState(), is(ResolveState.TRANSIENT));
- assertThat(adapter.getOid().isTransient(), is(true));
-
- entity.setId(1);
- iswf.commitTran();
-
- iswf.bounceSystem();
-
- iswf.beginTran();
- final List<PrimitiveValuedEntity> list = repo.list();
- assertThat(list.size(), is(1));
-
- adapter = iswf.adapterFor(list.get(0));
- assertThat(adapter.getResolveState(), is(ResolveState.GHOST));
- assertThat(adapter.isTransient(), is(false));
- assertThat(adapter.getOid().enString(), is("PRMV:1"));
-
- iswf.commitTran();
- }
-
-}
+package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntity;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
+
+public class Persistence_allInstances {
+
+ private PrimitiveValuedEntityRepository repo = new PrimitiveValuedEntityRepository();
+
+ @Rule
+ public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+ .with(Utils.listenerToDeleteFrom("PRIMITIVEVALUEDENTITY"))
+ .withServices(repo)
+ .build();
+
+ @Test
+ public void whenNoInstances() {
+ iswf.beginTran();
+ final List<PrimitiveValuedEntity> list = repo.list();
+ assertThat(list.size(), is(0));
+ iswf.commitTran();
+ }
+
+ @Test
+ public void persist_dontBounce_listAll() throws Exception {
+
+ iswf.beginTran();
+ PrimitiveValuedEntity entity = repo.newEntity();
+ entity.setId(1);
+ entity = repo.newEntity();
+ entity.setId(2);
+ iswf.commitTran();
+
+ // don't bounce
+ iswf.beginTran();
+ List<PrimitiveValuedEntity> list = repo.list();
+ assertThat(list.size(), is(2));
+ iswf.commitTran();
+ }
+
+ @Test
+ public void persist_bounce_listAll() throws Exception {
+
+ iswf.beginTran();
+ repo.newEntity().setId(1);
+ repo.newEntity().setId(2);
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ List<PrimitiveValuedEntity> list = repo.list();
+ assertThat(list.size(), is(2));
+ iswf.commitTran();
+ }
+
+
+}
Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_bounceSystem.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_bounceSystem.java?rev=1360713&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_bounceSystem.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_bounceSystem.java Thu Jul 12 15:05:44 2012
@@ -0,0 +1,33 @@
+package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.ResolveState;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntity;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
+
+public class Persistence_bounceSystem {
+
+ private PrimitiveValuedEntityRepository repo = new PrimitiveValuedEntityRepository();
+
+ @Rule
+ public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+ .with(Utils.listenerToDeleteFrom("PRIMITIVEVALUEDENTITY"))
+ .withServices(repo)
+ .build();
+
+ @Test
+ public void bounceSystem() throws Exception {
+ iswf.bounceSystem();
+ iswf.bounceSystem();
+ }
+
+}
Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_persist.java (from r1359418, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/DataNucleusPersistenceMechanismInstallerTest_persist.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_persist.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_persist.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/DataNucleusPersistenceMechanismInstallerTest_persist.java&r1=1359418&r2=1360713&rev=1360713&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/DataNucleusPersistenceMechanismInstallerTest_persist.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_persist.java Thu Jul 12 15:05:44 2012
@@ -1,95 +1,105 @@
-package org.apache.isis.runtimes.dflt.objectstores.datanucleus;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.util.List;
-
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.ResolveState;
-import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
-import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntity;
-import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
-
-public class DataNucleusPersistenceMechanismInstallerTest_persist {
-
- private PrimitiveValuedEntityRepository repo = new PrimitiveValuedEntityRepository();
-
- @Rule
- public IsisSystemWithFixtures iswf = Utils.systemBuilder()
- .with(Utils.listenerToDeleteFrom("PRIMITIVEVALUEDENTITY"))
- .withServices(repo)
- .build();
-
- @Test
- public void emptyList() {
- iswf.beginTran();
- final List<PrimitiveValuedEntity> list = repo.list();
- assertThat(list.size(), is(0));
- iswf.commitTran();
- }
-
- @Test
- public void retrieveWithoutBouncing() throws Exception {
- iswf.beginTran();
- PrimitiveValuedEntity entity = repo.newEntity();
- entity.setId(1);
- entity = repo.newEntity();
- entity.setId(2);
- iswf.commitTran();
-
- // don't bounce
- iswf.beginTran();
- List<PrimitiveValuedEntity> list = repo.list();
- assertThat(list.size(), is(2));
- iswf.commitTran();
- }
-
- @Test
- public void retrieveAfterBouncingSystem() throws Exception {
- iswf.beginTran();
- PrimitiveValuedEntity entity = repo.newEntity();
- entity.setId(1);
- entity = repo.newEntity();
- entity.setId(2);
- iswf.commitTran();
-
- iswf.bounceSystem();
-
- iswf.beginTran();
- List<PrimitiveValuedEntity> list = repo.list();
- assertThat(list.size(), is(2));
- iswf.commitTran();
- }
-
- @Test
- public void adapterResolveStateChanges() throws Exception {
- iswf.beginTran();
- PrimitiveValuedEntity entity = repo.newEntity();
- ObjectAdapter adapter = iswf.adapterFor(entity);
-
- assertThat(adapter.isTransient(), is(true));
- assertThat(adapter.getResolveState(), is(ResolveState.TRANSIENT));
- assertThat(adapter.getOid().isTransient(), is(true));
-
- entity.setId(1);
- iswf.commitTran();
-
- iswf.bounceSystem();
-
- iswf.beginTran();
- final List<PrimitiveValuedEntity> list = repo.list();
- assertThat(list.size(), is(1));
-
- adapter = iswf.adapterFor(list.get(0));
- assertThat(adapter.getResolveState(), is(ResolveState.GHOST));
- assertThat(adapter.isTransient(), is(false));
- assertThat(adapter.getOid().enString(), is("PRMV:1"));
-
- iswf.commitTran();
- }
-
-}
+package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.ResolveState;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntity;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
+
+public class Persistence_persist {
+
+ private PrimitiveValuedEntityRepository repo = new PrimitiveValuedEntityRepository();
+
+ @Rule
+ public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+ .with(Utils.listenerToDeleteFrom("PRIMITIVEVALUEDENTITY"))
+ .withServices(repo)
+ .build();
+
+ @Test
+ public void persistTwo() throws Exception {
+ iswf.beginTran();
+ repo.newEntity().setId(1);
+ repo.newEntity().setId(2);
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ List<PrimitiveValuedEntity> list = repo.list();
+ assertThat(list.size(), is(2));
+ iswf.commitTran();
+ }
+
+ @Test
+ public void persistAllValues() throws Exception {
+ iswf.beginTran();
+ PrimitiveValuedEntity entity = repo.newEntity();
+ entity.setId(1);
+ entity.setBooleanProperty(true);
+ entity.setByteProperty((byte)123);
+ entity.setDoubleProperty(9876543210987.0);
+ entity.setFloatProperty(123456.0f);
+ entity.setIntProperty(456);
+ entity.setLongProperty(12345678901L);
+ entity.setShortProperty((short)4567);
+ entity.setCharProperty('X');
+
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ PrimitiveValuedEntity entityRetrieved = repo.list().get(0);
+ assertThat(entityRetrieved.getBooleanProperty(), is(true));
+ assertThat(entityRetrieved.getByteProperty(), is((byte)123));
+ assertThat(entityRetrieved.getDoubleProperty(), is(9876543210987.0));
+ assertThat(entityRetrieved.getFloatProperty(), is(123456.0f));
+ assertThat(entityRetrieved.getIntProperty(), is(456));
+ assertThat(entityRetrieved.getLongProperty(), is(12345678901L));
+ assertThat(entityRetrieved.getShortProperty(), is((short)4567));
+ assertThat(entityRetrieved.getCharProperty(), is('X'));
+
+ iswf.commitTran();
+ }
+
+ @Test
+ public void adapterResolveState_isResolved() throws Exception {
+
+ iswf.beginTran();
+ PrimitiveValuedEntity entity = repo.newEntity();
+ ObjectAdapter adapter = iswf.adapterFor(entity);
+
+ assertThat(adapter.isTransient(), is(true));
+ assertThat(adapter.getResolveState(), is(ResolveState.TRANSIENT));
+ assertThat(adapter.getOid().isTransient(), is(true));
+
+ entity.setId(1);
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ final List<PrimitiveValuedEntity> list = repo.list();
+ assertThat(list.size(), is(1));
+
+ adapter = iswf.adapterFor(list.get(0));
+ assertThat(adapter.getResolveState(), is(ResolveState.RESOLVED));
+ assertThat(adapter.isTransient(), is(false));
+ assertThat(adapter.getOid().enString(), is("PRMV:1"));
+
+ iswf.commitTran();
+ }
+
+
+
+}
Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_persist_dataStoreAssignedPrimaryKey.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_persist_dataStoreAssignedPrimaryKey.java?rev=1360713&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_persist_dataStoreAssignedPrimaryKey.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Persistence_persist_dataStoreAssignedPrimaryKey.java Thu Jul 12 15:05:44 2012
@@ -0,0 +1,42 @@
+package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.scalars.AutoAssignedEntity;
+import org.apache.isis.tck.dom.scalars.AutoAssignedEntityRepository;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntity;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
+
+public class Persistence_persist_dataStoreAssignedPrimaryKey {
+
+ private AutoAssignedEntityRepository repo = new AutoAssignedEntityRepository();
+
+ @Rule
+ public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+ .with(Utils.listenerToDeleteFrom("AUTOASSIGNEDENTITY"))
+ .withServices(repo)
+ .build();
+
+ @Test
+ public void persistTwo() throws Exception {
+ iswf.beginTran();
+ repo.newEntity();
+ repo.newEntity();
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ List<AutoAssignedEntity> list = repo.list();
+ assertThat(list.size(), is(2));
+ iswf.commitTran();
+ }
+
+}
Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Utils.java (from r1359418, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/Utils.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Utils.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Utils.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/Utils.java&r1=1359418&r2=1360713&rev=1360713&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/Utils.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/Utils.java Thu Jul 12 15:05:44 2012
@@ -1,70 +1,84 @@
-package org.apache.isis.runtimes.dflt.objectstores.datanucleus;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Properties;
-
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.commons.config.IsisConfigurationDefault;
-import org.apache.isis.runtimes.dflt.objectstores.datanucleus.metamodel.specloader.progmodelfacets.DataNucleusProgrammingModelFacets;
-import org.apache.isis.runtimes.dflt.objectstores.jdo.metamodel.specloader.validator.JdoMetaModelValidator;
-import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
-import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
-
-public class Utils {
-
- private Utils(){}
-
- public static IsisSystemWithFixtures.Builder systemBuilder() {
- return IsisSystemWithFixtures.builder()
- .with(configurationForDataNucleusOverHsqlDb())
- .with(new DataNucleusProgrammingModelFacets())
- .with(new JdoMetaModelValidator())
- .with(new DataNucleusPersistenceMechanismInstaller());
- }
-
- public static IsisSystemWithFixtures.Listener listenerToDeleteFrom(final String... tables) {
- return new IsisSystemWithFixtures.ListenerAdapter(){
-
- @Override
- public void postSetupSystem(boolean firstTime) throws Exception {
- final Statement statement = createStatement();
- for(String table: tables) {
- statement.executeUpdate("DELETE FROM " + table);
- }
- }
-
- private Statement createStatement() throws SQLException {
- final DataNucleusObjectStore objectStore = (DataNucleusObjectStore) IsisContext.getPersistenceSession().getObjectStore();
- Connection connection = objectStore.getJavaSqlConnection();
- return connection.createStatement();
- }
- };
- }
-
- public static IsisConfiguration configurationForDataNucleusOverHsqlDb() {
- final IsisConfigurationDefault configuration = new IsisConfigurationDefault();
- Properties props = new Properties();
-
- props.put("isis.persistor.datanucleus.impl.javax.jdo.PersistenceManagerFactoryClass", "org.datanucleus.api.jdo.JDOPersistenceManagerFactory");
-
- //props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName", "org.hsqldb.jdbcDriver");
- //props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL", "jdbc:hsqldb:mem:test");
- ////props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL", "jdbc:hsqldb:file:hsql-db/test;hsqldb.write_delay=false;shutdown=true");
- //props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName", "sa");
- //props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword", "");
-
- props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName", "com.microsoft.sqlserver.jdbc.SQLServerDriver");
- props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL", "jdbc:sqlserver://127.0.0.1:1433;instance=SQLEXPRESS;databaseName=jdo;");
- props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName", "jdo");
- props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword", "jdopass");
-
- props.put("isis.persistor.datanucleus.impl.datanucleus.autoCreateSchema", "true");
- props.put("isis.persistor.datanucleus.impl.datanucleus.validateTables", "false");
- props.put("isis.persistor.datanucleus.impl.datanucleus.validateConstraints", "false");
- configuration.add(props);
- return configuration;
- }
-
-}
+package org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Properties;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.config.IsisConfigurationDefault;
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.DataNucleusObjectStore;
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.metamodel.specloader.progmodelfacets.DataNucleusProgrammingModelFacets;
+import org.apache.isis.runtimes.dflt.objectstores.jdo.metamodel.specloader.validator.JdoMetaModelValidator;
+import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+
+public class Utils {
+
+ private Utils(){}
+
+ public static IsisSystemWithFixtures.Builder systemBuilder() {
+ return IsisSystemWithFixtures.builder()
+ .with(configurationForDataNucleusDb())
+ .with(new DataNucleusProgrammingModelFacets())
+ .with(new JdoMetaModelValidator())
+ .with(new DataNucleusPersistenceMechanismInstaller());
+ }
+
+ public static IsisSystemWithFixtures.Listener listenerToDeleteFrom(final String... tables) {
+ return new IsisSystemWithFixtures.ListenerAdapter(){
+
+ @Override
+ public void postSetupSystem(boolean firstTime) throws Exception {
+ Connection connection = getConnection();
+ try {
+ final Statement statement = connection.createStatement();
+ for(String table: tables) {
+ statement.executeUpdate("DELETE FROM " + table);
+ }
+ } catch(Exception ex) {
+ connection.rollback();
+ throw ex;
+ } finally {
+ connection.commit();
+ }
+ }
+
+ private Statement createStatement() throws SQLException {
+ Connection connection = getConnection();
+ return connection.createStatement();
+ }
+
+ private Connection getConnection() {
+ final DataNucleusObjectStore objectStore = (DataNucleusObjectStore) IsisContext.getPersistenceSession().getObjectStore();
+ return objectStore.getJavaSqlConnection();
+ }
+ };
+ }
+
+ public static IsisConfiguration configurationForDataNucleusDb() {
+ final IsisConfigurationDefault configuration = new IsisConfigurationDefault();
+ Properties props = new Properties();
+
+ props.put("isis.persistor.datanucleus.impl.javax.jdo.PersistenceManagerFactoryClass", "org.datanucleus.api.jdo.JDOPersistenceManagerFactory");
+
+ //props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName", "org.hsqldb.jdbcDriver");
+ //props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL", "jdbc:hsqldb:mem:test");
+ ////props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL", "jdbc:hsqldb:file:hsql-db/test;hsqldb.write_delay=false;shutdown=true");
+ //props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName", "sa");
+ //props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword", "");
+
+ props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName", "com.microsoft.sqlserver.jdbc.SQLServerDriver");
+ props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL", "jdbc:sqlserver://127.0.0.1:1433;instance=SQLEXPRESS;databaseName=jdo;");
+ props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName", "jdo");
+ props.put("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword", "jdopass");
+
+ //props.put("isis.persistor.datanucleus.impl.datanucleus.autoCreateSchema", "true");
+ //props.put("isis.persistor.datanucleus.impl.datanucleus.validateTables", "false");
+ //props.put("isis.persistor.datanucleus.impl.datanucleus.validateConstraints", "false");
+ configuration.add(props);
+ return configuration;
+ }
+
+}
Added: incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/AutoAssignedEntity.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/AutoAssignedEntity.java?rev=1360713&view=auto
==============================================================================
--- incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/AutoAssignedEntity.java (added)
+++ incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/AutoAssignedEntity.java Thu Jul 12 15:05:44 2012
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.tck.dom.scalars;
+
+import javax.jdo.annotations.Discriminator;
+import javax.jdo.annotations.PersistenceCapable;
+import javax.jdo.annotations.PrimaryKey;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import org.apache.isis.applib.AbstractDomainObject;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.ObjectType;
+import org.apache.isis.applib.annotation.Optional;
+import org.apache.isis.applib.annotation.Title;
+
+@PersistenceCapable // for jdo object store
+@Discriminator("AUAS") // for jdo object store
+@javax.jdo.annotations.DatastoreIdentity(strategy=javax.jdo.annotations.IdGeneratorStrategy.IDENTITY) // for jdo objectstore
+@Entity // for jpa object store
+@DiscriminatorValue("AUAS") // for jpa object store
+@ObjectType("AUAS")
+public class AutoAssignedEntity extends AbstractDomainObject {
+
+ // {{ Id (Integer, also used in title)
+ private Integer id;
+
+ @Title(sequence="1", append=": ")
+ @Id // for jpa object store
+ @PrimaryKey // for jdo object store
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(final Integer id) {
+ this.id = id;
+ }
+ // }}
+
+
+ // {{ StringProperty (also used in title)
+ private String stringProperty;
+
+ @Title(sequence="2")
+ @Optional
+ @MemberOrder(sequence = "1")
+ public String getStringProperty() {
+ return stringProperty;
+ }
+
+ public void setStringProperty(final String description) {
+ this.stringProperty = description;
+ }
+
+ // }}
+
+}
Added: incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/AutoAssignedEntityRepository.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/AutoAssignedEntityRepository.java?rev=1360713&view=auto
==============================================================================
--- incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/AutoAssignedEntityRepository.java (added)
+++ incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/AutoAssignedEntityRepository.java Thu Jul 12 15:05:44 2012
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.tck.dom.scalars;
+
+import java.util.List;
+
+import org.apache.isis.applib.AbstractFactoryAndRepository;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Named;
+import org.apache.isis.applib.annotation.ObjectType;
+import org.apache.isis.applib.annotation.QueryOnly;
+
+@Named("AutoAssignedEntities")
+@ObjectType("AutoAssignedEntities")
+public class AutoAssignedEntityRepository extends AbstractFactoryAndRepository {
+
+ @Override
+ public String getId() {
+ return "AutoAssignedEntities";
+ }
+
+ @QueryOnly
+ @MemberOrder(sequence = "1")
+ public List<AutoAssignedEntity> list() {
+ return allInstances(AutoAssignedEntity.class);
+ }
+
+ @MemberOrder(sequence = "2")
+ public AutoAssignedEntity newEntity() {
+ final AutoAssignedEntity entity = newTransientInstance(AutoAssignedEntity.class);
+ persist(entity);
+ return entity;
+ }
+}
Modified: incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/JdkValuedEntity.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/JdkValuedEntity.java?rev=1360713&r1=1360712&r2=1360713&view=diff
==============================================================================
--- incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/JdkValuedEntity.java (original)
+++ incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/JdkValuedEntity.java Thu Jul 12 15:05:44 2012
@@ -1,146 +1,141 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.tck.dom.scalars;
-
-import java.awt.Image;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Date;
-
-import org.apache.isis.applib.AbstractDomainObject;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.ObjectType;
-import org.apache.isis.applib.annotation.Optional;
-
-@ObjectType("JDKV")
-public class JdkValuedEntity extends AbstractDomainObject {
-
- // {{ Title
- public String title() {
- return getStringProperty();
- }
-
- // }}
-
- // {{ StringProperty
- private String stringProperty;
-
- @Optional
- @MemberOrder(sequence = "1")
- public String getStringProperty() {
- return stringProperty;
- }
-
- public void setStringProperty(final String description) {
- this.stringProperty = description;
- }
-
- // }}
-
- // {{ JavaUtilDateProperty
- private Date javaUtilDateProperty;
-
- @Optional
- @MemberOrder(sequence = "1")
- public Date getJavaUtilDateProperty() {
- return javaUtilDateProperty;
- }
-
- public void setJavaUtilDateProperty(final Date javaUtilDateProperty) {
- this.javaUtilDateProperty = javaUtilDateProperty;
- }
-
- // }}
-
- // {{ JavaSqlDateProperty
- private java.sql.Date javaSqlDateProperty;
-
- @Optional
- @MemberOrder(sequence = "1")
- public java.sql.Date getJavaSqlDateProperty() {
- return javaSqlDateProperty;
- }
-
- public void setJavaSqlDateProperty(final java.sql.Date javaSqlDateProperty) {
- this.javaSqlDateProperty = javaSqlDateProperty;
- }
-
- // }}
-
- // {{ JavaSqlTimestampProperty
- private java.sql.Timestamp javaSqlTimestampProperty;
-
- @Optional
- @MemberOrder(sequence = "1")
- public java.sql.Timestamp getJavaSqlTimestampProperty() {
- return javaSqlTimestampProperty;
- }
-
- public void setJavaSqlTimestampProperty(final java.sql.Timestamp javaSqlTimestampProperty) {
- this.javaSqlTimestampProperty = javaSqlTimestampProperty;
- }
-
- // }}
-
- // {{ BigIntegerProperty
- private BigInteger bigIntegerProperty;
-
- @Optional
- @MemberOrder(sequence = "1")
- public BigInteger getBigIntegerProperty() {
- return bigIntegerProperty;
- }
-
- public void setBigIntegerProperty(final BigInteger bigIntegerProperty) {
- this.bigIntegerProperty = bigIntegerProperty;
- }
-
- // }}
-
- // {{ BigDecimalProperty
- private BigDecimal bigDecimalProperty;
-
- @Optional
- @MemberOrder(sequence = "1")
- public BigDecimal getBigDecimalProperty() {
- return bigDecimalProperty;
- }
-
- public void setBigDecimalProperty(final BigDecimal bigDecimalProperty) {
- this.bigDecimalProperty = bigDecimalProperty;
- }
-
- // }}
-
- // {{ ImageProperty
- private Image imageProperty;
-
- @Optional
- @MemberOrder(sequence = "1")
- public Image getImageProperty() {
- return imageProperty;
- }
-
- public void setImageProperty(final Image imageProperty) {
- this.imageProperty = imageProperty;
- }
- // }}
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.tck.dom.scalars;
+
+import java.awt.Image;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Date;
+
+import org.apache.isis.applib.AbstractDomainObject;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.ObjectType;
+import org.apache.isis.applib.annotation.Optional;
+import org.apache.isis.applib.annotation.Title;
+
+@ObjectType("JDKV")
+public class JdkValuedEntity extends AbstractDomainObject {
+
+ // {{ StringProperty (also title)
+ private String stringProperty;
+
+ @Title
+ @Optional
+ @MemberOrder(sequence = "1")
+ public String getStringProperty() {
+ return stringProperty;
+ }
+
+ public void setStringProperty(final String description) {
+ this.stringProperty = description;
+ }
+
+ // }}
+
+ // {{ JavaUtilDateProperty
+ private Date javaUtilDateProperty;
+
+ @Optional
+ @MemberOrder(sequence = "1")
+ public Date getJavaUtilDateProperty() {
+ return javaUtilDateProperty;
+ }
+
+ public void setJavaUtilDateProperty(final Date javaUtilDateProperty) {
+ this.javaUtilDateProperty = javaUtilDateProperty;
+ }
+
+ // }}
+
+ // {{ JavaSqlDateProperty
+ private java.sql.Date javaSqlDateProperty;
+
+ @Optional
+ @MemberOrder(sequence = "1")
+ public java.sql.Date getJavaSqlDateProperty() {
+ return javaSqlDateProperty;
+ }
+
+ public void setJavaSqlDateProperty(final java.sql.Date javaSqlDateProperty) {
+ this.javaSqlDateProperty = javaSqlDateProperty;
+ }
+
+ // }}
+
+ // {{ JavaSqlTimestampProperty
+ private java.sql.Timestamp javaSqlTimestampProperty;
+
+ @Optional
+ @MemberOrder(sequence = "1")
+ public java.sql.Timestamp getJavaSqlTimestampProperty() {
+ return javaSqlTimestampProperty;
+ }
+
+ public void setJavaSqlTimestampProperty(final java.sql.Timestamp javaSqlTimestampProperty) {
+ this.javaSqlTimestampProperty = javaSqlTimestampProperty;
+ }
+
+ // }}
+
+ // {{ BigIntegerProperty
+ private BigInteger bigIntegerProperty;
+
+ @Optional
+ @MemberOrder(sequence = "1")
+ public BigInteger getBigIntegerProperty() {
+ return bigIntegerProperty;
+ }
+
+ public void setBigIntegerProperty(final BigInteger bigIntegerProperty) {
+ this.bigIntegerProperty = bigIntegerProperty;
+ }
+
+ // }}
+
+ // {{ BigDecimalProperty
+ private BigDecimal bigDecimalProperty;
+
+ @Optional
+ @MemberOrder(sequence = "1")
+ public BigDecimal getBigDecimalProperty() {
+ return bigDecimalProperty;
+ }
+
+ public void setBigDecimalProperty(final BigDecimal bigDecimalProperty) {
+ this.bigDecimalProperty = bigDecimalProperty;
+ }
+
+ // }}
+
+ // {{ ImageProperty
+ private Image imageProperty;
+
+ @Optional
+ @MemberOrder(sequence = "1")
+ public Image getImageProperty() {
+ return imageProperty;
+ }
+
+ public void setImageProperty(final Image imageProperty) {
+ this.imageProperty = imageProperty;
+ }
+ // }}
+
+}
Modified: incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/PrimitiveValuedEntity.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/PrimitiveValuedEntity.java?rev=1360713&r1=1360712&r2=1360713&view=diff
==============================================================================
--- incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/PrimitiveValuedEntity.java (original)
+++ incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/PrimitiveValuedEntity.java Thu Jul 12 15:05:44 2012
@@ -1,158 +1,173 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.tck.dom.scalars;
-
-import javax.jdo.annotations.Discriminator;
-import javax.jdo.annotations.PersistenceCapable;
-import javax.jdo.annotations.PrimaryKey;
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import org.apache.isis.applib.AbstractDomainObject;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.ObjectType;
-
-@PersistenceCapable // for jdo object store
-@Discriminator("PRMV") // for jdo object store
-@Entity // for jpa object store
-@DiscriminatorValue("PRMV") // for jpa object store
-@ObjectType("PRMV")
-public class PrimitiveValuedEntity extends AbstractDomainObject {
-
- // {{ Id (Integer)
- private Integer id;
-
- @PrimaryKey // for jdo object store
- @Id // for jpa object store
- public Integer getId() {
- return id;
- }
-
- public void setId(final Integer id) {
- this.id = id;
- }
- // }}
-
- // {{ Title
- public String title() {
- return null;
- }
-
- // }}
-
- // {{ BooleanProperty
- private boolean booleanProperty;
-
- @MemberOrder(sequence = "3")
- public boolean getBooleanProperty() {
- return booleanProperty;
- }
-
- public void setBooleanProperty(final boolean booleanProperty) {
- this.booleanProperty = booleanProperty;
- }
-
- // }}
-
- // {{ ByteProperty
- private byte byteProperty;
-
- @MemberOrder(sequence = "1")
- public byte getByteProperty() {
- return byteProperty;
- }
-
- public void setByteProperty(final byte byteProperty) {
- this.byteProperty = byteProperty;
- }
-
- // }}
-
- // {{ ShortProperty
- private short shortProperty;
-
- @MemberOrder(sequence = "1")
- public short getShortProperty() {
- return shortProperty;
- }
-
- public void setShortProperty(final short shortProperty) {
- this.shortProperty = shortProperty;
- }
-
- // }}
-
- // {{ IntProperty
- private int intProperty;
-
- @MemberOrder(sequence = "1")
- public int getIntProperty() {
- return intProperty;
- }
-
- public void setIntProperty(final int intProperty) {
- this.intProperty = intProperty;
- }
-
- // }}
-
- // {{ LongProperty
- private long longProperty;
-
- @MemberOrder(sequence = "1")
- public long getLongProperty() {
- return longProperty;
- }
-
- public void setLongProperty(final long longProperty) {
- this.longProperty = longProperty;
- }
-
- // }}
-
- // {{ FloatProperty
- private float floatProperty;
-
- @MemberOrder(sequence = "1")
- public float getFloatProperty() {
- return floatProperty;
- }
-
- public void setFloatProperty(final float floatProperty) {
- this.floatProperty = floatProperty;
- }
-
- // }}
-
- // {{ DoubleProperty
- private double doubleProperty;
-
- @MemberOrder(sequence = "1")
- public double getDoubleProperty() {
- return doubleProperty;
- }
-
- public void setDoubleProperty(final double doubleProperty) {
- this.doubleProperty = doubleProperty;
- }
- // }}
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.tck.dom.scalars;
+
+import javax.jdo.annotations.Discriminator;
+import javax.jdo.annotations.PersistenceCapable;
+import javax.jdo.annotations.PrimaryKey;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import org.apache.isis.applib.AbstractDomainObject;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.ObjectType;
+
+@PersistenceCapable // for jdo object store
+@Discriminator("PRMV") // for jdo object store
+@Entity // for jpa object store
+@DiscriminatorValue("PRMV") // for jpa object store
+@ObjectType("PRMV")
+public class PrimitiveValuedEntity extends AbstractDomainObject {
+
+ // {{ Id (Integer)
+ private Integer id;
+
+ @Id // for jpa object store
+ @PrimaryKey // for jdo object store
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(final Integer id) {
+ this.id = id;
+ }
+ // }}
+
+ // {{ Title
+ public String title() {
+ return null;
+ }
+
+ // }}
+
+ // {{ BooleanProperty
+ private boolean booleanProperty;
+
+ @MemberOrder(sequence = "3")
+ public boolean getBooleanProperty() {
+ return booleanProperty;
+ }
+
+ public void setBooleanProperty(final boolean booleanProperty) {
+ this.booleanProperty = booleanProperty;
+ }
+
+ // }}
+
+ // {{ ByteProperty
+ private byte byteProperty;
+
+ @MemberOrder(sequence = "1")
+ public byte getByteProperty() {
+ return byteProperty;
+ }
+
+ public void setByteProperty(final byte byteProperty) {
+ this.byteProperty = byteProperty;
+ }
+
+ // }}
+
+ // {{ ShortProperty
+ private short shortProperty;
+
+ @MemberOrder(sequence = "1")
+ public short getShortProperty() {
+ return shortProperty;
+ }
+
+ public void setShortProperty(final short shortProperty) {
+ this.shortProperty = shortProperty;
+ }
+
+ // }}
+
+ // {{ IntProperty
+ private int intProperty;
+
+ @MemberOrder(sequence = "1")
+ public int getIntProperty() {
+ return intProperty;
+ }
+
+ public void setIntProperty(final int intProperty) {
+ this.intProperty = intProperty;
+ }
+
+ // }}
+
+ // {{ LongProperty
+ private long longProperty;
+
+ @MemberOrder(sequence = "1")
+ public long getLongProperty() {
+ return longProperty;
+ }
+
+ public void setLongProperty(final long longProperty) {
+ this.longProperty = longProperty;
+ }
+
+ // }}
+
+ // {{ FloatProperty
+ private float floatProperty;
+
+ @MemberOrder(sequence = "1")
+ public float getFloatProperty() {
+ return floatProperty;
+ }
+
+ public void setFloatProperty(final float floatProperty) {
+ this.floatProperty = floatProperty;
+ }
+
+ // }}
+
+ // {{ DoubleProperty
+ private double doubleProperty;
+
+ @MemberOrder(sequence = "1")
+ public double getDoubleProperty() {
+ return doubleProperty;
+ }
+
+ public void setDoubleProperty(final double doubleProperty) {
+ this.doubleProperty = doubleProperty;
+ }
+ // }}
+
+
+ // {{ CharProperty
+ private char charProperty;
+
+ @MemberOrder(sequence = "1")
+ public char getCharProperty() {
+ return charProperty;
+ }
+
+ public void setCharProperty(final char charProperty) {
+ this.charProperty = charProperty;
+ }
+ // }}
+
+
+}