isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1338472 [1/8] - in /incubator/isis/trunk/framework/runtimes/dflt: objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/ objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ ob...
Date Mon, 14 May 2012 22:45:03 GMT
Author: danhaywood
Date: Mon May 14 22:44:57 2012
New Revision: 1338472

URL: http://svn.apache.org/viewvc?rev=1338472&view=rev
Log:
ISIS-214: final major bit of the Oid refactoring

Added:
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJpaDiscriminatorValueAnnotation.java
      - copied, changed from r1331799, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/ObjectTypeFacetInferredFromJpaDiscriminatorValueAnnotation.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlIdentifierGenerator.java   (with props)
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/file/PropertyNames.java   (with props)
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlIdentifierGeneratorTest.java
      - copied, changed from r1331799, incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlOidGeneratorTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlObjectStoreTest_constructor.java   (with props)
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlObjectStoreTest_interactWith_db.java   (with props)
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/SqlIdentifierGenerator.java   (with props)
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreLogger.java
      - copied, changed from r1331799, incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisStoreLogger.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/IdentifierGenerator.java   (with props)
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/IdentifierGeneratorDefault.java   (with props)
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/OidGeneratorAware.java
      - copied, changed from r1331799, incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/oidgenerator/OidGeneratorAware.java
Removed:
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/ObjectTypeFacetInferredFromJpaDiscriminatorValueAnnotation.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlOidGenerator.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/keys/KeyCreator.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlObjectStoreTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlOidGeneratorTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/SqlOidGenerator.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionAbstract.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionLogger.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisStoreLogger.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/PersistenceSessionObjectStore.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/ObjectStoreTransaction.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/ObjectStoreTransactionManager.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/oidgenerator/OidGeneratorAbstract.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/oidgenerator/OidGeneratorAware.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/oidgenerator/package-info.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/oidgenerator/serial/
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSessionForceReloader.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/transaction/IsisTransactionManagerAbstract.java
Modified:
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStore.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryPersistenceSessionFactory.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjects.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault_savesOidGeneratorAsMemento.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault_services.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/JpaDiscriminatorValueAnnotationFacetFactory.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/specloader/validator/JpaMetaModelValidator.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/test/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/GivenJpaDiscriminatorValueAnnotationFacetFactoryTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlCommandContext.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlCreateObjectCommand.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlDestroyObjectCommand.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlObjectStore.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlSaveObjectCommand.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/ObjectReader.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/WriteObjectCommand.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/NoSqlDataDatabase.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/NoSqlPersistorMechanismInstaller.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/StateReader.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/StateWriter.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/file/FileClientCommandContext.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/file/FileServerDb.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/file/JsonStateReader.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/file/JsonStateWriter.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/file/server/FileServer.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/mongo/MongoClientCommandContext.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/mongo/MongoDb.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/mongo/MongoPersistorMechanismInstaller.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/mongo/MongoStateReader.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/mongo/MongoStateWriter.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/mongo/PropertyNames.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/keys/KeyCreatorDefault.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/DestroyObjectCommandImplementationTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlKeyCreatorTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlKeyCreatorTest_reference.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/ObjectReaderTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/WriteObjectCommandTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/file/ChecksummingPerfomance.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/file/ClientConnectionTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/file/JsonStateReaderTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/file/JsonStateWriterTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/mongo/MongoDbTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/mongo/MongoStateReaderTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/db/mongo/MongoStateWriterTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/IdMappingAbstract.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/ObjectMapping.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/SqlObjectStore.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/SqlPersistorInstaller.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/AbstractAutoMapper.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/AutoMapper.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/PolymorphicForeignKeyInChildCollectionBaseMapper.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/common/SqlIntegrationTestCommonBase.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/HsqlTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/PolymorphismTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-tests-common/src/test/java/org/apache/isis/runtimes/dflt/objectstores/sql/crosscheck/XmlPersistenceTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStore.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlPersistenceMechanismInstaller.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/data/CollectionData.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/data/Data.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/data/ObjectData.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/data/xml/XmlDataManager.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/services/ServiceManager.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/services/xml/XmlServiceManager.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStoreTest_persist.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStoreTest_toRefactor.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/data/ObjectDataTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/data/ObjectDataVectorTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/data/ReferenceVectorTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/data/xml/XmlDataManagerTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/data/xml/XmlDataManagerTest_instances.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/installerregistry/installerapi/ObjectStorePersistenceMechanismInstallerAbstract.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/installerregistry/installerapi/PersistenceMechanismInstallerAbstract.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/memento/Memento.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceConstants.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerDefault.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerPersist.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerProxy.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerTestSupport.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/RootAndCollectionAdapters.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/internal/RuntimeContextFromSession.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisStoreDelegating.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStorePersistence.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStoreTransactionManagement.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/DeploymentType.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/OidGenerator.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSession.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSessionContainer.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSessionHydrator.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSessionTransactionManagement.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/IsisTransaction.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/IsisTransactionManager.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/systemusinginstallers/IsisSystemUsingInstallers.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/transaction/messagebroker/MessageBrokerDefault.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/context/IsisContextTest.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/AdapterManagerDefault_aggregateAdapters.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapterTest.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/PersistenceSessionObjectStoreTest.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/ObjectStoreTransactionManagerAbstractTestCase.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/ObjectStoreTransactionManager_EndTransactionTest.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/ObjectStoreTransactionManager_InstantiationTest.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/ObjectStoreTransactionManager_StartTransactionTest.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/PojoAdapterBuilder.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/TransactionTest.java
    incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/IsisSystemWithFixtures.java
    incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/tck/ObjectStoreContractTest_persist.java
    incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_debug.java
    incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_init.java
    incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_persist.java
    incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_reset.java
    incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_retrieve.java
    incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_serviceRegistry.java
    incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistorSessionHydratorTest.java

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStore.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStore.java?rev=1338472&r1=1338471&r2=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStore.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStore.java Mon May 14 22:44:57 2012
@@ -33,10 +33,12 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.adapter.ResolveState;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
 import org.apache.isis.core.metamodel.adapter.oid.RootOid;
+import org.apache.isis.core.metamodel.adapter.oid.TypedOid;
 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.collections.modify.CollectionFacetUtils;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.SpecificationLookup;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
 import org.apache.isis.runtimes.dflt.objectstores.dflt.internal.ObjectStoreInstances;
 import org.apache.isis.runtimes.dflt.objectstores.dflt.internal.ObjectStorePersistedObjects;
@@ -229,11 +231,12 @@ public class InMemoryObjectStore impleme
     // ///////////////////////////////////////////////////////
 
     @Override
-    public ObjectAdapter getObject(final Oid oid, final ObjectSpecification hint) throws ObjectNotFoundException, ObjectPersistenceException {
+    public ObjectAdapter getObject(final TypedOid oid) throws ObjectNotFoundException, ObjectPersistenceException {
         if(LOG.isDebugEnabled()) {
             LOG.debug("getObject " + oid);
         }
-        final ObjectStoreInstances ins = instancesFor(hint);
+        final ObjectSpecification objectSpec = getSpecificationLookup().lookupBySpecId(oid.getObjectSpecId());
+        final ObjectStoreInstances ins = instancesFor(objectSpec);
         final ObjectAdapter object = ins.retrieveObject(oid);
         if (object == null) {
             throw new ObjectNotFoundException(oid);
@@ -336,12 +339,12 @@ public class InMemoryObjectStore impleme
 
     @Override
     public RootOid getOidForService(ObjectSpecification serviceSpec) {
-        return (RootOid) persistedObjects.getService(serviceSpec.getObjectType());
+        return (RootOid) persistedObjects.getService(serviceSpec.getSpecId());
     }
 
     @Override
     public void registerService(final RootOid rootOid) {
-        persistedObjects.registerService(rootOid.getObjectType(), rootOid);
+        persistedObjects.registerService(rootOid.getObjectSpecId(), rootOid);
     }
 
     private ObjectStoreInstances instancesFor(final ObjectSpecification spec) {
@@ -508,6 +511,11 @@ public class InMemoryObjectStore impleme
         return getPersistenceSession();
     }
 
+    protected SpecificationLookup getSpecificationLookup() {
+        return IsisContext.getSpecificationLoader();
+    }
+
+
     /**
      * Downcasts the {@link PersistenceSessionFactory} to
      * {@link InMemoryPersistenceSessionFactory}.
@@ -522,4 +530,5 @@ public class InMemoryObjectStore impleme
         return (InMemoryPersistenceSessionFactory) persistenceSessionFactory;
     }
 
+    
 }

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryPersistenceSessionFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryPersistenceSessionFactory.java?rev=1338472&r1=1338471&r2=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryPersistenceSessionFactory.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryPersistenceSessionFactory.java Mon May 14 22:44:57 2012
@@ -24,8 +24,9 @@ import org.apache.isis.runtimes.dflt.obj
 import org.apache.isis.runtimes.dflt.objectstores.dflt.internal.ObjectStorePersistedObjectsDefault;
 import org.apache.isis.runtimes.dflt.runtime.persistence.PersistenceSessionFactoryDelegate;
 import org.apache.isis.runtimes.dflt.runtime.persistence.PersistenceSessionFactoryDelegating;
-import org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.serial.RootOidGenerator;
 import org.apache.isis.runtimes.dflt.runtime.system.DeploymentType;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.IdentifierGenerator;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.IdentifierGeneratorDefault;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.OidGenerator;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
 
@@ -46,9 +47,10 @@ public class InMemoryPersistenceSessionF
         final PersistenceSession persistenceSession = super.createPersistenceSession();
         if (persistedObjects != null) {
             final OidGenerator oidGenerator = persistenceSession.getOidGenerator();
-            if (oidGenerator instanceof RootOidGenerator) {
-                final RootOidGenerator rootOidGenerator = (RootOidGenerator) oidGenerator;
-                rootOidGenerator.resetTo(persistedObjects.getOidGeneratorMemento());
+            final IdentifierGenerator identifierGenerator = oidGenerator.getIdentifierGenerator();
+            if (identifierGenerator instanceof IdentifierGeneratorDefault) {
+                final IdentifierGeneratorDefault identifierGeneratorDefault = (IdentifierGeneratorDefault) identifierGenerator;
+                identifierGeneratorDefault.resetTo(persistedObjects.getOidGeneratorMemento());
             }
         }
 
@@ -69,9 +71,10 @@ public class InMemoryPersistenceSessionF
      */
     public void attach(final PersistenceSession persistenceSession, final ObjectStorePersistedObjects persistedObjects) {
         final OidGenerator oidGenerator = persistenceSession.getOidGenerator();
-        if (oidGenerator instanceof RootOidGenerator) {
-            final RootOidGenerator rootOidGenerator = (RootOidGenerator) oidGenerator;
-            persistedObjects.saveOidGeneratorMemento(rootOidGenerator.getMemento());
+        final IdentifierGenerator identifierGenerator = oidGenerator.getIdentifierGenerator();
+        if (identifierGenerator instanceof IdentifierGeneratorDefault) {
+            final IdentifierGeneratorDefault identifierGeneratorDefault = (IdentifierGeneratorDefault) identifierGenerator;
+            persistedObjects.saveOidGeneratorMemento(identifierGeneratorDefault.getMemento());
         }
         this.persistedObjects = persistedObjects;
     }

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjects.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjects.java?rev=1338472&r1=1338471&r2=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjects.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjects.java Mon May 14 22:44:57 2012
@@ -20,8 +20,9 @@
 package org.apache.isis.runtimes.dflt.objectstores.dflt.internal;
 
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.serial.RootOidGenerator.Memento;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.IdentifierGeneratorDefault;
 
 /**
  * Represents the persisted objects.
@@ -30,13 +31,13 @@ import org.apache.isis.runtimes.dflt.run
  */
 public interface ObjectStorePersistedObjects {
 
-    public Memento getOidGeneratorMemento();
+    public IdentifierGeneratorDefault.Memento getOidGeneratorMemento();
 
-    public void saveOidGeneratorMemento(Memento memento);
+    public void saveOidGeneratorMemento(IdentifierGeneratorDefault.Memento memento);
 
-    public void registerService(String name, Oid oid);
+    public void registerService(ObjectSpecId objectSpecId, Oid oid);
 
-    public Oid getService(String name);
+    public Oid getService(ObjectSpecId objectSpecId);
 
     public Iterable<ObjectSpecification> specifications();
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault.java?rev=1338472&r1=1338471&r2=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault.java Mon May 14 22:44:57 2012
@@ -22,10 +22,13 @@ package org.apache.isis.runtimes.dflt.ob
 import java.util.HashMap;
 import java.util.Map;
 
+import com.google.common.collect.Maps;
+
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.serial.RootOidGenerator.Memento;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.IdentifierGeneratorDefault;
 
 /**
  * Represents the persisted objects.
@@ -34,40 +37,36 @@ import org.apache.isis.runtimes.dflt.run
  */
 public class ObjectStorePersistedObjectsDefault implements ObjectStorePersistedObjects {
 
-    private final Map<ObjectSpecification, ObjectStoreInstances> instancesBySpecMap;
-    private final Map<String, Oid> serviceOidByIdMap;
+    private final Map<ObjectSpecification, ObjectStoreInstances> instancesBySpecMap = Maps.newHashMap();
+    private final Map<ObjectSpecId, Oid> serviceOidByIdMap = Maps.newHashMap();
 
-    private Memento oidGeneratorMemento;
+    private IdentifierGeneratorDefault.Memento oidGeneratorMemento;
 
-    public ObjectStorePersistedObjectsDefault() {
-        instancesBySpecMap = new HashMap<ObjectSpecification, ObjectStoreInstances>();
-        serviceOidByIdMap = new HashMap<String, Oid>();
-    }
 
     @Override
-    public Memento getOidGeneratorMemento() {
+    public IdentifierGeneratorDefault.Memento getOidGeneratorMemento() {
         return oidGeneratorMemento;
     }
 
     @Override
-    public void saveOidGeneratorMemento(final Memento memento) {
+    public void saveOidGeneratorMemento(final IdentifierGeneratorDefault.Memento memento) {
         this.oidGeneratorMemento = memento;
     }
 
     @Override
-    public Oid getService(final String name) {
-        return serviceOidByIdMap.get(name);
+    public Oid getService(final ObjectSpecId objectSpecId) {
+        return serviceOidByIdMap.get(objectSpecId);
     }
 
     @Override
-    public void registerService(final String name, final Oid oid) {
-        final Oid oidLookedUpByName = serviceOidByIdMap.get(name);
+    public void registerService(final ObjectSpecId objectSpecId, final Oid oid) {
+        final Oid oidLookedUpByName = serviceOidByIdMap.get(objectSpecId);
         if (oidLookedUpByName != null) {
             if (oidLookedUpByName.equals(oid)) {
-                throw new IsisException("Already another service registered as name: " + name + " (existing Oid: " + oidLookedUpByName + ", " + "intended: " + oid + ")");
+                throw new IsisException("Already another service registered as name: " + objectSpecId + " (existing Oid: " + oidLookedUpByName + ", " + "intended: " + oid + ")");
             }
         } else {
-            serviceOidByIdMap.put(name, oid);
+            serviceOidByIdMap.put(objectSpecId, oid);
         }
     }
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault_savesOidGeneratorAsMemento.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault_savesOidGeneratorAsMemento.java?rev=1338472&r1=1338471&r2=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault_savesOidGeneratorAsMemento.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault_savesOidGeneratorAsMemento.java Mon May 14 22:44:57 2012
@@ -29,8 +29,7 @@ import org.jmock.lib.legacy.ClassImposte
 import org.junit.Before;
 import org.junit.Test;
 
-import org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.serial.RootOidGenerator;
-import org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.serial.RootOidGenerator.Memento;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.IdentifierGeneratorDefault;
 
 public class ObjectStorePersistedObjectsDefault_savesOidGeneratorAsMemento {
 
@@ -42,24 +41,24 @@ public class ObjectStorePersistedObjects
         }
     };
 
-    private RootOidGenerator.Memento mockMemento;
+    private IdentifierGeneratorDefault.Memento mockMemento;
 
     @Before
     public void setUp() throws Exception {
         persistedObjects = new ObjectStorePersistedObjectsDefault();
-        mockMemento = context.mock(RootOidGenerator.Memento.class);
+        mockMemento = context.mock(IdentifierGeneratorDefault.Memento.class);
     }
 
     @Test
     public void noOidGeneratorInitially() throws Exception {
-        final Memento oidGeneratorMemento = persistedObjects.getOidGeneratorMemento();
+        final IdentifierGeneratorDefault.Memento oidGeneratorMemento = persistedObjects.getOidGeneratorMemento();
         assertThat(oidGeneratorMemento, is(nullValue()));
     }
 
     @Test
     public void oidGeneratorStoredOnceSaved() throws Exception {
         persistedObjects.saveOidGeneratorMemento(mockMemento);
-        final Memento oidGeneratorMemento = persistedObjects.getOidGeneratorMemento();
+        final IdentifierGeneratorDefault.Memento oidGeneratorMemento = persistedObjects.getOidGeneratorMemento();
         assertThat(oidGeneratorMemento, is(mockMemento));
     }
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault_services.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault_services.java?rev=1338472&r1=1338471&r2=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault_services.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/internal/ObjectStorePersistedObjectsDefault_services.java Mon May 14 22:44:57 2012
@@ -24,50 +24,56 @@ import static org.hamcrest.Matchers.null
 import static org.junit.Assert.assertThat;
 
 import org.jmock.Mockery;
+import org.jmock.auto.Mock;
 import org.jmock.integration.junit4.JMock;
 import org.jmock.integration.junit4.JUnit4Mockery;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
+import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2;
+import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2.Mode;
 
-@RunWith(JMock.class)
 public class ObjectStorePersistedObjectsDefault_services {
 
-    private final Mockery context = new JUnit4Mockery();
+    @Rule
+    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
 
+    @Mock
+    private Oid mockOidForFooService;
+    @Mock
+    private Oid mockOidForBarService;
+    
     private ObjectStorePersistedObjectsDefault persistedObjects;
 
-    private Oid mockOidForFooService, mockOidForBarService;
-
     @Before
     public void setUp() throws Exception {
         persistedObjects = new ObjectStorePersistedObjectsDefault();
-        mockOidForFooService = context.mock(Oid.class, "fooServiceOid");
-        mockOidForBarService = context.mock(Oid.class, "barServiceOid");
     }
 
     @Test
     public void noServicesInitially() throws Exception {
-        final Oid service = persistedObjects.getService("fooService");
+        final Oid service = persistedObjects.getService(ObjectSpecId.of("fooService"));
         assertThat(service, is(nullValue()));
     }
 
     @Test
     public void registerServicesMakesAvailable() throws Exception {
-        persistedObjects.registerService("fooService", mockOidForFooService);
+        persistedObjects.registerService(ObjectSpecId.of("fooService"), mockOidForFooService);
 
-        final Oid service = persistedObjects.getService("fooService");
+        final Oid service = persistedObjects.getService(ObjectSpecId.of("fooService"));
         assertThat(service, is(mockOidForFooService));
     }
 
     @Test
     public void registerServicesWhenMoreThanOnePullsOutTheCorrectOne() throws Exception {
-        persistedObjects.registerService("fooService", mockOidForFooService);
-        persistedObjects.registerService("barService", mockOidForBarService);
+        persistedObjects.registerService(ObjectSpecId.of("fooService"), mockOidForFooService);
+        persistedObjects.registerService(ObjectSpecId.of("barService"), mockOidForBarService);
 
-        final Oid service = persistedObjects.getService("fooService");
+        final Oid service = persistedObjects.getService(ObjectSpecId.of("fooService"));
         assertThat(service, is(mockOidForFooService));
     }
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/JpaDiscriminatorValueAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/JpaDiscriminatorValueAnnotationFacetFactory.java?rev=1338472&r1=1338471&r2=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/JpaDiscriminatorValueAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/JpaDiscriminatorValueAnnotationFacetFactory.java Mon May 14 22:44:57 2012
@@ -44,7 +44,7 @@ public class JpaDiscriminatorValueAnnota
         }
         final String annotationValueAttribute = annotation.value();
 
-        FacetUtil.addFacet(new ObjectTypeFacetInferredFromJpaDiscriminatorValueAnnotation(
+        FacetUtil.addFacet(new ObjectSpecIdFacetInferredFromJpaDiscriminatorValueAnnotation(
                 annotationValueAttribute, processClassContext.getFacetHolder()));
     }
 

Copied: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJpaDiscriminatorValueAnnotation.java (from r1331799, incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/ObjectTypeFacetInferredFromJpaDiscriminatorValueAnnotation.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJpaDiscriminatorValueAnnotation.java?p2=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJpaDiscriminatorValueAnnotation.java&p1=incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/ObjectTypeFacetInferredFromJpaDiscriminatorValueAnnotation.java&r1=1331799&r2=1338472&rev=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/ObjectTypeFacetInferredFromJpaDiscriminatorValueAnnotation.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJpaDiscriminatorValueAnnotation.java Mon May 14 22:44:57 2012
@@ -19,13 +19,13 @@
 package org.apache.isis.extensions.jpa.metamodel.facets.object.discriminator;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.progmodel.facets.object.objecttype.ObjectTypeFacetAbstract;
+import org.apache.isis.core.progmodel.facets.object.objecttype.ObjectSpecIdFacetAbstract;
 
 
-public class ObjectTypeFacetInferredFromJpaDiscriminatorValueAnnotation extends
-        ObjectTypeFacetAbstract {
+public class ObjectSpecIdFacetInferredFromJpaDiscriminatorValueAnnotation extends
+        ObjectSpecIdFacetAbstract {
 
-    public ObjectTypeFacetInferredFromJpaDiscriminatorValueAnnotation(final String value,
+    public ObjectSpecIdFacetInferredFromJpaDiscriminatorValueAnnotation(final String value,
             final FacetHolder holder) {
         super(value, holder);
     }

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/specloader/validator/JpaMetaModelValidator.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/specloader/validator/JpaMetaModelValidator.java?rev=1338472&r1=1338471&r2=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/specloader/validator/JpaMetaModelValidator.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/main/java/org/apache/isis/extensions/jpa/metamodel/specloader/validator/JpaMetaModelValidator.java Mon May 14 22:44:57 2012
@@ -20,7 +20,7 @@ package org.apache.isis.extensions.jpa.m
 
 import java.text.MessageFormat;
 
-import org.apache.isis.core.metamodel.facets.object.objecttype.ObjectTypeFacet;
+import org.apache.isis.core.metamodel.facets.object.objecttype.ObjectSpecIdFacet;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelInvalidException;
@@ -95,7 +95,7 @@ public class JpaMetaModelValidator exten
         if (!objSpec.containsFacet(JpaEntityFacet.class)) {
             return;
         }
-        if (objSpec.isAbstract() || objSpec.containsFacet(ObjectTypeFacet.class)) {
+        if (objSpec.isAbstract() || objSpec.containsFacet(ObjectSpecIdFacet.class)) {
             return;
         }
         final String classFullName = objSpec.getFullIdentifier();

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/test/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/GivenJpaDiscriminatorValueAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/test/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/GivenJpaDiscriminatorValueAnnotationFacetFactoryTest.java?rev=1338472&r1=1338471&r2=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/test/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/GivenJpaDiscriminatorValueAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-metamodel/src/test/java/org/apache/isis/extensions/jpa/metamodel/facets/object/discriminator/GivenJpaDiscriminatorValueAnnotationFacetFactoryTest.java Mon May 14 22:44:57 2012
@@ -28,7 +28,8 @@ import junit.framework.Assert;
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
 import org.apache.isis.core.metamodel.facets.FacetFactory;
-import org.apache.isis.core.metamodel.facets.object.objecttype.ObjectTypeFacet;
+import org.apache.isis.core.metamodel.facets.object.objecttype.ObjectSpecIdFacet;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
 
 public class GivenJpaDiscriminatorValueAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
@@ -64,9 +65,9 @@ public class GivenJpaDiscriminatorValueA
 
         facetFactory.process(new FacetFactory.ProcessClassContext(Customer.class, methodRemover, facetHolder));
 
-        final Facet facet = facetHolder.getFacet(ObjectTypeFacet.class);
+        final Facet facet = facetHolder.getFacet(ObjectSpecIdFacet.class);
         assertNotNull(facet);
-        Assert.assertTrue(facet instanceof ObjectTypeFacetInferredFromJpaDiscriminatorValueAnnotation);
+        Assert.assertTrue(facet instanceof ObjectSpecIdFacetInferredFromJpaDiscriminatorValueAnnotation);
     }
 
     public void testIfNoEntityAnnotationThenNoFacet() {
@@ -76,7 +77,7 @@ public class GivenJpaDiscriminatorValueA
 
         facetFactory.process(new FacetFactory.ProcessClassContext(Customer.class, methodRemover, facetHolder));
 
-        final Facet facet = facetHolder.getFacet(ObjectTypeFacet.class);
+        final Facet facet = facetHolder.getFacet(ObjectSpecIdFacet.class);
         assertNull(facet);
     }
 
@@ -87,8 +88,8 @@ public class GivenJpaDiscriminatorValueA
 
         facetFactory.process(new FacetFactory.ProcessClassContext(Customer.class, methodRemover, facetHolder));
 
-        final ObjectTypeFacet discriminatorValueFacet = facetHolder.getFacet(ObjectTypeFacet.class);
-        assertEquals("CUS", discriminatorValueFacet.value());
+        final ObjectSpecIdFacet discriminatorValueFacet = facetHolder.getFacet(ObjectSpecIdFacet.class);
+        assertEquals(ObjectSpecId.of("CUS"), discriminatorValueFacet.value());
     }
 
     public void testNoMethodsRemoved() {

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlCommandContext.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlCommandContext.java?rev=1338472&r1=1338471&r2=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlCommandContext.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlCommandContext.java Mon May 14 22:44:57 2012
@@ -19,16 +19,16 @@
 
 package org.apache.isis.runtimes.dflt.objectstores.nosql;
 
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 import org.apache.isis.runtimes.dflt.objectstores.nosql.db.StateWriter;
 import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.PersistenceCommandContext;
 
 public interface NoSqlCommandContext extends PersistenceCommandContext {
 
-    StateWriter createStateWriter(String specName);
+    StateWriter createStateWriter(ObjectSpecId objectSpecId);
 
     void insert(StateWriter writer);
-
     void update(StateWriter writer);
 
-    void delete(String specificationName, String key, String version);
+    void delete(ObjectSpecId objectSpecId, String key, String version);
 }

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlCreateObjectCommand.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlCreateObjectCommand.java?rev=1338472&r1=1338471&r2=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlCreateObjectCommand.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlCreateObjectCommand.java Mon May 14 22:44:57 2012
@@ -20,14 +20,13 @@ package org.apache.isis.runtimes.dflt.ob
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.runtimes.dflt.objectstores.nosql.encryption.DataEncryption;
-import org.apache.isis.runtimes.dflt.objectstores.nosql.keys.KeyCreator;
 import org.apache.isis.runtimes.dflt.objectstores.nosql.versions.VersionCreator;
 import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.CreateObjectCommand;
 
 final class NoSqlCreateObjectCommand extends WriteObjectCommand implements CreateObjectCommand {
 
-    public NoSqlCreateObjectCommand(final KeyCreator keyCreator, final VersionCreator versionCreator, final DataEncryption dataEncrypter, final ObjectAdapter object) {
-        super(false, keyCreator, versionCreator, dataEncrypter, object);
+    public NoSqlCreateObjectCommand(final VersionCreator versionCreator, final DataEncryption dataEncrypter, final ObjectAdapter object) {
+        super(Mode.NON_UPDATE, versionCreator, dataEncrypter, object);
     }
 
 }

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlDestroyObjectCommand.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlDestroyObjectCommand.java?rev=1338472&r1=1338471&r2=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlDestroyObjectCommand.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlDestroyObjectCommand.java Mon May 14 22:44:57 2012
@@ -21,30 +21,33 @@ package org.apache.isis.runtimes.dflt.ob
 
 import org.apache.isis.core.commons.lang.ToString;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.runtimes.dflt.objectstores.nosql.keys.KeyCreator;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.runtimes.dflt.objectstores.nosql.keys.KeyCreatorDefault;
 import org.apache.isis.runtimes.dflt.objectstores.nosql.versions.VersionCreator;
 import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.DestroyObjectCommand;
 import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.PersistenceCommandContext;
 
 final class NoSqlDestroyObjectCommand implements DestroyObjectCommand {
+    
+    private final KeyCreatorDefault keyCreator = new KeyCreatorDefault();
+    
     private final ObjectAdapter adapter;
-    private final KeyCreator keyCreator;
     private final VersionCreator versionCreator;
 
-    public NoSqlDestroyObjectCommand(final KeyCreator keyCreator, final VersionCreator versionCreator, final ObjectAdapter adapter) {
-        this.keyCreator = keyCreator;
+    public NoSqlDestroyObjectCommand(final VersionCreator versionCreator, final ObjectAdapter adapter) {
         this.versionCreator = versionCreator;
         this.adapter = adapter;
     }
 
     @Override
     public void execute(final PersistenceCommandContext context) {
-        final String key = keyCreator.key(adapter.getOid());
+        final String key = keyCreator.getIdentifierForPersistentRoot(adapter.getOid());
         final String version = versionCreator.versionString(adapter.getVersion());
-        final String specificationName = adapter.getSpecification().getFullIdentifier();
+        final ObjectSpecification objectSpec = adapter.getSpecification();
+        //final String specificationName = objectSpec.getFullIdentifier();
 
         final NoSqlCommandContext noSqlCommandContext = (NoSqlCommandContext) context;
-        noSqlCommandContext.delete(specificationName, key, version);
+        noSqlCommandContext.delete(objectSpec.getSpecId(), key, version);
     }
 
     @Override

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlIdentifierGenerator.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlIdentifierGenerator.java?rev=1338472&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlIdentifierGenerator.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlIdentifierGenerator.java Mon May 14 22:44:57 2012
@@ -0,0 +1,129 @@
+package org.apache.isis.runtimes.dflt.objectstores.nosql;
+
+import org.apache.log4j.Logger;
+
+import org.apache.isis.core.commons.debug.DebugBuilder;
+import org.apache.isis.core.commons.ensure.Assert;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.oid.RootOid;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
+import org.apache.isis.runtimes.dflt.objectstores.nosql.db.NoSqlDataDatabase;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.IdentifierGenerator;
+
+public class NoSqlIdentifierGenerator implements IdentifierGenerator {
+    
+    private static int INITIAL_TRANSIENT_ID = -9999999;
+    private static int DEFAULT_BATCH_SIZE = 50;
+
+    private final NoSqlDataDatabase database;
+    private final IdNumbers ids;
+
+    
+    //////////////////////////////////////////////////////////////////
+    // constructor
+    //////////////////////////////////////////////////////////////////
+
+    public NoSqlIdentifierGenerator(final NoSqlDataDatabase database) {
+        this(database, INITIAL_TRANSIENT_ID, DEFAULT_BATCH_SIZE);
+    }
+
+    public NoSqlIdentifierGenerator(final NoSqlDataDatabase database, final int initialTransientId, final int batchSize) {
+        this.database = database;
+        ids = new IdNumbers(initialTransientId, batchSize);
+    }
+
+    
+    //////////////////////////////////////////////////////////////////
+    // API
+    //////////////////////////////////////////////////////////////////
+
+    @Override
+    public String createTransientIdentifierFor(ObjectSpecId objectSpecId, Object pojo) {
+        final String identifier = "" + ids.nextTransientId();
+        return identifier;
+    }
+
+    @Override
+    public String createAggregateLocalId(ObjectSpecId objectSpecId, final Object pojo, final ObjectAdapter parentAdapter) {
+        Assert.assertNotNull("No connection set up", database);
+        return Long.toHexString(ids.nextSubId(database));
+    }
+
+    @Override
+    public String createPersistentIdentifierFor(ObjectSpecId objectSpecId, Object pojo, RootOid transientRootOid) {
+        return "" + ids.nextPersistentId(database);
+    }
+
+    
+    //////////////////////////////////////////////////////////////////
+    // debug
+    //////////////////////////////////////////////////////////////////
+    
+    @Override
+    public void debugData(final DebugBuilder debug) {
+        debug.appendln(this.toString());
+        debug.indent();
+        ids.debugData(debug);
+        debug.unindent();
+    }
+
+    @Override
+    public String debugTitle() {
+        return "NoSql OID Generator";
+    }
+}
+
+class IdNumbers {
+
+    private static final Logger LOG = Logger.getLogger(IdNumbers.class);
+
+    private final int batchSize;
+    
+    private long transientNumber;
+    private long nextId = 0;
+    private long newIdBatchAt = 0;
+    private long nextSubId = 0;
+    private long newSubIdBatchAt = 0;
+    
+    public IdNumbers(final int initialTransientId, final int batchSize) {
+        transientNumber = initialTransientId;
+        this.batchSize = batchSize;
+    }
+
+    public synchronized long nextTransientId() {
+        return transientNumber++;
+    }
+
+    public synchronized long nextSubId(final NoSqlDataDatabase connectionPool) {
+        if (nextSubId > newSubIdBatchAt) {
+            final String message = "ID exception, last id (" + nextSubId + ") past new batch boundary (" + newSubIdBatchAt + ")";
+            throw new NoSqlStoreException(message);
+        }
+        if (nextSubId == newSubIdBatchAt) {
+            nextSubId = connectionPool.nextSerialNumberBatch(ObjectSpecId.of("_sub-id"), batchSize);
+            newSubIdBatchAt = nextSubId + batchSize;
+            LOG.debug("New Sub-ID batch created, from " + nextSubId + " to " + newSubIdBatchAt);
+        }
+        return nextSubId++;
+    }
+
+    public synchronized long nextPersistentId(final NoSqlDataDatabase connectionPool) {
+        if (nextId > newIdBatchAt) {
+            final String message = "ID exception, last id (" + nextId + ") past new batch boundary (" + newIdBatchAt + ")";
+            throw new NoSqlStoreException(message);
+        }
+        if (nextId == newIdBatchAt) {
+            nextId = connectionPool.nextSerialNumberBatch(ObjectSpecId.of("_id"), batchSize);
+            newIdBatchAt = nextId + batchSize;
+            LOG.debug("New ID batch created, from " + nextId + " to " + newIdBatchAt);
+        }
+        return nextId++;
+    }
+
+    public void debugData(final DebugBuilder debug) {
+        debug.appendln("id", nextId);
+        debug.appendln("sub-id", nextSubId);
+        debug.appendln("transient id", transientNumber);
+    }
+}
+

Propchange: incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlIdentifierGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/isis/trunk/framework/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/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlObjectStore.java?rev=1338472&r1=1338471&r2=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlObjectStore.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlObjectStore.java Mon May 14 22:44:57 2012
@@ -31,12 +31,15 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.adapter.oid.AggregatedOid;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
 import org.apache.isis.core.metamodel.adapter.oid.RootOid;
+import org.apache.isis.core.metamodel.adapter.oid.TypedOid;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.SpecificationLookup;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
 import org.apache.isis.runtimes.dflt.objectstores.nosql.db.NoSqlDataDatabase;
 import org.apache.isis.runtimes.dflt.objectstores.nosql.db.StateReader;
 import org.apache.isis.runtimes.dflt.objectstores.nosql.encryption.DataEncryption;
-import org.apache.isis.runtimes.dflt.objectstores.nosql.keys.KeyCreator;
+import org.apache.isis.runtimes.dflt.objectstores.nosql.keys.KeyCreatorDefault;
 import org.apache.isis.runtimes.dflt.objectstores.nosql.versions.VersionCreator;
 import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.ObjectStore;
 import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.CreateObjectCommand;
@@ -46,26 +49,27 @@ import org.apache.isis.runtimes.dflt.run
 import org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryBuiltIn;
 import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.AdapterManager;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.IdentifierGenerator;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.OidGenerator;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceQuery;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
 
 public class NoSqlObjectStore implements ObjectStore {
     
+    private final KeyCreatorDefault keyCreator = new KeyCreatorDefault();
+    private final Map<ObjectSpecId, RootOid> servicesByObjectSpecId = Maps.newHashMap();
+    
     private final NoSqlDataDatabase database;
-    private final Map<String, RootOid> servicesByObjectType = Maps.newHashMap();
-    private final KeyCreator keyCreator;
     private final VersionCreator versionCreator;
     private final ObjectReader objectReader = new ObjectReader();
-    private final NoSqlOidGenerator oidGenerator;
+    private final OidGenerator oidGenerator;
     private final DataEncryption wrtingDataEncrypter;
     private final Map<String, DataEncryption> availableDataEncrypters;
     private final boolean isDataLoaded;
 
-    public NoSqlObjectStore(final NoSqlDataDatabase db, final NoSqlOidGenerator oidGenerator, final KeyCreator keyCreator, final VersionCreator versionCreator, final DataEncryption writingDataEncrypter, final Map<String, DataEncryption> availableDataEncrypters) {
+    public NoSqlObjectStore(final NoSqlDataDatabase db, final OidGenerator oidGenerator, final VersionCreator versionCreator, final DataEncryption writingDataEncrypter, final Map<String, DataEncryption> availableDataEncrypters) {
         this.database = db;
         this.oidGenerator = oidGenerator;
-        this.keyCreator = keyCreator;
         this.versionCreator = versionCreator;
         this.wrtingDataEncrypter = writingDataEncrypter;
         this.availableDataEncrypters = availableDataEncrypters;
@@ -75,8 +79,8 @@ public class NoSqlObjectStore implements
         db.close();
     }
 
-    public OidGenerator getOidGenerator() {
-        return oidGenerator;
+    public IdentifierGenerator getIdentifierGenerator() {
+        return oidGenerator.getIdentifierGenerator();
     }
 
     @Override
@@ -88,7 +92,7 @@ public class NoSqlObjectStore implements
             // UnexpectedCallException("Aggregated objects should not be created outside of their owner");
             return null;
         } else {
-            return new NoSqlCreateObjectCommand(keyCreator, versionCreator, wrtingDataEncrypter, object);
+            return new NoSqlCreateObjectCommand(versionCreator, wrtingDataEncrypter, object);
         }
     }
 
@@ -97,19 +101,21 @@ public class NoSqlObjectStore implements
         if (adapter.getSpecification().isParented()) {
             throw new NoSqlStoreException("Can't delete an aggregated object");
         } else {
-            return new NoSqlDestroyObjectCommand(keyCreator, versionCreator, adapter);
+            return new NoSqlDestroyObjectCommand(versionCreator, adapter);
         }
     }
 
     @Override
     public SaveObjectCommand createSaveObjectCommand(final ObjectAdapter adapter) {
-        // TODO should this be done at a higher level so it is applicable for
-        // all OSes
+        
+        // TODO should this be done at a higher level 
+        // so it is applicable for all object stores?
+        
         final ObjectAdapter rootAdapter = adapter.getAggregateRoot();
-        if (rootAdapter.getOid() instanceof AggregatedOid) {
+        if (!(rootAdapter.getOid() instanceof RootOid)) {
             throw new NoSqlStoreException("Unexpected aggregated object to save: " + rootAdapter + " (" + adapter + ")");
         }
-        return new NoSqlSaveObjectCommand(keyCreator, versionCreator, wrtingDataEncrypter, rootAdapter);
+        return new NoSqlSaveObjectCommand(versionCreator, wrtingDataEncrypter, rootAdapter);
     }
 
     @Override
@@ -121,16 +127,17 @@ public class NoSqlObjectStore implements
     public ObjectAdapter[] getInstances(final PersistenceQuery persistenceQuery) {
         final ObjectSpecification specification = persistenceQuery.getSpecification();
         final List<ObjectAdapter> instances = new ArrayList<ObjectAdapter>();
-        instances(persistenceQuery, specification, instances);
+        appendInstances(persistenceQuery, specification, instances);
         return instances.toArray(new ObjectAdapter[instances.size()]);
     }
 
-    private void instances(final PersistenceQuery persistenceQuery, final ObjectSpecification specification, final List<ObjectAdapter> instances) {
-        String specificationName = specification.getFullIdentifier();
-        final Iterator<StateReader> instanceData = database.instancesOf(specificationName);
+    private void appendInstances(final PersistenceQuery persistenceQuery, final ObjectSpecification specification, final List<ObjectAdapter> instances) {
+        
+        final Iterator<StateReader> instanceData = database.instancesOf(specification.getSpecId());
         while (instanceData.hasNext()) {
             final StateReader reader = instanceData.next();
-            final ObjectAdapter instance = objectReader.load(reader, keyCreator, versionCreator, availableDataEncrypters);
+            final ObjectAdapter instance = objectReader.load(reader, versionCreator, availableDataEncrypters);
+            
             // TODO deal with this natively
             if (persistenceQuery instanceof PersistenceQueryBuiltIn) {
                 if (!((PersistenceQueryBuiltIn) persistenceQuery).matches(instance)) {
@@ -140,21 +147,23 @@ public class NoSqlObjectStore implements
             instances.add(instance);
         }
         for (final ObjectSpecification spec : specification.subclasses()) {
-            specificationName = spec.getFullIdentifier();
-            instances(persistenceQuery, spec, instances);
+            appendInstances(persistenceQuery, spec, instances);
         }
     }
 
+
+
     @Override
-    public ObjectAdapter getObject(final Oid oid, final ObjectSpecification hint) {
-        final String key = keyCreator.key(oid);
-        final StateReader reader = database.getInstance(key, hint.getFullIdentifier());
-        return objectReader.load(reader, keyCreator, versionCreator, availableDataEncrypters);
+    public ObjectAdapter getObject(final TypedOid oid) {
+        final String key = keyCreator.getIdentifierForPersistentRoot(oid);
+        final ObjectSpecification objectSpec = getSpecificationLookup().lookupBySpecId(oid.getObjectSpecId());
+        final StateReader reader = database.getInstance(key, objectSpec.getSpecId());
+        return objectReader.load(reader, versionCreator, availableDataEncrypters);
     }
 
     @Override
     public boolean hasInstances(final ObjectSpecification specification) {
-        return database.hasInstances(specification.getFullIdentifier());
+        return database.hasInstances(specification.getSpecId());
     }
 
     @Override
@@ -175,8 +184,8 @@ public class NoSqlObjectStore implements
     }
 
     @Override
-    public void resolveImmediately(final ObjectAdapter object) {
-        final Oid oid = object.getOid();
+    public void resolveImmediately(final ObjectAdapter adapter) {
+        final Oid oid = adapter.getOid();
         ;
         if (oid instanceof AggregatedOid) {
             // throw new
@@ -184,10 +193,10 @@ public class NoSqlObjectStore implements
             // +
             // object);
         } else {
-            final String specificationName = object.getSpecification().getFullIdentifier();
-            final String key = keyCreator.key(oid);
-            final StateReader reader = database.getInstance(key, specificationName);
-            objectReader.update(reader, keyCreator, versionCreator, availableDataEncrypters, object);
+            final ObjectSpecification objectSpec = adapter.getSpecification();
+            final String key = keyCreator.getIdentifierForPersistentRoot(oid);
+            final StateReader reader = database.getInstance(key, objectSpec.getSpecId());
+            objectReader.update(reader, versionCreator, availableDataEncrypters, adapter);
         }
     }
 
@@ -222,22 +231,22 @@ public class NoSqlObjectStore implements
     
     @Override
     public void registerService(final RootOid rootOid) {
-        final String key = keyCreator.key(rootOid);
-        database.addService(rootOid.getObjectType(), key);
+        final String key = keyCreator.getIdentifierForPersistentRoot(rootOid);
+        database.addService(rootOid.getObjectSpecId(), key);
     }
 
     @Override
     public RootOid getOidForService(ObjectSpecification serviceSpec) {
-        final String objectType = serviceSpec.getObjectType();
-        RootOid oid = servicesByObjectType.get(objectType);
+        final ObjectSpecId objectSpecId = serviceSpec.getSpecId();
+        RootOid oid = servicesByObjectSpecId.get(objectSpecId);
         if (oid == null) {
-            final String id = database.getService(objectType);
+            final String id = database.getService(objectSpecId);
             if (id == null) {
                 oid = null;
             } else {
-                oid = keyCreator.oid(serviceSpec, id);
+                oid = keyCreator.createRootOid(serviceSpec, id);
             }
-            servicesByObjectType.put(objectType, oid);
+            servicesByObjectSpecId.put(objectSpecId, oid);
         }
         return oid;
     }
@@ -282,4 +291,8 @@ public class NoSqlObjectStore implements
         return IsisContext.getPersistenceSession();
     }
 
+    protected SpecificationLookup getSpecificationLookup() {
+        return IsisContext.getSpecificationLoader();
+    }
+
 }

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlSaveObjectCommand.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlSaveObjectCommand.java?rev=1338472&r1=1338471&r2=1338472&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlSaveObjectCommand.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/NoSqlSaveObjectCommand.java Mon May 14 22:44:57 2012
@@ -20,14 +20,13 @@ package org.apache.isis.runtimes.dflt.ob
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.runtimes.dflt.objectstores.nosql.encryption.DataEncryption;
-import org.apache.isis.runtimes.dflt.objectstores.nosql.keys.KeyCreator;
 import org.apache.isis.runtimes.dflt.objectstores.nosql.versions.VersionCreator;
 import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.SaveObjectCommand;
 
 final class NoSqlSaveObjectCommand extends WriteObjectCommand implements SaveObjectCommand {
 
-    public NoSqlSaveObjectCommand(final KeyCreator keyCreator, final VersionCreator versionCreator, final DataEncryption dataEncrypter, final ObjectAdapter object) {
-        super(true, keyCreator, versionCreator, dataEncrypter, object);
+    public NoSqlSaveObjectCommand(final VersionCreator versionCreator, final DataEncryption dataEncrypter, final ObjectAdapter object) {
+        super(Mode.UPDATE, versionCreator, dataEncrypter, object);
     }
 
 }



Mime
View raw message