I have a Mysql table with a DATE column, the default is "0000-00-00". If I try to call, for example,
em.find(MyTable.class,pk_value);
and this happens to be a database record with the default date value of "0000-00-00", an exception is thrown ("java.sql.SQLException: Value ... cannot be represented as java .sql.Date ". The same error occurs for DateTime columns with the default value" 0000-00-00 00:00:00 ".
Can I tell EntityManager that such values ββare okay? Thanks.
source
share