I have to use an existing Database that I can not change that uses this column definition:
"birthdate" date NOT NULL DEFAULT '0000-00-00'
The default value is not a valid date:
Exception in thread “main” java.lang.RuntimeException: Cannot convert value ‘0000-00-00’ from column 29 to TIMESTAMP.
Is there a way to return null from ormlite if the default value '0000-00-00' is found?
The only way you can do this is with a custom persister. You can then control how ORMLite stores and retrieves data from the database. This feature is [unfortunately] not well documented.
You specify the class like this:
Then your persister class might look like:
DateType source is online. Hope this helps.