Skip to content

Commit

Permalink
Merge pull request #274 from jakartaee/rename-basic-repository
Browse files Browse the repository at this point in the history
Rename BasicRepository
  • Loading branch information
otaviojava authored Sep 26, 2023
2 parents 972fcaf + d316928 commit 4ce83d7
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 37 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this project adheres to https://semver.org/spec/v2.0.0.html[Semantic Version

- Define Jakarta Data extensions

=== Changed

* Rename CrudRepository to BasicRepository

== [1.0.0-b3] - 2022-07-24

=== Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
*/
package jakarta.data.exceptions;

import jakarta.data.repository.BasicRepository;

/**
* Indicates a failure that is due to inconsistent state between the entity and the database.
* For example, {@link jakarta.data.repository.CrudRepository#delete(Object) delete(entity)}
* or {@link jakarta.data.repository.CrudRepository#deleteAll(Iterable) deleteAll(entities)}
* For example, {@link BasicRepository#delete(Object) delete(entity)}
* or {@link BasicRepository#deleteAll(Iterable) deleteAll(entities)}
* where the entity Id no longer exists in the database or the entity is versioned and the
* version no longer matches the version in the database.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
import java.util.stream.Stream;

/**
* <p>A repository interface for performing CRUD (Create, Read, Update, Delete) operations on entities.</p>
* <p>A repository interface for performing basic operations on entities.</p>
*
* <p>This repository provides methods to interact with persistent entities of type <code>&lt;T&gt;</code>,
* where <code>&lt;T&gt;</code> represents the entity bean type, and <code>&lt;K&gt;</code> represents the key type.</p>
*
* @param <T> the entity bean type
* @param <K> the key type.
*/
public interface CrudRepository<T, K> extends DataRepository<T, K> {
public interface BasicRepository<T, K> extends DataRepository<T, K> {

/**
* Saves a given entity to the database. If the entity has an ID or key that exists in the database,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@

/**
* Repository fragment to provide methods to retrieve entities using the pagination and sorting abstraction. In many
* cases this will be combined with {@link CrudRepository} or similar or with manually added methods to provide CRUD
* cases this will be combined with {@link BasicRepository} or similar or with manually added methods to provide CRUD
* functionality.
* @param <T> the domain type the repository manages
* @param <K> the type of the id of the entity the repository manages
* @see CrudRepository
* @see BasicRepository
*/
public interface PageableRepository<T, K> extends CrudRepository<T, K> {
public interface PageableRepository<T, K> extends BasicRepository<T, K> {

/**
* Returns a {@link Page} of entities meeting the paging restriction provided in the {@link Pageable} object.
Expand Down
4 changes: 2 additions & 2 deletions api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import jakarta.data.Sort;
import jakarta.data.exceptions.OptimisticLockingFailureException;
import jakarta.data.page.Pageable;
import jakarta.data.repository.CrudRepository;
import jakarta.data.repository.BasicRepository;
import jakarta.data.repository.DataRepository;
import jakarta.data.repository.OrderBy;
import jakarta.data.repository.Query;
Expand Down Expand Up @@ -97,7 +97,7 @@
* <p>Built-in repository super interfaces, such as {@link DataRepository},
* are provided as a convenient way to inherit commonly used methods and are
* parameterized with the entity type and id type. Other built-in repository
* interfaces, such as {@link CrudRepository}, can be used in place of
* interfaces, such as {@link BasicRepository}, can be used in place of
* {@link DataRepository}
* and provide a base set of predefined repository methods
* which serve as an optional starting point.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import jakarta.data.page.KeysetAwareSlice;
import jakarta.data.page.Pageable;
import jakarta.data.page.Slice;
import jakarta.data.repository.CrudRepository;
import jakarta.data.repository.BasicRepository;
import jakarta.data.repository.Repository;

import ee.jakarta.tck.data.framework.read.only.NaturalNumber.NumberType;
Expand All @@ -34,7 +34,7 @@
* TODO figure out a way to make this a ReadOnlyRepository instead.
*/
@Repository
public interface NaturalNumbers extends CrudRepository<NaturalNumber, Long>, IdOperations<NaturalNumber> {
public interface NaturalNumbers extends BasicRepository<NaturalNumber, Long>, IdOperations<NaturalNumber> {

KeysetAwareSlice<NaturalNumber> findByFloorOfSquareRootOrderByIdAsc(long sqrtFloor,
Pageable pagination);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@ CLSS abstract interface jakarta.data.exceptions.package-info

CLSS abstract interface jakarta.data.package-info

CLSS public abstract interface jakarta.data.repository.CrudRepository<%0 extends java.lang.Object, %1 extends java.lang.Object>
intf jakarta.data.repository.DataRepository<{jakarta.data.repository.CrudRepository%0},{jakarta.data.repository.CrudRepository%1}>
meth public abstract <%0 extends {jakarta.data.repository.CrudRepository%0}> java.lang.Iterable<{%%0}> saveAll(java.lang.Iterable<{%%0}>)
meth public abstract <%0 extends {jakarta.data.repository.CrudRepository%0}> {%%0} save({%%0})
meth public abstract boolean existsById({jakarta.data.repository.CrudRepository%1})
meth public abstract java.util.Optional<{jakarta.data.repository.CrudRepository%0}> findById({jakarta.data.repository.CrudRepository%1})
meth public abstract java.util.stream.Stream<{jakarta.data.repository.CrudRepository%0}> findAll()
meth public abstract java.util.stream.Stream<{jakarta.data.repository.CrudRepository%0}> findAllById(java.lang.Iterable<{jakarta.data.repository.CrudRepository%1}>)
CLSS public abstract interface jakarta.data.repository.BasicRepository<%0 extends java.lang.Object, %1 extends java.lang.Object>
intf jakarta.data.repository.DataRepository<{jakarta.data.repository.BasicRepository%0},{jakarta.data.repository.BasicRepository%1}>
meth public abstract <%0 extends {jakarta.data.repository.BasicRepository%0}> java.lang.Iterable<{%%0}> saveAll(java.lang.Iterable<{%%0}>)
meth public abstract <%0 extends {jakarta.data.repository.BasicRepository%0}> {%%0} save({%%0})
meth public abstract boolean existsById({jakarta.data.repository.BasicRepository%1})
meth public abstract java.util.Optional<{jakarta.data.repository.BasicRepository%0}> findById({jakarta.data.repository.BasicRepository%1})
meth public abstract java.util.stream.Stream<{jakarta.data.repository.BasicRepository%0}> findAll()
meth public abstract java.util.stream.Stream<{jakarta.data.repository.BasicRepository%0}> findAllById(java.lang.Iterable<{jakarta.data.repository.BasicRepository%1}>)
meth public abstract long count()
meth public abstract void delete({jakarta.data.repository.CrudRepository%0})
meth public abstract void delete({jakarta.data.repository.BasicRepository%0})
meth public abstract void deleteAll()
meth public abstract void deleteAll(java.lang.Iterable<? extends {jakarta.data.repository.CrudRepository%0}>)
meth public abstract void deleteAllById(java.lang.Iterable<{jakarta.data.repository.CrudRepository%1}>)
meth public abstract void deleteById({jakarta.data.repository.CrudRepository%1})
meth public abstract void deleteAll(java.lang.Iterable<? extends {jakarta.data.repository.BasicRepository%0}>)
meth public abstract void deleteAllById(java.lang.Iterable<{jakarta.data.repository.BasicRepository%1}>)
meth public abstract void deleteById({jakarta.data.repository.BasicRepository%1})

CLSS public abstract interface jakarta.data.repository.DataRepository<%0 extends java.lang.Object, %1 extends java.lang.Object>

Expand Down Expand Up @@ -154,7 +154,7 @@ meth public static jakarta.data.page.Pageable$Mode[] values()
supr java.lang.Enum<jakarta.data.page.Pageable$Mode>

CLSS public abstract interface jakarta.data.repository.PageableRepository<%0 extends java.lang.Object, %1 extends java.lang.Object>
intf jakarta.data.repository.CrudRepository<{jakarta.data.repository.PageableRepository%0},{jakarta.data.repository.PageableRepository%1}>
intf jakarta.data.repository.BasicRepository<{jakarta.data.repository.PageableRepository%0},{jakarta.data.repository.PageableRepository%1}>
meth public abstract jakarta.data.page.Page<{jakarta.data.repository.PageableRepository%0}> findAll(jakarta.data.page.Pageable)

CLSS public abstract interface !annotation jakarta.data.repository.Param
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@ CLSS abstract interface jakarta.data.exceptions.package-info

CLSS abstract interface jakarta.data.package-info

CLSS public abstract interface jakarta.data.repository.CrudRepository<%0 extends java.lang.Object, %1 extends java.lang.Object>
intf jakarta.data.repository.DataRepository<{jakarta.data.repository.CrudRepository%0},{jakarta.data.repository.CrudRepository%1}>
meth public abstract <%0 extends {jakarta.data.repository.CrudRepository%0}> java.lang.Iterable<{%%0}> saveAll(java.lang.Iterable<{%%0}>)
meth public abstract <%0 extends {jakarta.data.repository.CrudRepository%0}> {%%0} save({%%0})
meth public abstract boolean existsById({jakarta.data.repository.CrudRepository%1})
meth public abstract java.util.Optional<{jakarta.data.repository.CrudRepository%0}> findById({jakarta.data.repository.CrudRepository%1})
meth public abstract java.util.stream.Stream<{jakarta.data.repository.CrudRepository%0}> findAll()
meth public abstract java.util.stream.Stream<{jakarta.data.repository.CrudRepository%0}> findAllById(java.lang.Iterable<{jakarta.data.repository.CrudRepository%1}>)
CLSS public abstract interface jakarta.data.repository.BasicRepository<%0 extends java.lang.Object, %1 extends java.lang.Object>
intf jakarta.data.repository.DataRepository<{jakarta.data.repository.BasicRepository%0},{jakarta.data.repository.BasicRepository%1}>
meth public abstract <%0 extends {jakarta.data.repository.BasicRepository%0}> java.lang.Iterable<{%%0}> saveAll(java.lang.Iterable<{%%0}>)
meth public abstract <%0 extends {jakarta.data.repository.BasicRepository%0}> {%%0} save({%%0})
meth public abstract boolean existsById({jakarta.data.repository.BasicRepository%1})
meth public abstract java.util.Optional<{jakarta.data.repository.BasicRepository%0}> findById({jakarta.data.repository.BasicRepository%1})
meth public abstract java.util.stream.Stream<{jakarta.data.repository.BasicRepository%0}> findAll()
meth public abstract java.util.stream.Stream<{jakarta.data.repository.BasicRepository%0}> findAllById(java.lang.Iterable<{jakarta.data.repository.BasicRepository%1}>)
meth public abstract long count()
meth public abstract void delete({jakarta.data.repository.CrudRepository%0})
meth public abstract void delete({jakarta.data.repository.BasicRepository%0})
meth public abstract void deleteAll()
meth public abstract void deleteAll(java.lang.Iterable<? extends {jakarta.data.repository.CrudRepository%0}>)
meth public abstract void deleteAllById(java.lang.Iterable<{jakarta.data.repository.CrudRepository%1}>)
meth public abstract void deleteById({jakarta.data.repository.CrudRepository%1})
meth public abstract void deleteAll(java.lang.Iterable<? extends {jakarta.data.repository.BasicRepository%0}>)
meth public abstract void deleteAllById(java.lang.Iterable<{jakarta.data.repository.BasicRepository%1}>)
meth public abstract void deleteById({jakarta.data.repository.BasicRepository%1})

CLSS public abstract interface jakarta.data.repository.DataRepository<%0 extends java.lang.Object, %1 extends java.lang.Object>

Expand Down Expand Up @@ -154,7 +154,7 @@ meth public static jakarta.data.page.Pageable$Mode[] values()
supr java.lang.Enum<jakarta.data.page.Pageable$Mode>

CLSS public abstract interface jakarta.data.repository.PageableRepository<%0 extends java.lang.Object, %1 extends java.lang.Object>
intf jakarta.data.repository.CrudRepository<{jakarta.data.repository.PageableRepository%0},{jakarta.data.repository.PageableRepository%1}>
intf jakarta.data.repository.BasicRepository<{jakarta.data.repository.PageableRepository%0},{jakarta.data.repository.PageableRepository%1}>
meth public abstract jakarta.data.page.Page<{jakarta.data.repository.PageableRepository%0}> findAll(jakarta.data.page.Pageable)

CLSS public abstract interface !annotation jakarta.data.repository.Param
Expand Down

0 comments on commit 4ce83d7

Please sign in to comment.