-
Notifications
You must be signed in to change notification settings - Fork 358
Favor SqlIdentifier.getReference()
instead of getReference(IdentifierProcessing)
#1458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The method also fixed the bug of this method not honoring the IdentifierProcessing parameter, so the functionality is now identical to the toSql(IdentifierProcessing) method. Closes #1110
…es of getReference(identifierProcessing) as it did not do identifier processing, we call the getReference() method which does not do any.
@@ -65,8 +65,9 @@ public String toSql(IdentifierProcessing processing) { | |||
} | |||
|
|||
@Override | |||
@Deprecated(since="3.0.5", forRemoval = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should deprecate that method with the next feature release, not with a bugfix. That would be since="3.1"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it should be forRemoval = true
since we want to drop it eventually. This applies to all deprecations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will change. Wasn't sure which version we wanted - and we had just done 3.0.4
} | ||
|
||
@Override | ||
@Deprecated(since="3.0.5", forRemoval = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See deprecation notice above.
@@ -77,9 +78,12 @@ public String toString() { | |||
* Return the reference name after applying {@link IdentifierProcessing} rules. The reference name is used for | |||
* programmatic access to the object identified by this {@link SqlIdentifier}. | |||
* | |||
* @deprecated Use the toSql(IdentifierProcessing processing) method instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mind the formatting, @deprecated
comes after @return
, we should also include that the deprecation will be since 3.1
in place (@deprecated since 3.1, use the #getReference() method instead.
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the replacement is getReference()
not toSql(IdentifierProcessing)
SqlIdentifier.getReference()
instead of getReference(IdentifierProcessing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some more comments and also chatted with Mark, so we all pull in the same direction.
Please add your changes addressing the comments as an additional commit and ping me once your done.
@@ -90,7 +94,7 @@ public String toString() { | |||
* @see IdentifierProcessing#NONE | |||
*/ | |||
default String getReference() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please give this a proper JavaDoc comment.
After talking to Mark I now again understand what the getReference
vs toSql
is about.
toSql
is to be used when rendering an identifier in SQL, as in select id from someTable
getReference
is used when accessing a column in a ResultSet
here we must not apply any quoting.
This should be reflected in the JavaDoc comments of the two methods.
@@ -77,9 +78,12 @@ public String toString() { | |||
* Return the reference name after applying {@link IdentifierProcessing} rules. The reference name is used for | |||
* programmatic access to the object identified by this {@link SqlIdentifier}. | |||
* | |||
* @deprecated Use the toSql(IdentifierProcessing processing) method instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the replacement is getReference()
not toSql(IdentifierProcessing)
This is polished and merged. I know I wrote in some textbox, that we shouldn't change the behaviour of Anyway, I undid that change and also added you in `@author tags. |
Change to deprecate redundant getReference(IdentifierProcessing) method.
I split out the commits to make this change easier to review.
The first commit after the branch preparation outlines the changes to actual implementation. Second commit is Unit Tests supporting change, and third commit is change/eliminate all usages of the deprecated API.
I fixed the implementation of the deprecated method to actually use the IdentifierProcessing parameter. If we want to leave the implementation unchanged, please let me know.
Will squash commits after making any other needed changes.