Skip to content

Commit c02f444

Browse files
christophstroblmp911de
authored andcommitted
DATAJPA-1110 - Polishing.
Migrate assertions to AssertJ. Fix Javadoc. Original pull request: #201.
1 parent efac93c commit c02f444

File tree

2 files changed

+258
-386
lines changed

2 files changed

+258
-386
lines changed

src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
/**
6262
* Default implementation of the {@link org.springframework.data.repository.CrudRepository} interface. This will offer
6363
* you a more sophisticated interface than the plain {@link EntityManager} .
64-
*
64+
*
6565
* @author Oliver Gierke
6666
* @author Eberhard Wolff
6767
* @author Thomas Darimont
@@ -84,7 +84,7 @@ public class SimpleJpaRepository<T, ID> implements JpaRepository<T, ID>, JpaSpec
8484

8585
/**
8686
* Creates a new {@link SimpleJpaRepository} to manage objects of the given {@link JpaEntityInformation}.
87-
*
87+
*
8888
* @param entityInformation must not be {@literal null}.
8989
* @param entityManager must not be {@literal null}.
9090
*/
@@ -100,7 +100,7 @@ public SimpleJpaRepository(JpaEntityInformation<T, ?> entityInformation, EntityM
100100

101101
/**
102102
* Creates a new {@link SimpleJpaRepository} to manage objects of the given domain type.
103-
*
103+
*
104104
* @param domainClass must not be {@literal null}.
105105
* @param em must not be {@literal null}.
106106
*/
@@ -111,7 +111,7 @@ public SimpleJpaRepository(Class<T> domainClass, EntityManager em) {
111111
/**
112112
* Configures a custom {@link CrudMethodMetadata} to be used to detect {@link LockModeType}s and query hints to be
113113
* applied to queries.
114-
*
114+
*
115115
* @param crudMethodMetadata
116116
*/
117117
public void setRepositoryMethodMetadata(CrudMethodMetadata crudMethodMetadata) {
@@ -203,7 +203,7 @@ public void deleteAll() {
203203
}
204204
}
205205

206-
/*
206+
/*
207207
* (non-Javadoc)
208208
* @see org.springframework.data.jpa.repository.JpaRepository#deleteAllInBatch()
209209
*/
@@ -214,7 +214,7 @@ public void deleteAllInBatch() {
214214

215215
/*
216216
* (non-Javadoc)
217-
* @see org.springframework.data.repository.CrudRepository#findOne(java.io.Serializable)
217+
* @see org.springframework.data.repository.CrudRepository#findById(java.io.Serializable)
218218
*/
219219
public Optional<T> findById(ID id) {
220220

@@ -236,14 +236,14 @@ public Optional<T> findById(ID id) {
236236
/**
237237
* Returns {@link QueryHints} with the query hints based on the current {@link CrudMethodMetadata} and potential
238238
* {@link EntityGraph} information.
239-
*
239+
*
240240
* @return
241241
*/
242242
protected QueryHints getQueryHints() {
243243
return metadata == null ? NoHints.INSTANCE : DefaultQueryHints.of(entityInformation, metadata);
244244
}
245245

246-
/*
246+
/*
247247
* (non-Javadoc)
248248
* @see org.springframework.data.jpa.repository.JpaRepository#getOne(java.io.Serializable)
249249
*/
@@ -256,7 +256,7 @@ public T getOne(ID id) {
256256

257257
/*
258258
* (non-Javadoc)
259-
* @see org.springframework.data.repository.CrudRepository#exists(java.io.Serializable)
259+
* @see org.springframework.data.repository.CrudRepository#existsById(java.io.Serializable)
260260
*/
261261
public boolean existsById(ID id) {
262262

@@ -287,7 +287,7 @@ public boolean existsById(ID id) {
287287

288288
if (complexIdParameterValueDiscovered) {
289289

290-
// fall-back to findOne(id) which does the proper mapping for the parameter.
290+
// fall-back to findById(id) which does the proper mapping for the parameter.
291291
return findById(id) != null;
292292
}
293293

@@ -307,7 +307,7 @@ public List<T> findAll() {
307307

308308
/*
309309
* (non-Javadoc)
310-
* @see org.springframework.data.repository.CrudRepository#findAll(ID[])
310+
* @see org.springframework.data.repository.CrudRepository#findAll(java.lang.Iterable)
311311
*/
312312
public List<T> findAllById(Iterable<ID> ids) {
313313

@@ -393,7 +393,7 @@ public List<T> findAll(Specification<T> spec, Sort sort) {
393393
return getQuery(spec, sort).getResultList();
394394
}
395395

396-
/*
396+
/*
397397
* (non-Javadoc)
398398
* @see org.springframework.data.repository.query.QueryByExampleExecutor#findOne(org.springframework.data.domain.Example)
399399
*/
@@ -408,7 +408,7 @@ public <S extends T> Optional<S> findOne(Example<S> example) {
408408
}
409409
}
410410

411-
/*
411+
/*
412412
* (non-Javadoc)
413413
* @see org.springframework.data.repository.query.QueryByExampleExecutor#count(org.springframework.data.domain.Example)
414414
*/
@@ -417,7 +417,7 @@ public <S extends T> long count(Example<S> example) {
417417
return executeCountQuery(getCountQuery(new ExampleSpecification<S>(example), example.getProbeType()));
418418
}
419419

420-
/*
420+
/*
421421
* (non-Javadoc)
422422
* @see org.springframework.data.repository.query.QueryByExampleExecutor#exists(org.springframework.data.domain.Example)
423423
*/
@@ -599,7 +599,7 @@ protected <S extends T> TypedQuery<S> getQuery(Specification<S> spec, Class<S> d
599599

600600
/**
601601
* Creates a {@link TypedQuery} for the given {@link Specification} and {@link Sort}.
602-
*
602+
*
603603
* @param spec can be {@literal null}.
604604
* @param sort can be {@literal null}.
605605
* @return
@@ -633,7 +633,7 @@ protected <S extends T> TypedQuery<S> getQuery(Specification<S> spec, Class<S> d
633633

634634
/**
635635
* Creates a new count query for the given {@link Specification}.
636-
*
636+
*
637637
* @param spec can be {@literal null}.
638638
* @return
639639
* @deprecated override {@link #getCountQuery(Specification, Class)} instead
@@ -722,7 +722,7 @@ private void applyQueryHints(Query query) {
722722

723723
/**
724724
* Executes a count query and transparently sums up all values returned.
725-
*
725+
*
726726
* @param query must not be {@literal null}.
727727
* @return
728728
*/
@@ -744,7 +744,7 @@ private static Long executeCountQuery(TypedQuery<Long> query) {
744744
* Specification that gives access to the {@link Parameter} instance used to bind the ids for
745745
* {@link SimpleJpaRepository#findAllById(Iterable)}. Workaround for OpenJPA not binding collections to in-clauses
746746
* correctly when using by-name binding.
747-
*
747+
*
748748
* @see <a href="https://issues.apache.org/jira/browse/OPENJPA-2018?focusedCommentId=13924055">OPENJPA-2018</a>
749749
* @author Oliver Gierke
750750
*/

0 commit comments

Comments
 (0)