Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7853557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:44:05+00:00 2026-06-02T19:44:05+00:00

According to the Java EE 6 docs JPA 1.0 @OrderBy uses field names vs.

  • 0

According to the Java EE 6 docs JPA 1.0 @OrderBy uses field names vs. JPA 2.0 @OrderColumn uses column names when declaring the annotations. See here:

http://docs.oracle.com/javaee/6/api/javax/persistence/OrderBy.html

http://docs.oracle.com/javaee/6/api/javax/persistence/OrderColumn.html

The former is available since JPA 1.0, the latter was added with JPA 2.0. If you read the docs for a moment it becomes clear that @OrderBy uses fields/properties to specify the order, whereas @OrderColumn takes an SQL/DDL column name.

Why has it been made that way? To me this looks plain inconsistent.

Is there a deeper point why things have been made that way? Is it a JPA 1.0 relic?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:44:07+00:00Added an answer on June 2, 2026 at 7:44 pm

    Try to understand the difference between an ordered list (JPA1, JPA2), and an indexed list (JPA2). One orders the elements by a condition, and the other preserves the position they were inserted at. They fulfil different use-cases. OrderColumn allows specification of a column name for schema generation purposes. OrderBy provides a query mechanism for retrieval purposes. Consequently what the annotations and XML allow input of are different.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to doc, calendar set() is: http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html#set%28int,%20int,%20int%29 set(int year, int month, int date) Sets
According to: http://java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html 4.5.2 Variables of Reference Type A reference type can hold a
According to this documentation ( http://java.sun.com/docs/books/jls/third_edition/html/lexical.html , 3.10.6) an OctalEscape will be converted to
According to http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Class.html#getDeclaredMethods%28%29 , Class.getDeclaredMethods() should only include methods declared by the class. However,
GWT compiles the Java source into Javascript, and names the files according to a
On http://java.sun.com/j2se/1.5.0/docs/api/java/net/URL.html it states that: Compares this URL for equality with another object. If
Take the PriorityQueue for example http://java.sun.com/j2se/1.5.0/docs/api/java/util/PriorityQueue.html#offer(E) Can anyone give me an example of a
So according to Sun's J2EE documentation ( http://docs.sun.com/app/docs/doc/819-3669/bnani?l=en&a=view ), If a tag attribute is
We're working on deploying a Java project to Heroku that uses MongoDB. According to
According to the java docs of PreparedStatement.setNull: Note: You must specify the parameter's SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.