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

Cleanup sql literal serialization code #714

Closed
timowest opened this issue Apr 13, 2014 · 1 comment
Closed

Cleanup sql literal serialization code #714

timowest opened this issue Apr 13, 2014 · 1 comment
Milestone

Comments

@timowest
Copy link
Member

@timowest timowest commented Apr 13, 2014

Literal serialization code is now in the SQLTemplates code https://github.com/mysema/querydsl/blob/master/querydsl-sql/src/main/java/com/mysema/query/sql/SQLTemplates.java#L368

The code uses joda times directly and doesn't use the pluggable type handling of the Configuration class.

One solution could be provide a method like this in SQLTemplates

public String serialize(String literal, int jdbcType)

In addition to this the registered Type handlers will need to provide literal serialization as well

interface Type {
    // existing methods
    int[] getSQLTypes();
    Class<T> getReturnedClass();
    T getValue(ResultSet rs, int startIndex) throws SQLException;
    void setValue(PreparedStatement st, int startIndex, T value) throws SQLException;

    // new methods
    String getLiteral(T value) (default returns value.toString())
}

This is just a proposal, feel free to comment.

@timowest timowest added this to the 3.3.3 milestone Apr 17, 2014
@timowest timowest reopened this Apr 30, 2014
@timowest timowest added the fixed label Apr 30, 2014
@timowest timowest modified the milestone: 3.3.3 Apr 30, 2014
@timowest
Copy link
Member Author

@timowest timowest commented May 2, 2014

Released in 3.3.3

@timowest timowest closed this May 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.