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 759517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:36:22+00:00 2026-05-14T15:36:22+00:00

I have the following construct in EJB-QL several EJB 2.1 finder methods: SELECT distinct

  • 0

I have the following construct in EJB-QL several EJB 2.1 finder methods:

SELECT distinct OBJECT(rd) FROM RequestDetail rd, DetailResponse dr 
      WHERE dr.updateReqResponseParentID is not null 
      and dr.updateReqResponseParentID = ?1 
      and rd.requestDetailID = dr.requestDetailID
      and rd.deleted is null and dr.deleted is null

IDEA’s EJB-QL inspection flags the use of the two object FROM RequestDetail rd, DetailResponse dr with an inspection which says: Several ranged variable declarations are not supported, use collection member declarations instead (e.g. IN(o.lineItems))

The queries themselves function fine (as in return the expected results) on JBoss 4.2. Is IDEA all wet here, or is there a valid issue with the query? And what is the actual preferred alternative syntax for such a query?

Edit: Thanks for the help from all those who answered, especially Romain. I reported this as an issue to JetBrains.

  • 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-05-14T15:36:23+00:00Added an answer on May 14, 2026 at 3:36 pm

    The query is fine – It looks like an IDEA Code Inspector issue.
    I cannot find any bugs logged against it as such.

    You might want to ask their support if you have the paid version.

    I did find a minor issue, in the spec for EJB 2.1 (And all others for that matter) it says to use upper case for NULL.

    11.2.6.10 Null Comparison Expressions
    The syntax for the use of the comparison operator IS NULL in a conditional expression is as follows:
    {single_valued_path_expression | input_parameter }IS [NOT ] NULL
    A null comparison expression tests whether or not the single-valued path expression or input parameter is a NULL value.

    SELECT distinct OBJECT(rd) FROM RequestDetail rd, DetailResponse dr 
          WHERE dr.updateReqResponseParentID IS NOT NULL 
          and dr.updateReqResponseParentID = ?1 
          and rd.requestDetailID = dr.requestDetailID
          and rd.deleted IS NULL and dr.deleted IS NULL
    

    Here is a section from the EJB 2.1 spec that matches your queries…

    11.2.5.3 Range Variable Declarations
    The EJB QL syntax for declaring an identification variable as a range variable is similar to that of SQL; optionally, it uses the AS keyword.

    range_variable_declaration ::= abstract_schema_name [AS ] identifier Objects or values that are related to an entity bean are typically obtained by navigation using path expressions. However, navigation does not reach all objects. Range variable declarations allow the Bean
    Provider to designate a “root” for objects which may not be reachable by navigation.
    If the Bean Provider wants to select values by comparing more than one instance of an entity bean abstract schema type, more than one identification variable ranging over the abstract schema type is needed in the FROM clause.

    The following finder method query returns orders whose quantity is greater than the order quantity for John Smith. This example illustrates the use of two different identification variables in the FROM clause, both of the abstract schema type Order. The SELECT clause of this query determines that it is the orders with quantities larger than John Smith’s that are returned.

    SELECT DISTINCT OBJECT(o1)
    FROM Order o1, Order o2
    WHERE o1.quantity > o2.quantity AND
    o2.customer.lastname = ‘Smith’ AND
    o2.customer.firstname= ‘John’
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem dealing with the following construct: SELECT * FROM X INNER
I have the following MySQL query: SELECT title, description FROM some_table WHERE MATCH (title,description)
In the constructor of an object I have the following code: ConfigReader::ConfigReader(){ TiXmlDocument doc(CONFIGURATION_FILE_LOCATION);
I have the following: <%= f.select :phase_names, options_for_select([RFP Stage, Pre Contract, Awarded, Unsuccessful, Completed]),
At work we have the following construct to enable interpreting an IP address as
This answer of mine generated some comments claiming that the following construct is not
I have the following code #include <iostream> using namespace std; class Object { public:
I have following entity (non-relevant fields/methods are removed). public class HitsStatsTotalDO { @Id transient
I have a case where I need to construct following structure programmatically (yes I
I have the following javascript object containing a multi-value email property: var contact =

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.