Package com.mysema.query.sql.dml

Examples of com.mysema.query.sql.dml.SQLMergeClause


        return new SQLInsertClause(connection.get(), configuration, path);
    }

    @Override
    public final SQLMergeClause merge(RelationalPath<?> path) {
        return new SQLMergeClause(connection.get(), configuration, path);
    }
View Full Code Here


        sqlDeleteClause.addListener(new TestLoggingListener());
        return sqlDeleteClause;
    }

    protected SQLMergeClause merge(RelationalPath<?> e) {
        SQLMergeClause sqlMergeClause = new SQLMergeClause(connection, configuration, e);
        sqlMergeClause.addListener(new TestLoggingListener());
        return sqlMergeClause;
    }
View Full Code Here

    }

    @Test
    @IncludeIn(H2)
    public void MergeBatch() {
        SQLMergeClause merge = merge(survey)
            .keys(survey.id)
            .set(survey.id, 5)
            .set(survey.name, "5")
            .addBatch();

        merge
            .keys(survey.id)
            .set(survey.id, 6)
            .set(survey.name, "6")
            .addBatch();

        assertEquals(2, merge.execute());

        assertEquals(1l, query().from(survey).where(survey.name.eq("5")).count());
        assertEquals(1l, query().from(survey).where(survey.name.eq("6")).count());
    }
View Full Code Here

    }

    @Test
    @IncludeIn(H2)
    public void MergeBatch_Templates() {
        SQLMergeClause merge = merge(survey)
            .keys(survey.id)
            .set(survey.id, 5)
            .set(survey.name, Expressions.stringTemplate("'5'"))
            .addBatch();

        merge
            .keys(survey.id)
            .set(survey.id, 6)
            .set(survey.name, Expressions.stringTemplate("'6'"))
            .addBatch();

        assertEquals(2, merge.execute());

        assertEquals(1l, query().from(survey).where(survey.name.eq("5")).count());
        assertEquals(1l, query().from(survey).where(survey.name.eq("6")).count());
    }
View Full Code Here


    @Test
    @IncludeIn(H2)
    public void MergeBatch_with_subquery() {
        SQLMergeClause merge = merge(survey)
            .keys(survey.id)
            .columns(survey.id, survey.name)
            .select(sq().from(survey2).list(survey2.id.add(20), survey2.name))
            .addBatch();

        merge(survey)
            .keys(survey.id)
            .columns(survey.id, survey.name)
            .select(sq().from(survey2).list(survey2.id.add(40), survey2.name))
            .addBatch();

        merge.execute();
//        assertEquals(1, insert.execute());
    }
View Full Code Here

    }

    @Test
    @IncludeIn(H2)
    public void Merge_With_TempateExpression_In_Batch() {
        SQLMergeClause merge = merge(survey)
                .keys(survey.id)
                .set(survey.id, 5)
                .set(survey.name, Expressions.stringTemplate("'5'"))
                .addBatch();

        merge.execute();
    }
View Full Code Here

TOP

Related Classes of com.mysema.query.sql.dml.SQLMergeClause

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.