0

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 ?

Afridi
  • 6,753
  • 2
  • 18
  • 27
Reetish Chand
  • 103
  • 1
  • 10

1 Answers1

1

The approach you sketched does not work.

Depending on how you create the query there are various options that might fit the bill:

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348