code: public static java.sql.Date toSqlDate(Object value){
          if (value == null) {
              return null;
          } else if (value instanceof java.sql.Date) {
              return (java.sql.Date) value;
          } else if (value instanceof java.util.Date) {
              return new java.sql.Date(((java.util.Date) value).getTime());
          } else if (value instanceof Number) {
              return new java.sql.Date(((Number) value).longValue());
          } else {
              try {
                  return java.sql.Date.valueOf(value.toString().trim());
              } catch (IllegalArgumentException e) {
                  throw new ConversionException("failed to convert: '" + value + "' to java.sql.Date", e);
              }
          }
      }
docs: Expects a <code>java.sql.Date</code>, <code>java.sql.Timestamp</code>, <code>java.sql.Time</code>, <code>java.util.Date</code>,
  <code>Long</code> or any object whose toString method has this format: <code>yyyy-mm-dd</code>.
  
  @param value argument that is possible to convert to <code>java.sql.Date</code>.
  @return <code>java.sql.Date</code> instance representing input value.