質問編集履歴
7
追加
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
List Pageの違い ページング JPQL sql java
|
1
|
+
List Pageの違い ページング JPQL sql java spring JPA
|
body
CHANGED
File without changes
|
6
追加
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
List Pageの違い ページング JPQL
|
1
|
+
List Pageの違い ページング JPQL sql java
|
body
CHANGED
File without changes
|
5
追加
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
List Pageの違い
|
1
|
+
List Pageの違い ページング JPQL
|
body
CHANGED
File without changes
|
4
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -16,5 +16,10 @@
|
|
16
16
|
Page<Profile> findFavoriteByUserId(Integer userId, Pageable pageable);
|
17
17
|
```
|
18
18
|
|
19
|
+
エラー
|
20
|
+
```
|
21
|
+
|
22
|
+
Caused by: org.springframework.data.jpa.repository.query.InvalidJpaQueryMethodException: Cannot use native queries with dynamic sorting and/or pagination in method public abstract org.springframework.data.domain.Page com.example.konkatsu.repository.ProfileRepository.findFavoriteByUserId(java.lang.Integer,org.springframework.data.domain.Pageable)
|
23
|
+
```
|
19
24
|
Pageableを使用するときは
|
20
25
|
nativeQuery だと適応されないのでしょうか???
|
3
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
```java
|
2
2
|
@Query(value = "SELECT * FROM PROFILE INNER JOIN FAVORITE ON PROFILE.USER_ID = FAVORITE.FAVORITE_USER_ID WHERE FAVORITE.USER_ID = ? ", nativeQuery = true)
|
3
|
-
List<Profile>
|
3
|
+
List<Profile> findFavoriteByUserId(Integer userId);
|
4
4
|
```
|
5
5
|
|
6
6
|
|
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
```java
|
15
15
|
@Query(value = "SELECT * FROM PROFILE INNER JOIN FAVORITE ON PROFILE.USER_ID = FAVORITE.FAVORITE_USER_ID WHERE FAVORITE.USER_ID = ? ", nativeQuery = true)
|
16
|
-
Page<Profile>
|
16
|
+
Page<Profile> findFavoriteByUserId(Integer userId, Pageable pageable);
|
17
17
|
```
|
18
18
|
|
19
19
|
Pageableを使用するときは
|
2
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
```java
|
15
|
-
@Query(value = "SELECT * FROM PROFILE INNER JOIN FAVORITE ON PROFILE.USER_ID = FAVORITE.FAVORITE_USER_ID WHERE FAVORITE.USER_ID = ?
|
15
|
+
@Query(value = "SELECT * FROM PROFILE INNER JOIN FAVORITE ON PROFILE.USER_ID = FAVORITE.FAVORITE_USER_ID WHERE FAVORITE.USER_ID = ? ", nativeQuery = true)
|
16
16
|
Page<Profile> findFavoriteUserIdByUserId(Integer userId, Pageable pageable);
|
17
17
|
```
|
18
18
|
|
1
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
```java
|
2
2
|
@Query(value = "SELECT * FROM PROFILE INNER JOIN FAVORITE ON PROFILE.USER_ID = FAVORITE.FAVORITE_USER_ID WHERE FAVORITE.USER_ID = ? ", nativeQuery = true)
|
3
|
-
|
3
|
+
List<Profile> findFavoriteUserIdByUserId(Integer userId);
|
4
4
|
```
|
5
5
|
|
6
6
|
|