Package org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.SaveObjectCommand


        assertFalse(objectStore.hasInstances(spec));
    }

    @Test
    public void validatesSaveObjectCommand() throws Exception {
        final SaveObjectCommand command = objectStore.createSaveObjectCommand(adapter);
        command.execute(transaction);
        assertTrue(objectStore.hasInstances(spec));
    }
View Full Code Here


        assertTrue(objectStore.hasInstances(spec));
    }

    @Test
    public void validatesGettingObjectStoreInstances() throws Exception {
        final SaveObjectCommand command = objectStore.createSaveObjectCommand(adapter);
        objectStore.execute(Collections.<PersistenceCommand> singletonList(command));
        final ObjectAdapter[] array = objectStore.getInstances(persistenceHelper);
        assertTrue(array.length == 1);
    }
View Full Code Here

        assertTrue(objectStore.name().equals("XML"));
    }

    @Test
    public void validatesObjectStoreHasInstances() throws Exception {
        final SaveObjectCommand command = objectStore.createSaveObjectCommand(adapter);
        objectStore.execute(Collections.<PersistenceCommand> singletonList(command));
        assertTrue(objectStore.hasInstances(spec));
    }
View Full Code Here

        assertTrue(objectStore.hasInstances(spec));
    }

    @Test
    public void validatesObjectStoreIfFixtureIsInstalled() throws Exception {
        final SaveObjectCommand command = objectStore.createSaveObjectCommand(adapter);
        objectStore.execute(Collections.<PersistenceCommand> singletonList(command));
        objectStore.open();
        assertTrue(objectStore.isFixturesInstalled());
    }
View Full Code Here

        assertTrue(objectStore.isFixturesInstalled());
    }

    @Test
    public void validatesObjectStoreGetObject() throws Exception {
        final SaveObjectCommand command = objectStore.createSaveObjectCommand(adapter);
        objectStore.execute(Collections.<PersistenceCommand> singletonList(command));
        assertTrue(objectStore.getObject(adapter.getOid(), adapter.getSpecification()).getOid().equals(adapter.getOid()));
    }
View Full Code Here

                CallbackUtils.callCallback(adapter, UpdatingCallbackFacet.class);
            }

            @Override
            public void execute() {
                final SaveObjectCommand saveObjectCommand = objectStore.createSaveObjectCommand(adapter);
                getTransactionManager().addCommand(saveObjectCommand);
            }

            @Override
            public void onSuccess() {
View Full Code Here

    }

    @Override
    public SaveObjectCommand createSaveObjectCommand(final ObjectAdapter object) {
        actions.addElement("saveObject " + object);
        return new SaveObjectCommand() {

            @Override
            public void execute(final PersistenceCommandContext context) throws ObjectPersistenceException {
            }
View Full Code Here

        };
    }

    @Override
    public SaveObjectCommand createSaveObjectCommand(final ObjectAdapter object) {
        return new SaveObjectCommand() {
            @Override
            public void execute(final PersistenceCommandContext context) {
                final DatabaseConnector connection = ((SqlExecutionContext) context).getConnection();
                LOG.debug("  save object " + object);
                if (object.getSpecification().isCollectionOrIsAggregated()) {
View Full Code Here

        };
    }

    @Override
    public SaveObjectCommand createSaveObjectCommand(final ObjectAdapter object) {
        return new SaveObjectCommand() {
            @Override
            public void execute(final PersistenceCommandContext context) {
                final DatabaseConnector connection = ((SqlExecutionContext) context).getConnection();
                LOG.debug("  save object " + object);
                if (object.getSpecification().isCollectionOrIsAggregated()) {
View Full Code Here

        assertFalse(objectStore.hasInstances(spec));
    }

    @Test
    public void validatesSaveObjectCommand() throws Exception {
        final SaveObjectCommand command = objectStore.createSaveObjectCommand(adapter);
        command.execute(transaction);
        assertTrue(objectStore.hasInstances(spec));
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.SaveObjectCommand

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.