Created
October 20, 2016 13:34
-
-
Save wmuron/709f87f70d44e2f736b36f896f1cd4f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.hibernate.type.DateType; | |
public class UtcDateType extends DateType { | |
private static final TimeZone UTC = TimeZone.getTimeZone("UTC"); | |
@Override | |
public Object get(ResultSet rs, String name) throws SQLException { | |
return rs.getDate(name, Calendar.getInstance(UTC)); | |
} | |
@Override | |
public void set(PreparedStatement st, Object value, int index) throws SQLException{...} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment