query method to find by embedded id object property spring boot
- User
query method to find by embedded id object property spring boot
- Assistant
In Spring Boot, you can use the
@Queryannotation provided by Spring Data JPA to create custom queries to search by embedded object property. Here's an example of how you can achieve this:Assuming you have an entity
Userwhich has an embedded objectAddresswith propertiescityandstate:java