SQL : Add support for special options in DML clauses

Bug #619667 reported by Marko Lavikainen
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.

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

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
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.