-
Notifications
You must be signed in to change notification settings - Fork 23
SpringDataJDBC対応 #1060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
SpringDataJDBC対応 #1060
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
9f59880
feat: Spring Data JDBCのCRUD解析を追加
irof 43920e1
refactor: 変な位置に作ってたので移動
irof 4057a22
docs: 何者かを書いておく
irof 9fd8852
refactor: SpringDataJdbcStatementsReaderの戻り値を中立化
irof 526c25c
refactor: SQLステートメント型名を中立化
irof 667a223
refactor: SpringDataJdbcStatementsReaderの戻り値をSqlStatementsに統一
irof 277bd4a
refactor: SpringDataJDBC解析をASMメタ情報ベースに変更
irof af1be40
docs: 推測メソッドにコメントを追加
irof f071a35
docs: SpringDataJDBC解析対象の条件コメントを追加
irof 59b87f9
fix: @Queryメソッドを命名規約推測の対象外にする
irof e83ff0a
fix: SpringDataJDBC解析の@Repository条件を除去
irof 38ec9cb
feat: SpringDataJDBCの@Queryメソッド解析に対応
irof 1cf7139
fix: @Query先頭装飾を除去してSQL種別を判定
irof ff1f39a
docs: SqlStatementIdクラスにTODOコメントを追加
irof 183b72f
refactor: SQLステートメントIDの生成処理をメソッドに分離
irof 298ebb0
fix: SQL解析失敗時のログメッセージを修正
irof 27a4b0b
refactor: DBアクセス判定処理をメソッドに分離
irof 4092235
test: SpringDataJdbcStatementReaderTestをパラメタライズド化
irof dae8953
refactor: QueryからのSQL種別推測をSqlTypeに集約
irof 0c86a8d
refactor: SQL先頭装飾の除去処理をQueryに集約
irof 7c31ec4
refactor: inferSqlTypeFromQueryがQueryを受け取るよう変更
irof f4472e5
refactor: QueryにnormalizedQueryを追加
irof File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 0 additions & 60 deletions
60
jig-core/src/main/java/org/dddjava/jig/domain/model/data/rdbaccess/MyBatisStatementId.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
jig-core/src/main/java/org/dddjava/jig/domain/model/data/rdbaccess/SqlStatementId.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package org.dddjava.jig.domain.model.data.rdbaccess; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| /** | ||
| * SQLステートメントID | ||
| * | ||
| * namespaceとidを.で連結したもの。 | ||
| * | ||
| * TODO namespaceやidはMyBatisの用語なのでこの形のままとするかは一考の余地がある | ||
| */ | ||
| public record SqlStatementId(String value, String namespace, String id) { | ||
|
|
||
| public static SqlStatementId from(String value) { | ||
| var namespaceIdSeparateIndex = value.lastIndexOf('.'); | ||
| if (namespaceIdSeparateIndex != -1) { | ||
| return new SqlStatementId(value, value.substring(0, namespaceIdSeparateIndex), value.substring(namespaceIdSeparateIndex + 1)); | ||
| } else { | ||
| return new SqlStatementId(value, "<unknown namespace>", value); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) return true; | ||
| if (o == null || getClass() != o.getClass()) return false; | ||
| SqlStatementId that = (SqlStatementId) o; | ||
| return Objects.equals(value, that.value); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(value); | ||
| } | ||
|
|
||
| public String namespace() { | ||
| return namespace; | ||
| } | ||
|
|
||
| public String id() { | ||
| return id; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
元々のコメントが書きかけなのはおいといて。。。
この処理さらにアレになったなぁ