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

Add new KiwiJdbc utilities to convert from java.sql.Date to LocalDate #1044

Closed
sleberknight opened this issue Oct 5, 2023 · 0 comments · Fixed by #1052
Closed

Add new KiwiJdbc utilities to convert from java.sql.Date to LocalDate #1044

sleberknight opened this issue Oct 5, 2023 · 0 comments · Fixed by #1052
Assignees
Labels
new feature A new feature such as a new class, method, package, group of classes, etc.
Milestone

Comments

@sleberknight
Copy link
Member

sleberknight commented Oct 5, 2023

Add two new (static) methods to KiwiJdbc:

@Nullable
LocalDate localDateOrNullFromDate(ResultSet rs, String columnName) throws SQLException

@Nullable
LocalDate localDateOrNullFromDate(java.sql.@Nullable Date date)

And yes, the @Nullable annotation must be between the package and class name., otherwise the code won't compile.

I debated whether to include "OrNull" in the name, since the majority of other methods in this class don't use that convention. But they were implemented many years ago before we (informally) adopted that convention. So, I think it's better for the new methods to have more descriptive names than to remain consistent at the expense of clarity.

@sleberknight sleberknight added the new feature A new feature such as a new class, method, package, group of classes, etc. label Oct 5, 2023
@sleberknight sleberknight added this to the 3.1.0 milestone Oct 5, 2023
@sleberknight sleberknight self-assigned this Oct 5, 2023
sleberknight added a commit that referenced this issue Oct 7, 2023
Add two localDateOrNullFromDate methods, one that accepts a
ResultSet and colum name, and one that accepts a java.sql.Date.
They are both annotated with the Checker Nullable annotation to
indicate null can be returned, and also that the java.sql.Date
argument can be null as well.

Closes #1044
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature A new feature such as a new class, method, package, group of classes, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant