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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -