SQL : Add support for special options in DML clauses

Bug #619667 reported by Marko Lavikainen on 2010-08-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned

Bug Description

MySQL supports a number of options while using INSERT. See manual at http://dev.mysql.com/doc/refman/5.1/en/insert-select.html. From the options case INSERT IGNORE INTO is needed.

Fixed in SVN trunk. The DML clause implementations of the SQL module support now START, START_OVERRIDE and END flags. Use them like this :

    @Test
    public void insert_with_special_options(){
        SQLInsertClause clause = insert(survey)
            .columns(survey.id, survey.name)
            .values(3, "Hello");

        clause.addFlag(Position.START_OVERRIDE, "INSERT IGNORE INTO ");

        assertEquals("INSERT IGNORE INTO SURVEY(ID, NAME) values (?, ?)", clause.toString());
        clause.execute();
    }

summary: - SQL: Add support for special options in insert clause
+ SQL: Add support for special options in DML clauses
Changed in querydsl:
status: New → Fix Committed
summary: - SQL: Add support for special options in DML clauses
+ SQL : Add support for special options in DML clauses

Released in 1.9.0

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers