• Post Reply Bookmark Topic Watch Topic
  • New Topic

parametric query with in clause  RSS feed

 
manish Bit
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a normal query with IN clause, to which i want to convert into a parametric query. I am using Hibernate.

i have an String array, "actorIdArr" and a Long type "iterID";
My query is:-

from UseCaseTaskEntity as en where en.useCaseEntity.iterationEntity.IterationID = iterID"
+ " and en.OwnerEntity.ProjectActorID in ( actorIdArr)";

I dont know how to convert it into parametric query. please help me.
 
Max Vandenburg
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
from UseCaseTaskEntity as en where en.useCaseEntity.iterationEntity.IterationID = iterID"
+ " and en.OwnerEntity.ProjectActorID in ( actorIdArr)";


SELECT o FROM Entity o
WHERE o.attribute1 = :id
AND o.attribute2 IN (:setOfAttributes)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!