Reputation: 103
I want to know how do we pass a query in spring JPA that has been prepared dynamically while program execution. The required query may vary according to the user input. So after framing the query manually using a for loop how do i execute this query ?
I have tried executing the query using the JDBC concept. but i want something more like :
@Query ( query_String)
public <return_type> filterNodes(String query_String);
Is this possible ?
Upvotes: 0
Views: 1313
Reputation: 81988
The approach you sketched does not work.
Depending on how you create the query there are various options that might fit the bill:
EntityManager
to execute it.Upvotes: 1