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

Minimize String casting between SwingSet components and RowSet #17

Open
bpangburn opened this issue Dec 11, 2020 · 2 comments
Open

Minimize String casting between SwingSet components and RowSet #17

bpangburn opened this issue Dec 11, 2020 · 2 comments

Comments

@bpangburn
Copy link
Owner

Many SwingSet components use RowSetOps.getColumnText() and updateColumnText() which cast back and forth from java.sql.JDBCType (or java.sql.Types) to String. It would be preferable to eliminate unnecessary castings by storing component values in the appropriate Object type, using RowSet.updateObject() and RowSet.getObject().

@bpangburn bpangburn changed the title Mimimize String casting between components and RowSet Minimize String casting between SwingSet components and RowSet Dec 11, 2020
@errael
Copy link
Contributor

errael commented Dec 11, 2020

getBoundColumnText() is used all over, this in turn uses getColumnText()

@bpangburn
Copy link
Owner Author

getBoundColumnText() is used all over, this in turn uses getColumnText()

Not a trivial undertaking, but I think getObject() and updateObject() would be better for non-text components. I can be talked out of this and things are much cleaner than they were before with some consolidation in SSCommon and the cleanup done in SSRowSet. If we're doing something like storing a number in a text field then the casting is fine, but there are other places where it seems unnecessary to me.

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

No branches or pull requests

2 participants