You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Subhash Sonkusaley <su...@cybage.com> on 2015/09/03 18:08:18 UTC

JPA Criteria Query API and order by null last

Hi All,

We are using OPENJPA 2.0 and currently facing an issue while using Criteria Query Order By clause. This issue comes when order by fields has at  least one NULL data in it.  We have order by clause for string column and we don't have data in all rows for that column. Hence, Criteria Query executes order by NULL. This would results in invalid results after query executions. It's omitting all records which has NULL as data in that respective column.

We need to place order by in such a way that it would be behave just like NULL first and NULL Last as in Oracle.

Also, I see that there is issue locked under JPA-SPEC project for same issue
https://java.net/jira/browse/JPA_SPEC-76

Please let us know any solution to this problem.

Thanks & Regards,
Subhash Sonkusaley, System Analyst
Cybage Software Pvt. Ltd. (An SEI-CMMI Level 5 assessed & ISO 27001 Company)
Pune, India
Phone(O):91-20-66041700, Ext:6261
Fax:91-20-66041701


"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment." www.cybage.com