• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to pass a collection to 'IN' parameter in native query

 
hildich kilal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I want to pass a collection of Long (or String) as a bind parameter to a Hibernate native query. Can i directly set the List<Long> to that parameter?
I know in JPA this is allowed. I can simply do some thing like


Can we also do some thing similar in Native query? Or shall I need to create a comma separated string from List and append it in query?

Thanks

 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!