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 · Fixed by #718
Closed

Cleanup sql literal serialization code #714

timowest opened this issue Apr 13, 2014 · 1 comment · Fixed by #718
Milestone

Comments

@timowest
Copy link
Member

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
Copy link
Member Author

timowest commented May 2, 2014

Released in 3.3.3

@timowest timowest closed this as completed May 2, 2014
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 a pull request may close this issue.

1 participant