This week's book giveaway is in the Features new in Java 9 forum.
We're giving away four copies of Java 9 Revealed and have Kishori Sharan on-line!
See this thread for details.
Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!