Skip to content

Commit

Permalink
Try to improve regex
Browse files Browse the repository at this point in the history
  • Loading branch information
radovanradic committed Nov 25, 2024
1 parent 8b711dd commit 4145dad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
public class RawQueryMethodMatcher implements MethodMatcher {

private static final Pattern UPDATE_PATTERN = Pattern.compile(".*\\bupdate\\b.*");
private static final Pattern FOR_UPDATE_PATTERN = Pattern.compile(".*\\bfor.*\\bupdate\\b.*");
private static final Pattern FOR_UPDATE_PATTERN = Pattern.compile(".*\\bfor\\s+update\\b.*");
private static final Pattern DELETE_PATTERN = Pattern.compile(".*\\bdelete\\b.*");
private static final Pattern INSERT_PATTERN = Pattern.compile(".*\\binsert\\b.*");
private static final Pattern RETURNING_PATTERN = Pattern.compile(".*\\breturning\\b.*");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,8 @@ interface PersonRepository extends CrudRepository<Person, Long> {
$type customSelect(Long id);
@Query(\"""
SELECT * FROM person WHERE id = :id FOR UPDATE
SELECT * FROM person WHERE id = :id FOR
UPDATE
\""")
$type selectForUpdate(Long id);
Expand Down

0 comments on commit 4145dad

Please sign in to comment.