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

ArgPreparedStatementSetter: extract setValue(ps, position, value) [SPR-3978] #8658

Closed
spring-projects-issues opened this issue Oct 15, 2007 · 0 comments
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Oct 15, 2007

Stepan Koltsov opened SPR-3978 and commented

Please extract protected method


void setValue(ps, position, value)


from method


void setValues(ps)


of class ArgPreparedStatementSetter.

This refactoring is needed to support custom type unmappers. For example if I want JdbcTemplate to support joda-time types, I could subclass APSS and override setValue(ps, position, value) as


void setValue(ps, position, value) {
if (value instanceof org.joda.time.DateTime) {
ps.setTimestamp(new Timestamp(((DateTime) value).getTime());
} else {
super.setValue(ps, position, value);
}
}


Another use case is for various workarounds around buggy SQL drivers (I had problems with MSSQL's one).

This issue relates to #8657.


Affects: 2.1 M3

Referenced from: commits 3faf28e, e27330e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant