Order by Random JPQL

Nargzul
Nargzul used Ask the Experts™
on
Hi every body!

I don't find the synthax to order by random in a JPQL request. Have you a link or an exemple?

Thank you!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mick BarryJava Developer
Top Expert 2010

Commented:

Author

Commented:
I didn't see any notion about random
Mick BarryJava Developer
Top Expert 2010

Commented:
I don't believe that option exists in jpql
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Author

Commented:
What are other options?

Because I know I can do it in mysql, but I've 3 join of the same object and I was obligated to use a constructor because he cant give back many object for each row.
Mick BarryJava Developer
Top Expert 2010

Commented:
you could randomize the order of the returned list. why do you need a random oder?

Author

Commented:
It's to have a better repartition and equals chance of treatement for every  row.

How can I do a random ordrer on the list? Because I will have something like 3000-5000 rows everytime, and I was thinking it would be better to directly receive this list randomized.

I'm curious about how to access theses randomly, only one time, without having an other list with all readed values.

Thanks you for your help!
Java Developer
Top Expert 2010
Commented:

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial