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

  • SEARCH
  • Home
  • 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 8256419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:51:31+00:00 2026-06-08T01:51:31+00:00

I am just curious what the o stands for when I am trying to

  • 0

I am just curious what the o stands for when I am trying to query.

By default my query is coming out as
@NamedQuery (name="newName" query=SELECT o FROM tableView o)

I am just curious what the o stands for. I have seen several instances of using the letter x and c as well. Just wondering what the difference, if any. Also, why can’t I just use a * to select and entire row?

  • 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-08T01:51:32+00:00Added an answer on June 8, 2026 at 1:51 am

    It is called identification variable in JQPL terminology. When used in SELECT statements, identification variable is declared in FROM clause. It is mandatory to use it in SELECT statement if some persistent attribute (of entity), entity itself, or some value deduced from persistent attribute is designed as a result of query.

    SELECT a.someAttribute FROM EntityA a 
    SELECT a FROM EntityA a 
    SELECT SUM(a.someAttribute) FROM EntityA a
    

    Same queries without using a. are not valid JQPL queries. They do work in Hibernate, because HQL as a query language does have quite a bunch of extensions.

    Need for identification variable comes obvious when query contains more than one entity with identical names of attributes:

    SELECT a.someAttribute, b.someAttribute 
    FROM EntityA a, EntityB 
    WHERE a.id = b.id
    

    As you see from the query above, identification variable are also used in WHERE clause. Following quote from JPA 2.0 specification sums up also other uses and declaration of them quite tightly:

    All identification variables used in the SELECT, WHERE, ORDER BY,
    GROUP BY, or HAVING clause of a SELECT or DELETE statement must be
    declared in the FROM clause. The identification variables used in the
    WHERE clause of an UPDATE statement must be declared in the UPDATE
    clause.

    Identification variables are existentially quantified in these
    clauses. This means that an identification variable represents a
    member of a collection or an instance of an entity’s abstract schema
    type. An identification variable never designates a collection in its
    entirety.

    An identification variable is scoped to the query (or subquery) in
    which it is defined and is also visible to any subqueries within that
    query scope that do not define an identification variable of the same
    name.

    Naming of identification variable is quite free, but it should not be any reserved identifier or name of the entity.

    You cannot use ‘SELECT *’, because JPQL does not have such a construct. It is also often considered as an anti pattern in SQL not to specify explicitly list of values to be selected. It would for example need to redefine what is selected when join is added to query.

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

Sidebar

Related Questions

Just curious about SQL syntax. So if I have SELECT itemName as ItemName, substring(itemName,
Just curious what is the best practice for solving the following issue. I have
Just curious to find out exactly what problems I'll cause myself if I include
Just curious about it... Cedric Beust created TestNG and I understand from an interview
Just curious - apart from its ubiquitous use in specifying the presentation of HTML
I am very (VERY) new to Aptana and I'm just trying to figure out
Just curious, I've noticed that some php files have extension 'class.php' or 'html.php'. What
Just curious, I'm wondering what all you experienced programmers or newbies (like me) out
Just curious, is it possible to find out, what items are generated while the
Just curious, when I imported data from a spreadsheet with 519 lines into an

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.