| Summary: | Column alias missing when using fetch groups with join fetching | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | attila Mising name <mathe_attila> |
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> |
| Status: | NEW --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | tinhol, tom.ware |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows Vista | ||
| Whiteboard: | |||
|
Description
attila Mising name
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Community: Please vote for this bug if it is important to you. Votes are one of the main criteria we use to determine which bugs to fix next. Hello,
I have reproduced the bug on version 2.6.0
I think, I know how to fix it.
If you look at org.eclipse.persistence.expressions.Expression#writeField method, you see the following
//bug6070214: unique field aliases need to be generated when required.
if (statement.getUseUniqueFieldAliases()){
printer.printString(" AS " + statement.generatedAlias(field.getNameDelimited(printer.getPlatform())));
}
This code adds unique alias for the field. It looks fine, but the org.eclipse.persistence.expressions.Expression#writeField method is overriden in subclass org.eclipse.persistence.internal.expressions.FieldExpression. The subclass does not have the above logic in it, so it does not add aliases to fields from fetch group.
So if you add the above logic to org.eclipse.persistence.internal.expressions.FieldExpression#writeField - sql contains the appropriate aliases.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |