| Summary: | Changes to DatabaseField getNameForComparisons() | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Guy Pelletier <guy.pelletier> | ||||||
| Component: | Eclipselink | Assignee: | Gordon Yorke <gordon.yorke> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P2 | CC: | eclipselink.foundation-inbox, gordon.yorke, tom.ware | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
checked into trunk and 2.3 This patch has caused a regression in our metadata column name case insensitivity. Since 2.2 we have been case insensitive by default because the reported method always set and returned the 'nameForComparisons'. As JPA spec section 2.13 requires that our metadata comparisons be case insensitive we should use this patch but also ensure the useUpperCaseForComparisons is set to true by default for JPA. Not sure I understand?
The original code for this before my change was,
public String getNameForComparisons(){
if (nameForComparisons == null) {
if (!getUseUpperCaseForComparisons() || getName()== null){
return this.getName();
}
this.nameForComparisons = this.getName().toUpperCase();
}
return this.nameForComparisons;
}
Note the return, which did not use upper-case when set not to use upper case.
This fix just reverts the code to the original functionality before my initial change made Jan 19, 2011, which was always the intended functionality.
If we want to change our case defaults, that should be a different bug. This bug is just fixing a coding error.
The issue is the changes you made to the code that always uses uppercase names from comparisons was present in 2 major releases. For both those releases we correctly ignored case when comparing fields throughout the product. Now with this change 2.3.1 regresses and is again case sensitive for field comparisons. The change in this bug caused the regression. Created attachment 202685 [details]
Additional Patch
This patch should be included with the initial patch within the bug. Together they revert the code bug while continuing to support case insensitive comparisons
Additional Patch checked into 2.3.1 and trunk Created attachment 203446 [details]
Another additional patch
The "additional patch" did not actually change the default. Other changes are required to ensure EclipseLink is case insensitive by default. A combination of all 3 patches is required to resolve this issue.
Checked in trunk and 2.3.1, reviewed by Guy Pelletier The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
Not sure if the changes from revision 8851 captured the intended changes to DatabaseField getNameForComparisons() correctly? The method currently looks as follows: public String getNameForComparisons(){ if (this.nameForComparisons == null) { if ((!this.useUpperCaseForComparisons) || (this.name == null)) { this.nameForComparisons = this.name; } this.nameForComparisons = this.name.toUpperCase(); } return this.nameForComparisons; } Thinking maybe we missed an else statement on the nested if?