[JAVA] Implement a multi-column IN clause (column: condition = n: n) in DOMA.

Multi-column IN clause? ?? ??

Like this

SELECT * FROM TEST_TBL
WHERE
    (FIRST_NAME, LAST_NAME) IN (
        ('Yamada', 'Taro'),
        ('Suzuki', 'Jiro')
    )

Implemented with DOMA

It's useless if you do it normally, so I'll do my best with a for statement.

SELECT * FROM TEST_TBL
WHERE
    (FIRST_NAME, LAST_NAME) IN (
        /*%for condition : conditionList */
            (/* condition.firstName */'firstname', /* condition.lastName */'lastname')
            /*%if condition_has_next */
                ,
            /*%end */
        /*%end */
        /*%if conditionList == null || conditionList.isEmpty() */
            (NULL, NULL)
        /*%end */
    )

Recommended Posts

Implement a multi-column IN clause (column: condition = n: n) in DOMA.
3 Implement a simple interpreter in Java
Implement a gRPC client in Ruby
Implement a contact form in Rails
Implement something like a stack in Java
Implement user management functions in a wizard format
How to implement a like feature in Rails