@@ -114,6 +114,7 @@ public SimpleJpaRepository(Class<T> domainClass, EntityManager em) {
114
114
*
115
115
* @param crudMethodMetadata
116
116
*/
117
+ @ Override
117
118
public void setRepositoryMethodMetadata (CrudMethodMetadata crudMethodMetadata ) {
118
119
this .metadata = crudMethodMetadata ;
119
120
}
@@ -142,6 +143,7 @@ private String getCountQueryString() {
142
143
* @see org.springframework.data.repository.CrudRepository#delete(java.io.Serializable)
143
144
*/
144
145
@ Transactional
146
+ @ Override
145
147
public void deleteById (ID id ) {
146
148
147
149
Assert .notNull (id , ID_MUST_NOT_BE_NULL );
@@ -155,6 +157,7 @@ public void deleteById(ID id) {
155
157
* @see org.springframework.data.repository.CrudRepository#delete(java.lang.Object)
156
158
*/
157
159
@ Transactional
160
+ @ Override
158
161
public void delete (T entity ) {
159
162
160
163
Assert .notNull (entity , "The entity must not be null!" );
@@ -166,6 +169,7 @@ public void delete(T entity) {
166
169
* @see org.springframework.data.repository.CrudRepository#delete(java.lang.Iterable)
167
170
*/
168
171
@ Transactional
172
+ @ Override
169
173
public void deleteAll (Iterable <? extends T > entities ) {
170
174
171
175
Assert .notNull (entities , "The given Iterable of entities not be null!" );
@@ -180,6 +184,7 @@ public void deleteAll(Iterable<? extends T> entities) {
180
184
* @see org.springframework.data.jpa.repository.JpaRepository#deleteInBatch(java.lang.Iterable)
181
185
*/
182
186
@ Transactional
187
+ @ Override
183
188
public void deleteInBatch (Iterable <T > entities ) {
184
189
185
190
Assert .notNull (entities , "The given Iterable of entities not be null!" );
@@ -197,6 +202,7 @@ public void deleteInBatch(Iterable<T> entities) {
197
202
* @see org.springframework.data.repository.Repository#deleteAll()
198
203
*/
199
204
@ Transactional
205
+ @ Override
200
206
public void deleteAll () {
201
207
202
208
for (T element : findAll ()) {
@@ -209,6 +215,7 @@ public void deleteAll() {
209
215
* @see org.springframework.data.jpa.repository.JpaRepository#deleteAllInBatch()
210
216
*/
211
217
@ Transactional
218
+ @ Override
212
219
public void deleteAllInBatch () {
213
220
em .createQuery (getDeleteAllQueryString ()).executeUpdate ();
214
221
}
@@ -217,6 +224,7 @@ public void deleteAllInBatch() {
217
224
* (non-Javadoc)
218
225
* @see org.springframework.data.repository.CrudRepository#findById(java.io.Serializable)
219
226
*/
227
+ @ Override
220
228
public Optional <T > findById (ID id ) {
221
229
222
230
Assert .notNull (id , ID_MUST_NOT_BE_NULL );
@@ -259,6 +267,7 @@ public T getOne(ID id) {
259
267
* (non-Javadoc)
260
268
* @see org.springframework.data.repository.CrudRepository#existsById(java.io.Serializable)
261
269
*/
270
+ @ Override
262
271
public boolean existsById (ID id ) {
263
272
264
273
Assert .notNull (id , ID_MUST_NOT_BE_NULL );
@@ -302,6 +311,7 @@ public boolean existsById(ID id) {
302
311
* (non-Javadoc)
303
312
* @see org.springframework.data.jpa.repository.JpaRepository#findAll()
304
313
*/
314
+ @ Override
305
315
public List <T > findAll () {
306
316
return getQuery (null , Sort .unsorted ()).getResultList ();
307
317
}
@@ -310,6 +320,7 @@ public List<T> findAll() {
310
320
* (non-Javadoc)
311
321
* @see org.springframework.data.repository.CrudRepository#findAll(java.lang.Iterable)
312
322
*/
323
+ @ Override
313
324
public List <T > findAllById (Iterable <ID > ids ) {
314
325
315
326
Assert .notNull (ids , "The given Iterable of Id's must not be null!" );
@@ -339,6 +350,7 @@ public List<T> findAllById(Iterable<ID> ids) {
339
350
* (non-Javadoc)
340
351
* @see org.springframework.data.jpa.repository.JpaRepository#findAll(org.springframework.data.domain.Sort)
341
352
*/
353
+ @ Override
342
354
public List <T > findAll (Sort sort ) {
343
355
return getQuery (null , sort ).getResultList ();
344
356
}
@@ -347,6 +359,7 @@ public List<T> findAll(Sort sort) {
347
359
* (non-Javadoc)
348
360
* @see org.springframework.data.repository.PagingAndSortingRepository#findAll(org.springframework.data.domain.Pageable)
349
361
*/
362
+ @ Override
350
363
public Page <T > findAll (Pageable pageable ) {
351
364
352
365
if (isUnpaged (pageable )) {
@@ -360,6 +373,7 @@ public Page<T> findAll(Pageable pageable) {
360
373
* (non-Javadoc)
361
374
* @see org.springframework.data.jpa.repository.JpaSpecificationExecutor#findOne(org.springframework.data.jpa.domain.Specification)
362
375
*/
376
+ @ Override
363
377
public Optional <T > findOne (@ Nullable Specification <T > spec ) {
364
378
365
379
try {
@@ -373,6 +387,7 @@ public Optional<T> findOne(@Nullable Specification<T> spec) {
373
387
* (non-Javadoc)
374
388
* @see org.springframework.data.jpa.repository.JpaSpecificationExecutor#findAll(org.springframework.data.jpa.domain.Specification)
375
389
*/
390
+ @ Override
376
391
public List <T > findAll (@ Nullable Specification <T > spec ) {
377
392
return getQuery (spec , Sort .unsorted ()).getResultList ();
378
393
}
@@ -381,6 +396,7 @@ public List<T> findAll(@Nullable Specification<T> spec) {
381
396
* (non-Javadoc)
382
397
* @see org.springframework.data.jpa.repository.JpaSpecificationExecutor#findAll(org.springframework.data.jpa.domain.Specification, org.springframework.data.domain.Pageable)
383
398
*/
399
+ @ Override
384
400
public Page <T > findAll (@ Nullable Specification <T > spec , Pageable pageable ) {
385
401
386
402
TypedQuery <T > query = getQuery (spec , pageable );
@@ -392,6 +408,7 @@ public Page<T> findAll(@Nullable Specification<T> spec, Pageable pageable) {
392
408
* (non-Javadoc)
393
409
* @see org.springframework.data.jpa.repository.JpaSpecificationExecutor#findAll(org.springframework.data.jpa.domain.Specification, org.springframework.data.domain.Sort)
394
410
*/
411
+ @ Override
395
412
public List <T > findAll (@ Nullable Specification <T > spec , Sort sort ) {
396
413
return getQuery (spec , sort ).getResultList ();
397
414
}
@@ -466,6 +483,7 @@ public <S extends T> Page<S> findAll(Example<S> example, Pageable pageable) {
466
483
* (non-Javadoc)
467
484
* @see org.springframework.data.repository.CrudRepository#count()
468
485
*/
486
+ @ Override
469
487
public long count () {
470
488
return em .createQuery (getCountQueryString (), Long .class ).getSingleResult ();
471
489
}
@@ -474,6 +492,7 @@ public long count() {
474
492
* (non-Javadoc)
475
493
* @see org.springframework.data.jpa.repository.JpaSpecificationExecutor#count(org.springframework.data.jpa.domain.Specification)
476
494
*/
495
+ @ Override
477
496
public long count (@ Nullable Specification <T > spec ) {
478
497
return executeCountQuery (getCountQuery (spec , getDomainClass ()));
479
498
}
@@ -483,6 +502,7 @@ public long count(@Nullable Specification<T> spec) {
483
502
* @see org.springframework.data.repository.CrudRepository#save(java.lang.Object)
484
503
*/
485
504
@ Transactional
505
+ @ Override
486
506
public <S extends T > S save (S entity ) {
487
507
488
508
if (entityInformation .isNew (entity )) {
@@ -498,6 +518,7 @@ public <S extends T> S save(S entity) {
498
518
* @see org.springframework.data.jpa.repository.JpaRepository#saveAndFlush(java.lang.Object)
499
519
*/
500
520
@ Transactional
521
+ @ Override
501
522
public <S extends T > S saveAndFlush (S entity ) {
502
523
503
524
S result = save (entity );
@@ -511,6 +532,7 @@ public <S extends T> S saveAndFlush(S entity) {
511
532
* @see org.springframework.data.jpa.repository.JpaRepository#save(java.lang.Iterable)
512
533
*/
513
534
@ Transactional
535
+ @ Override
514
536
public <S extends T > List <S > saveAll (Iterable <S > entities ) {
515
537
516
538
Assert .notNull (entities , "The given Iterable of entities not be null!" );
@@ -529,6 +551,7 @@ public <S extends T> List<S> saveAll(Iterable<S> entities) {
529
551
* @see org.springframework.data.jpa.repository.JpaRepository#flush()
530
552
*/
531
553
@ Transactional
554
+ @ Override
532
555
public void flush () {
533
556
em .flush ();
534
557
}
@@ -770,6 +793,7 @@ private static final class ByIdsSpecification<T> implements Specification<T> {
770
793
* (non-Javadoc)
771
794
* @see org.springframework.data.jpa.domain.Specification#toPredicate(javax.persistence.criteria.Root, javax.persistence.criteria.CriteriaQuery, javax.persistence.criteria.CriteriaBuilder)
772
795
*/
796
+ @ Override
773
797
public Predicate toPredicate (Root <T > root , CriteriaQuery <?> query , CriteriaBuilder cb ) {
774
798
775
799
Path <?> path = root .get (entityInformation .getIdAttribute ());
0 commit comments