Reetish Chand
Reetish Chand

Reputation: 103

Passing dynamic queries in spring JPA

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

Answers (1)

Jens Schauder
Jens Schauder

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:

Upvotes: 1

Related Questions