Package com.graphaware.tx.event.improved.api

Examples of com.graphaware.tx.event.improved.api.FilteredTransactionData


                            }
                        })
                        .with(IncludeNoRelationships.getInstance());

                ImprovedTransactionData improvedTransactionData
                        = new FilteredTransactionData(new LazyTransactionData(data), inclusionPolicies);

                //have fun here with improvedTransactionData!

                return null;
            }
View Full Code Here


        createTestDatabase();

        database.registerTransactionEventHandler(new TransactionEventHandler.Adapter<Void>() {
            @Override
            public Void beforeCommit(TransactionData data) throws Exception {
                ImprovedTransactionData improvedTransactionData = new FilteredTransactionData(new LazyTransactionData(data), InclusionPolicies.none());
                assertFalse(improvedTransactionData.mutationsOccurred());
                assertTrue(improvedTransactionData.hasBeenChanged(database.getNodeById(1)));
                assertTrue(improvedTransactionData.changedProperties(database.getNodeById(1)).isEmpty());
                return null;
            }
        });
        new SimpleTransactionExecutor(database).executeInTransaction(new TestGraphMutation());
View Full Code Here

    @Override
    public Map<String, Object> beforeCommit(TransactionDataContainer transactionData) {
        Map<String, Object> result = new HashMap<>();

        for (T module : modules.values()) {
            FilteredTransactionData filteredTransactionData = new FilteredTransactionData(transactionData, module.getConfiguration().getInclusionPolicies());

            if (!filteredTransactionData.mutationsOccurred()) {
                continue;
            }

            Object state = null;
View Full Code Here

        @Override
        public Object beforeCommit(TransactionData data) throws Exception {
            LazyTransactionData lazyTransactionData = new LazyTransactionData(data);

            beforeCommitCallback.doBeforeCommit(new FilteredTransactionData(lazyTransactionData, new InclusionPolicies(
                    new NodeInclusionPolicy() {
                        @Override
                        public boolean include(Node node) {
                            return !node.getProperty("name", "").equals("Four") && !node.hasProperty(INTERNAL_NODE_PROPERTY);
                        }
View Full Code Here

TOP

Related Classes of com.graphaware.tx.event.improved.api.FilteredTransactionData

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.