Community
Participate
Working Groups
Build Identifier: When using fetchgroup in a query with fetch joins, the generated sql statement does not add an alias to the columns ( Eclipselink 2.1.x, 2.2.x ) http://www.eclipse.org/forums/index.php?t=msg&th=203745&start=0&S=27fd1e9fec30586b7d9c95e5310db969 Reproducible: Always
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