Is there any good general JPA DAO implementation?

According to this article, a generic JPA DAO (Data Access Object) is a pretty nice template.

Is there a good implementation?

+6
source share
2 answers

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.

+7
source

Just wanted to mention a couple more common Tao implementations for JPA:

+2
source

Source: https://habr.com/ru/post/918221/


All Articles