registerColumnType( Types.TIMESTAMP, "datetime(6)" ); registerColumnType( Types.JAVA_OBJECT, "json" ); registerFunction( "now", currentTimestampFunction ); registerFunction( "current_timestamp", currentTimestampFunction ); registerFunction( "localtime", currentTimestampFunction ); registerFunction( "localtimestamp", currentTimestampFunction ); registerFunction( "sysdate", new StaticPrecisionFspTimestampFunction( "sysdate", 6 ) );
public MySQL57InnoDBDialect() { super(); // For details about MySQL 5.7 support for fractional seconds // precision (fsp): http://dev.mysql.com/doc/refman/5.7/en/fractional-seconds.html // Regarding datetime(fsp), "The fsp value, if given, must be // in the range 0 to 6. A value of 0 signifies that there is // no fractional part. If omitted, the default precision is 0. // (This differs from the standard SQL default of 6, for // compatibility with previous MySQL versions.)". // The following is defined because Hibernate currently expects // the SQL 1992 default of 6 (which is inconsistent with the MySQL // default). registerColumnType( Types.TIMESTAMP, "datetime(6)" ); // MySQL 5.7 brings JSON native support with a dedicated datatype. // For more details about MySql new JSON datatype support, see: // https://dev.mysql.com/doc/refman/5.7/en/json.html registerColumnType( Types.JAVA_OBJECT, "json" ); }
@Override public String getTableTypeString() { return " DEFAULT CHARACTER SET utf8 COLLATE utf8_bin" + super.getTableTypeString(); } }