Repository with wrong ID doesn't fail start-up of application context [DATAJPA-1649] #1953
Labels
in: core
Issues in core support
status: declined
A suggestion or change that we don't feel we should currently apply
type: bug
A general bug
Сергей Цыпанов opened DATAJPA-1649 and commented
Suppose we have an entity
and repository
Calling BrokenRepository.findById() fails at runtime:
In fact we can specify any instance of Serializable as ID type of JpaRepository and some of the methods (e.g. findAll()) are OK with that.
My suggestion is to add explicit check for ID at start-up time in order to fail applciation context: in this case the user becomes aware of broken repository immediately along with bad
@Query
declarationsIssue Links:
DATAJPA-1654 Fix mismatch in tests between Repository declaration and the id type of the entity
DATACMNS-757 Verify identifier type declared on repository matches the one of the declared domain type
The text was updated successfully, but these errors were encountered: