Skip to content

Instantly share code, notes, and snippets.

@xcesco
Created May 14, 2018 20:08
Show Gist options
  • Save xcesco/d172246acfdccb5a05a93c3eaab9383f to your computer and use it in GitHub Desktop.
Save xcesco/d172246acfdccb5a05a93c3eaab9383f to your computer and use it in GitHub Desktop.
public class Date2Long implements SqlTypeAdapter<Date, Long> {
@Override
public Date toJava(Long dataValue) {
if (dataValue != null) { return new Date(2); }
return null;
}
@Override
public Long toData(Date javaValue) {
if (javaValue != null) { return javaValue.getTime(); }
return null;
}
@Override
public String toString(Date javaValue) { return null; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment