@@ -53,10 +53,6 @@ public class RepositoryMethodsImplementor implements ResourceMethodsImplementor
53
53
public static final MethodDescriptor LIST_PAGED = ofMethod (PagingAndSortingRepository .class , "findAll" ,
54
54
org .springframework .data .domain .Page .class , Pageable .class );
55
55
56
- //ListPagingAndSortingRepository
57
- public static final MethodDescriptor LIST_SORTED = ofMethod (ListPagingAndSortingRepository .class , "findAll" ,
58
- List .class , org .springframework .data .domain .Sort .class );
59
-
60
56
private static final Class <?> PANACHE_PAGE = io .quarkus .panache .common .Page .class ;
61
57
62
58
private static final Class <?> PANACHE_SORT = io .quarkus .panache .common .Sort .class ;
@@ -83,34 +79,37 @@ public RepositoryMethodsImplementor(IndexView index, EntityClassHelper entityCla
83
79
}
84
80
85
81
// CrudRepository Iterable<T> findAll();
86
- public void implementListIterable (ClassCreator classCreator , String repositoryInterfaceName ) {
82
+ public void implementIterable (ClassCreator classCreator , String repositoryInterfaceName ) {
87
83
if (entityClassHelper .isCrudRepository (repositoryInterfaceName )
88
84
&& !entityClassHelper .isPagingAndSortingRepository (repositoryInterfaceName )) {
89
85
MethodCreator methodCreator = classCreator .getMethodCreator ("list" , List .class , Page .class , Sort .class ,
90
86
String .class , Map .class );
91
87
ResultHandle repository = getRepositoryInstance (methodCreator , repositoryInterfaceName );
92
88
ResultHandle result = methodCreator .invokeInterfaceMethod (LIST_ITERABLE , repository );
93
89
methodCreator .returnValue (result );
94
- LOGGER .infof ("Method code: %s " , methodCreator .getMethodDescriptor ().toString ());
90
+ LOGGER .debugf ("Method code: %s " , methodCreator .getMethodDescriptor ().toString ());
95
91
methodCreator .close ();
96
92
}
97
93
}
98
94
99
95
//ListCrudRepository List<T> findAll();
100
96
public void implementList (ClassCreator classCreator , String repositoryInterfaceName ) {
101
- if (entityClassHelper .isListCrudRepository (repositoryInterfaceName )) {
97
+ if (entityClassHelper .isListCrudRepository (repositoryInterfaceName )
98
+ && !entityClassHelper .isListPagingAndSortingRepository (repositoryInterfaceName )) {
102
99
MethodCreator methodCreator = classCreator .getMethodCreator ("list" , List .class , Page .class , Sort .class ,
103
100
String .class , Map .class );
104
101
ResultHandle repository = getRepositoryInstance (methodCreator , repositoryInterfaceName );
105
102
ResultHandle result = methodCreator .invokeInterfaceMethod (LIST , repository );
106
103
methodCreator .returnValue (result );
107
- LOGGER .infof ("Method code: %s " , methodCreator .toString ());
104
+ LOGGER .debugf ("Method code: %s " , methodCreator .toString ());
108
105
methodCreator .close ();
109
106
}
110
107
}
111
108
112
109
// PagingAndSortingRepository Page<T> findAll(Pageable pageable);
113
- public void implementListPaged (ClassCreator classCreator , String repositoryInterfaceName ) {
110
+ // PagingAndSortingRepository Iterable<T> findAll(Pageable pageable);
111
+ // ListPagingAndSortingRepository List<T> findAll(Sort sort);
112
+ public void implementPagedList (ClassCreator classCreator , String repositoryInterfaceName ) {
114
113
if (entityClassHelper .isPagingAndSortingRepository (repositoryInterfaceName )) {
115
114
MethodCreator methodCreator = classCreator .getMethodCreator ("list" , List .class , Page .class ,
116
115
io .quarkus .panache .common .Sort .class , String .class , Map .class );
@@ -124,26 +123,7 @@ public void implementListPaged(ClassCreator classCreator, String repositoryInter
124
123
ofMethod (org .springframework .data .domain .Page .class , "getContent" , List .class ), resultPage );
125
124
126
125
methodCreator .returnValue (result );
127
- LOGGER .infof ("Method code: %s " , methodCreator .toString ());
128
- methodCreator .close ();
129
- }
130
- }
131
-
132
- //ListPagingAndSortingRepository List<T> findAll(Sort sort);
133
- public void implementListSort (ClassCreator classCreator , String repositoryInterfaceName ) {
134
- if (entityClassHelper .isListPagingAndSortingRepository (repositoryInterfaceName )) {
135
- MethodCreator methodCreator = classCreator .getMethodCreator ("list" , List .class , Page .class ,
136
- io .quarkus .panache .common .Sort .class , String .class , Map .class );
137
- ResultHandle page = methodCreator .getMethodParam (0 );
138
- ResultHandle sort = methodCreator .getMethodParam (1 );
139
- ResultHandle pageable = toPageable (methodCreator , page , sort );
140
- ResultHandle repository = getRepositoryInstance (methodCreator , repositoryInterfaceName );
141
- ResultHandle resultPage = methodCreator .invokeInterfaceMethod (LIST_SORTED , repository , pageable );
142
- ResultHandle result = methodCreator .invokeInterfaceMethod (
143
- ofMethod (org .springframework .data .domain .Page .class , "getContent" , List .class ), resultPage );
144
-
145
- methodCreator .returnValue (result );
146
- LOGGER .infof ("Method code: %s " , methodCreator .toString ());
126
+ LOGGER .debugf ("Method code: %s " , methodCreator .toString ());
147
127
methodCreator .close ();
148
128
}
149
129
}
@@ -163,7 +143,7 @@ public void implementListPageCount(ClassCreator classCreator, String repositoryI
163
143
} else {
164
144
methodCreator .throwException (RuntimeException .class , "Method not implemented" );
165
145
}
166
- LOGGER .infof ("Method code: %s " , methodCreator .toString ());
146
+ LOGGER .debugf ("Method code: %s " , methodCreator .toString ());
167
147
methodCreator .close ();
168
148
}
169
149
@@ -175,7 +155,7 @@ public void implementListById(ClassCreator classCreator, String repositoryInterf
175
155
ResultHandle repository = getRepositoryInstance (methodCreator , repositoryInterfaceName );
176
156
ResultHandle result = methodCreator .invokeInterfaceMethod (LIST_BY_ID , repository , ids );
177
157
methodCreator .returnValue (result );
178
- LOGGER .infof ("Method code: %s " , methodCreator .toString ());
158
+ LOGGER .debugf ("Method code: %s " , methodCreator .toString ());
179
159
methodCreator .close ();
180
160
}
181
161
}
@@ -191,7 +171,7 @@ public void implementGet(ClassCreator classCreator, String repositoryInterfaceNa
191
171
} else {
192
172
methodCreator .throwException (RuntimeException .class , "Method not implemented" );
193
173
}
194
- LOGGER .infof ("Method code: %s " , methodCreator .toString ());
174
+ LOGGER .debugf ("Method code: %s " , methodCreator .toString ());
195
175
methodCreator .close ();
196
176
}
197
177
@@ -208,7 +188,7 @@ public void implementAdd(ClassCreator classCreator, String repositoryInterfaceNa
208
188
methodCreator .throwException (RuntimeException .class , "Method not implemented" );
209
189
210
190
}
211
- LOGGER .infof ("Method code: %s " , methodCreator .toString ());
191
+ LOGGER .debugf ("Method code: %s " , methodCreator .toString ());
212
192
methodCreator .close ();
213
193
}
214
194
@@ -223,7 +203,7 @@ public void implementAddList(ClassCreator classCreator, String repositoryInterfa
223
203
} else {
224
204
methodCreator .throwException (RuntimeException .class , "Method not implemented" );
225
205
}
226
- LOGGER .infof ("Method code: %s " , methodCreator .toString ());
206
+ LOGGER .debugf ("Method code: %s " , methodCreator .toString ());
227
207
methodCreator .close ();
228
208
}
229
209
@@ -240,7 +220,7 @@ public void implementUpdate(ClassCreator classCreator, String repositoryInterfac
240
220
} else {
241
221
methodCreator .throwException (RuntimeException .class , "Method not implemented" );
242
222
}
243
- LOGGER .infof ("Method code: %s " , methodCreator .toString ());
223
+ LOGGER .debugf ("Method code: %s " , methodCreator .toString ());
244
224
methodCreator .close ();
245
225
}
246
226
@@ -261,7 +241,7 @@ public void implementDelete(ClassCreator classCreator, String repositoryInterfac
261
241
} else {
262
242
methodCreator .throwException (RuntimeException .class , "Method not implemented" );
263
243
}
264
- LOGGER .infof ("Method code: %s " , methodCreator .toString ());
244
+ LOGGER .debugf ("Method code: %s " , methodCreator .toString ());
265
245
methodCreator .close ();
266
246
}
267
247
0 commit comments