Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311388 - EclipseLink case sensitive alias
Summary: EclipseLink case sensitive alias
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-03 11:52 EDT by njrfrens CLA
Modified: 2022-06-09 10:36 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description njrfrens CLA 2010-05-03 11:52:05 EDT
Build Identifier: 2.0.1

I am having a strange problem with EclipseLink

For an Entity having collection
class Department {
  List<Employee> employees;
}

If I use the below query
  SELECT dePartment
  FROM Department dePartment
  LEFT JOIN FETCH dePartment.employees
  LEFT JOIN dePartment.employees emps
 
It is fetching only dePartment entities without the child collection.
If I use alias name as department instead of dePartment(observe the case of letter P), then it is fetching the child collection also.

Is the alias name case sensitive? sounds like a bug

Reproducible: Always

Steps to Reproduce:
1.Configure EclipseLink and Entities
2.Run the query as mentioned in the Details
3.
Comment 1 Tom Ware CLA 2010-05-03 13:14:08 EDT
Please be explicity about how you use department.

Specifically, what does the successful query look like?  What does the unsuccessful query look like?
Comment 2 njrfrens CLA 2010-05-03 15:29:18 EDT
From clause is same for both the queries.

If I use alias as dePartment,
then in Select clause, it is listing the columns of Department table only.

If I use alias as department,
then in Select clause, it is listing the columns of both Department and Employee table.
Comment 3 Tom Ware CLA 2010-05-03 15:50:54 EDT
Let me try to paraphrase to see if I understand your behavior.

Are you saying that the following query:

  SELECT dePartment
  FROM Department dePartment
  LEFT JOIN FETCH dePartment.employees
  LEFT JOIN dePartment.employees emps

1. Runs successfully
2. Returns values of type Department
3. Runs an extra query when you try to navigate to the employees of the
department?


And the following query:

  SELECT department
  FROM Department dePartment
  LEFT JOIN FETCH dePartment.employees
  LEFT JOIN dePartment.employees emps

1. Runs successfully
2. Returns values of type Department
3. Does not run an extra query when you try to navigate to the employees of the
department?

Please correct what I have misundstood and add anything I am missing
Comment 4 njrfrens CLA 2010-05-03 18:37:11 EDT
Yes your understanding is correct.

But the second query is like below(observe the lowercase p in department)
  SELECT department
  FROM Department department
  LEFT JOIN FETCH department.employees
  LEFT JOIN department.employees emps
Comment 5 Tom Ware CLA 2010-05-13 09:54:07 EDT
Setting target and priority.  See the following page for details of what these
values mean.

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:36:00 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink