java - How to get objects from criteria query in List in order of ids provided -
i have list of ids [3,80,5,1]
and have records in database , person class objects.
is there way person objects in same order of ids provided.
i mean result should give me values
person(id : 3), person(id : 80), person(id : 5), person(id : 1),
person.getall(3, 80, 5, 1)
here how getall()
works. result list bear same order of id's in list.
it accepts list argument, so:
person.getall([3, 80, 5, 1])
should good, or in general:
list ids = [3, 80, 5, 1] person.getall(*ids)
should well.
Comments
Post a Comment