You can take a look at Spring JPA data .
Several new concepts were introduced in Spring Data JPA, for example, creating a query based on a method name, so you can declare a method of type findById(String id)
, and the "generic" implementation will interpret the method name and do something like select Entity from Entity where id = 'given string'
Methods such as findByNameAndLastName(String name, String lastName)
or even findByNameOrInternalId(String name, int internalId)
also supported.
source share