An user reported that there's no convenience method from XMLGregorianCalendar to java.sql.Timestamp. Given that Timestamp is a JDK class, perhaps we could define one more helper method like this?
public Timestamp toTimestamp() {
// default implementation for backward compatibility.
// implementation can override this if it wants to make it faster.
return new Timestamp(toGregorianCalendar().getTimeInMillis());
}
public Timestamp toTimestamp() {
// default implementation for backward compatibility.
// implementation can override this if it wants to make it faster.
return new Timestamp(toGregorianCalendar().getTimeInMillis());
}