Skip to content

Investigate a way for adding dialect like as 'mybatis:where' and 'mybatis:set' tag #3

Open
@kazuki43zoo

Description

@kazuki43zoo

In current feature, it does not support for appending and trimming SQL key-word(e.g. WHERE, AND, SET) like as <where> and <set> provided by xml based scripting language.
So, we need to add the no-dynamic phrase (e.g. WHERE 1 = 1, SET id = id, etc ...) before dynamic parts. I think it is easy writing but it is troublesome rule.

I hope to be enabled to write as follow:

SELECT * FROM names
/*[# mybatis:where]*/
  WHERE
  /*[# th:if="${firstName} != null"]*/
    firstName = /*[('#{firstName}')]*/ 'Taro'
  /*[/]*/
  /*[# th:if="${lastName} != null"]*/
    AND lastName = /*[('#{lastName}')]*/ 'Yamada'
  /*[/]*/
/*[/]*/

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions