I am Using JPARespository to perform Database operations. I have a requirement, where I want to select specific columns from given table while passing a few where clause.
You can use projections . Spring Data will select only required columns. It works with both generated queries from method name and @Query
annotation.
Related question: Spring Data JPA Projection selected fields from the DB
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.