I'm using hibernate automatic schema generation on my project with hibernate 5.0.1, MySQL 5.6.27 and Java 1.8.45
Everything works perfectly well, except for datetime / timestamp fields with with milliseconds. My fields annotations look like this:
Code:
@Column(name = "transition_timestamp", scale=3)
@Type(type="timestamp")
private Timestamp transitionTimestamp;
I've also tried to use length=3 and precision=3 in multiple combinations with scale=3 and nothing seems to work as I expect. The only way I can make this work, is by adding the non-portable:
Code:
@Column(name = "transition_timestamp", columnDefinition="datetime(3)")
private Timestamp transitionTimestamp;
Am I missing something or should I report this as a bug?
I've tried upgrading hibernate to v5.2.1, just in case, but I still get the same behaviour.