Skip to content
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

optimize map columns 2 properties code #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liony
Copy link

@liony liony commented Jan 30, 2019

String getColumnLabel(int column) throws SQLException
Gets the designated column's suggested title for use in printouts and displays. The suggested title is usually specified by the SQL AS clause. If a SQL AS is not specified, the value returned from getColumnLabel will be the same as the value returned by the getColumnName method. --from jdk1.6 javadoc

String getColumnLabel(int column) throws SQLException
Gets the designated column's suggested title for use in printouts and displays. The suggested title is usually specified by the SQL AS clause. If a SQL AS is not specified, the value returned from getColumnLabel will be the same as the value returned by the getColumnName method.       --from jdk1.6 javadoc
@@ -465,9 +465,6 @@ protected Method getWriteMethod(final Object target, final PropertyDescriptor pr

for (int col = 1; col <= cols; col++) {
String columnName = rsmd.getColumnLabel(col);
if (null == columnName || 0 == columnName.length()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using "columnName.isEmpty()" instead of "0 == columnName.length()"
May you please add a unit test?

Copy link
Member

@garydgregory garydgregory Mar 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole patch seems redundant with what JDBC specifies as the behavior for getColumnLabel(). What am I missing? This patch is workaround for buggy JDBC drivers?

VanniMaceria added a commit to VanniMaceria/progetto-software-dependability that referenced this pull request Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants