I am trying to use the Hibernate Console for Eclipse to model queries against a MySql 5.0 database that has timestamp fields that defaults to 0000-00-00 00:00:00. I am encounter errors since some of the default fields can't be represented as java.sql.Timestamp (see console error below).
Apparently, I need to add the mysql configuration of zeroDateTimeBehavior=convertToNull to the driver
http://forums.mysql.com/read.php?39,815 ... #msg-89052
how can I do this with the Eclipse Hibernate console?
Hibernate version:
3.1.3
Mapping documents:
<class name="com.ambientdevices.wine.hibernate.Billing" table="Billing">
<cache usage="read-write" />
<id name="billingId" type="java.lang.String">
<generator class="assigned" />
</id>
<property name="createDate"/>
<property name="modifiedDate"/>
<property name="deviceId"/>
<property name="nextBillDate"/>
<property name="weatherCity"/>
<property name="paySchedule"/>
<property name="billFullName"/>
<property name="billAddress1"/>
<property name="billAddress2"/>
<property name="billCity"/>
<property name="billState"/>
<property name="billZipcode"/>
<property name="billPhone"/>
<property name="mailBillsame"/>
<property name="mailFullName"/>
<property name="mailAddress1"/>
<property name="mailAddress2"/>
<property name="mailCity"/>
<property name="mailState"/>
<property name="mailZipcode"/>
<property name="mailPhone"/>
<property name="ccNumber"/>
<property name="ccExpMonth"/>
<property name="ccExpYear"/>
<property name="ccType"/>
<property name="lastAttemptDate"/> <!--This field is problematic at it is 0000-00-00 00:00:00 -->
</class>
Full stack trace of any exception that occurs:
Warning 2006-05-31 16:53:14.234 WARN main org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: S1009
Error 2006-05-31 16:53:14.234 ERROR main org.hibernate.util.JDBCExceptionReporter - Value '0000-00-00' can not be represented as java.sql.Timestamp
Name and version of the database you are using:
MySql 5.0