Package org.apache.isis.core.runtime.system.persistence

Examples of org.apache.isis.core.runtime.system.persistence.IdentifierGeneratorDefault


        final PersistenceSession persistenceSession = super.createPersistenceSession();
        if (persistedObjects != null) {
            final OidGenerator oidGenerator = persistenceSession.getOidGenerator();
            final IdentifierGenerator identifierGenerator = oidGenerator.getIdentifierGenerator();
            if (identifierGenerator instanceof IdentifierGeneratorDefault) {
                final IdentifierGeneratorDefault identifierGeneratorDefault = (IdentifierGeneratorDefault) identifierGenerator;
                identifierGeneratorDefault.resetTo(persistedObjects.getOidGeneratorMemento());
            }
        }

        return persistenceSession;
    }
View Full Code Here


     */
    public void attach(final PersistenceSession persistenceSession, final ObjectStorePersistedObjects persistedObjects) {
        final OidGenerator oidGenerator = persistenceSession.getOidGenerator();
        final IdentifierGenerator identifierGenerator = oidGenerator.getIdentifierGenerator();
        if (identifierGenerator instanceof IdentifierGeneratorDefault) {
            final IdentifierGeneratorDefault identifierGeneratorDefault = (IdentifierGeneratorDefault) identifierGenerator;
            persistedObjects.saveOidGeneratorMemento(identifierGeneratorDefault.getMemento());
        }
        this.persistedObjects = persistedObjects;
    }
View Full Code Here

        servicesInjector = new ServicesInjectorDefault();
        servicesInjector.setContainer(container);

        adapterManager = new AdapterManagerDefault(new PojoRecreatorDefault());
        adapterFactory = new PojoAdapterFactory();
        persistenceSession = new PersistenceSession(mockPersistenceSessionFactory, adapterFactory, objectFactory, servicesInjector, new OidGenerator(new IdentifierGeneratorDefault()), adapterManager, mockPersistAlgorithm, mockObjectStore) {
            @Override
            protected SpecificationLoaderSpi getSpecificationLoader() {
                return isisMetaModel.getSpecificationLoader();
            }
           
View Full Code Here

     *
     * <p>
     * By default, returns {@link IdentifierGeneratorDefault}.
     */
    public IdentifierGenerator createIdentifierGenerator(final IsisConfiguration configuration) {
        return new IdentifierGeneratorDefault();
    }
View Full Code Here

        servicesInjector = new ServicesInjectorDefault();
        servicesInjector.setContainer(container);

        adapterManager = new AdapterManagerDefault(new PojoRecreatorDefault());
        adapterFactory = new PojoAdapterFactory();
        persistenceSession = new PersistenceSession(mockPersistenceSessionFactory, adapterFactory, objectFactory, servicesInjector, new OidGenerator(new IdentifierGeneratorDefault()), adapterManager, mockPersistAlgorithm, mockObjectStore) {
            @Override
            protected SpecificationLoaderSpi getSpecificationLoader() {
                return isisMetaModel.getSpecificationLoader();
            }
           
View Full Code Here

    }

    @Override
    public IdentifierGenerator createIdentifierGenerator(final IsisConfiguration configuration) {
        final long currentTime = new Date().getTime();
        return new IdentifierGeneratorDefault(currentTime);
    }
View Full Code Here

    public PersistenceSession createPersistenceSession() {
        final PersistenceSession persistenceSession = super.createPersistenceSession();
        if (persistedObjects != null) {
            final OidGenerator oidGenerator = persistenceSession.getOidGenerator();
            final IdentifierGenerator identifierGenerator = oidGenerator.getIdentifierGenerator();
            final IdentifierGeneratorDefault identifierGeneratorDefault = identifierGenerator.underlying(IdentifierGeneratorDefault.class);
            if(identifierGeneratorDefault != null) {
                identifierGeneratorDefault.resetTo(persistedObjects.getOidGeneratorMemento());
            }
        }

        return persistenceSession;
    }
View Full Code Here

     */
    public void attach(final PersistenceSession persistenceSession, final ObjectStorePersistedObjects persistedObjects) {
        final OidGenerator oidGenerator = persistenceSession.getOidGenerator();
        final IdentifierGenerator identifierGenerator = oidGenerator.getIdentifierGenerator();

        final IdentifierGeneratorDefault identifierGeneratorDefault = identifierGenerator.underlying(IdentifierGeneratorDefault.class);
        if(identifierGeneratorDefault != null) {
            identifierGeneratorDefault.resetTo(persistedObjects.getOidGeneratorMemento());
            persistedObjects.saveOidGeneratorMemento(identifierGeneratorDefault.getMemento());
        }

        this.persistedObjects = persistedObjects;
    }
View Full Code Here

        servicesInjector = new ServicesInjectorDefault();
        servicesInjector.setContainer(container);

        adapterManager = new AdapterManagerDefault(new PojoRecreatorDefault());
        adapterFactory = new PojoAdapterFactory();
        persistenceSession = new PersistenceSession(mockPersistenceSessionFactory, adapterFactory, objectFactory, servicesInjector, new OidGenerator(new IdentifierGeneratorDefault()), adapterManager, mockPersistAlgorithm, mockObjectStore) {
            @Override
            protected SpecificationLoaderSpi getSpecificationLoader() {
                return isisMetaModel.getSpecificationLoader();
            }
           
View Full Code Here

     *
     * <p>
     * By default, returns {@link IdentifierGeneratorDefault}.
     */
    public IdentifierGenerator createIdentifierGenerator(final IsisConfiguration configuration) {
        return new IdentifierGeneratorDefault();
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.runtime.system.persistence.IdentifierGeneratorDefault

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.