I would assume that Hibernate would have a method of finding entities given another pre-populated entity, querying those who match.
As of my current knowledge; if I want to query an entity with a criteria of multiple fields I would need to add such a method in the CrudRepository
interface which would look like this: findByFirstNameAndLastNameAndAddress...
and then every combination i can think of.
Is there something along the lines of queryMatchingInstance(instance)
?
This feature is called query by example.
It is available in Hibernate directly .
And since you tagged the question with spring-data-jpa
: Spring Data offers such a feature as well .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.