Package org.openengsb.core.edbi.jdbc.operation

Examples of org.openengsb.core.edbi.jdbc.operation.InsertOperation


        List models = new ArrayList<>();

        models.add(new TestModel("A", 42));
        models.add(new TestModel("B", -42));

        InsertOperation operation = new InsertOperation(commit, testIndex, models);

        engine.execute(operation);

        try (ResultSet rs = connection.createStatement().executeQuery("SELECT * FROM HISTORY_TABLE")) {
            assertTrue(rs.next());
View Full Code Here


        List<OpenEngSBModel> list = new ArrayList<>();

        list.add((OpenEngSBModel) testModelA);
        list.add((OpenEngSBModel) testModelB);

        engine.execute(new InsertOperation(commit, testIndex, list));

        testModelB.setTestInteger(43);

        IndexCommit updateCommit = mock(IndexCommit.class);
        when(updateCommit.getTimestamp()).thenReturn(new Date(84));
View Full Code Here

        when(commit.getTimestamp()).thenReturn(new Date(42));

        TestModel testModelA = new TestModel("A", 42);
        TestModel testModelB = new TestModel("B", -42);

        engine.execute(new InsertOperation(commit, testIndex, new ArrayList(Arrays.asList(testModelA, testModelB))));

        IndexCommit deleteCommit = mock(IndexCommit.class);
        when(deleteCommit.getTimestamp()).thenReturn(new Date(84));

        engine.execute(new DeleteOperation(deleteCommit, testIndex, new ArrayList(Arrays.asList(testModelB))));
View Full Code Here

        List models = new ArrayList<>();

        models.add(new TestModel("A", 42));
        models.add(new TestModel("B", -42));

        InsertOperation operation = new InsertOperation(commit, testIndex, models);

        engine.execute(operation);

        String sql = "SELECT * FROM HEAD_TABLE";
        try (ResultSet rs = connection.createStatement().executeQuery(sql)) {
View Full Code Here

        when(commit.getTimestamp()).thenReturn(new Date(42));

        TestModel testModelA = new TestModel("A", 42);
        TestModel testModelB = new TestModel("B", -42);

        engine.execute(new InsertOperation(commit, testIndex, new ArrayList(Arrays.asList(testModelA, testModelB))));

        testModelB.setTestInteger(43);

        IndexCommit updateCommit = mock(IndexCommit.class);
        when(updateCommit.getTimestamp()).thenReturn(new Date(84));
View Full Code Here

        when(commit.getTimestamp()).thenReturn(new Date(42));

        TestModel testModelA = new TestModel("A", 42);
        TestModel testModelB = new TestModel("B", -42);

        engine.execute(new InsertOperation(commit, testIndex, new ArrayList(Arrays.asList(testModelA, testModelB))));

        IndexCommit deleteCommit = mock(IndexCommit.class);
        when(deleteCommit.getTimestamp()).thenReturn(new Date(84));

        engine.execute(new DeleteOperation(deleteCommit, testIndex, new ArrayList(Arrays.asList(testModelB))));
View Full Code Here

    @Test(expected = NoSuchTableException.class)
    public void execute_insert_onNonExistingIndex_throwsException() throws Exception {
        IndexCommit commit = mock(IndexCommit.class);
        when(commit.getTimestamp()).thenReturn(new Date(42));

        engine.execute(new InsertOperation(commit, testIndex, new ArrayList<OpenEngSBModel>()));
    }
View Full Code Here

        execute(operation, new CommitIndexRecordCallback(operation.getCommit(), "INSERT"));
    }

    @Override
    public void execute(UpdateOperation operation) {
        final InsertOperation insert = new InsertOperation(operation);

        execute(insert, new CommitIndexRecordCallback(insert.getCommit(), "UPDATE"));
    }
View Full Code Here

        execute(insert, new CommitIndexRecordCallback(insert.getCommit(), "UPDATE"));
    }

    @Override
    public void execute(DeleteOperation operation) {
        final InsertOperation insert = new InsertOperation(operation);

        execute(insert, new CommitIndexRecordCallback(insert.getCommit(), "DELETE"));
    }
View Full Code Here

        for (Class<?> modelClass : modelClasses) {
            JdbcIndex<?> index = getIndex(modelClass);

            List<OpenEngSBModel> inserts = commit.getInserts().get(modelClass);
            if (!isEmpty(inserts)) {
                schemaMapper.execute(new InsertOperation(commit, index, inserts));
            }

            List<OpenEngSBModel> updates = commit.getUpdates().get(modelClass);
            if (!isEmpty(updates)) {
                schemaMapper.execute(new UpdateOperation(commit, index, updates));
View Full Code Here

TOP

Related Classes of org.openengsb.core.edbi.jdbc.operation.InsertOperation

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.