mybatis / mybatis/thymeleaf-scripting
Investigate a way for adding dialect like as 'mybatis:where' and 'mybatis:set' tag
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 24
- Forks
- 6
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 6
Description
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'
/*[/]*/
/*[/]*/
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the issue's MyBatis dynamic SQL reference and the sample mybatis:where syntax. Determine how the proposed dialect should trim or append WHERE, AND, and SET around conditional SQL, then define tests covering the shown firstName and lastName cases and the expected generated SQL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100