Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7dd47f8

Browse files
[improve] Added a native query example
1 parent 1c2fd0f commit 7dd47f8

File tree

1 file changed

+7
-0
lines changed
  • d02/d02s05/d02s05e01-embedded-database/src/main/java/net/safedata/spring/training/d02/s05/repository

1 file changed

+7
-0
lines changed

‎d02/d02s05/d02s05e01-embedded-database/src/main/java/net/safedata/spring/training/d02/s05/repository/ProductRepository.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,11 @@ Optional<Product> findProductByNameAndId(@Param(value = "name") final String nam
3636
"WHERE product.name LIKE :name"
3737
)
3838
List<Product> findProductsWhichIncludeName(final @Param(value = "name") String name);
39+
40+
@Query(value = "SELECT * " +
41+
"FROM product p " +
42+
"WHERE p.name LIKE :name",
43+
nativeQuery = true
44+
)
45+
List<Product> findProductsWhichIncludeNameUsingSQL(final @Param(value = "name") String name);
3946
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /