Hibernate version: 2.0
Mapping documents:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="netspace.datastore.porta.to.Customer" table="Customers"
dynamic-insert="true" dynamic-update="true">
<id name="id" type="long" column="i_customer">
<generator class="native"/>
</id>
<property name="refNum" type="string">
<column name="refnum"/>
</property>
<property name="name" type="string">
<column name="name"/>
</property>
<property name="timeStamp" type="java.util.Date">
<column name="timestamp"/>
</property>
<property name="balance" type="float">
<column name="balance"/>
</property>
<property name="currency" type="currency">
<column name="iso_4217"/>
</property>
<property name="companyName" type="string">
<column name="companyname"/>
</property>
<property name="salutation" type="string">
<column name="salutation"/>
</property>
<property name="firstName" type="string">
<column name="firstname"/>
</property>
<property name="middleInitial" type="string">
<column name="midinit"/>
</property>
<property name="lastName" type="string">
<column name="lastname"/>
</property>
<property name="businessAddress1" type="string">
<column name="baddr1"/>
</property>
<property name="businessAddress2" type="string">
<column name="baddr2"/>
</property>
<property name="businessAddress3" type="string">
<column name="baddr3"/>
</property>
<property name="businessAddress4" type="string">
<column name="baddr4"/>
</property>
<property name="businessAddress5" type="string">
<column name="baddr5"/>
</property>
<property name="city" type="string">
<column name="city"/>
</property>
<property name="state" type="string">
<column name="state"/>
</property>
<property name="postCode" type="string">
<column name="zip"/>
</property>
<property name="country" type="string">
<column name="country"/>
</property>
<property name="note" type="string">
<column name="note"/>
</property>
<property name="contact1" type="string">
<column name="cont1"/>
</property>
<property name="phone1" type="string">
<column name="phone1"/>
</property>
<property name="fax" type="string">
<column name="faxnum"/>
</property>
<property name="phone2" type="string">
<column name="phone2"/>
</property>
<property name="contact2" type="string">
<column name="cont2"/>
</property>
<property name="email" type="string">
<column name="email"/>
</property>
<property name="bcc" type="string">
<column name="bcc"/>
</property>
<property name="sendStatistics" type="string">
<column name="send_statistics"/>
</property>
<property name="login" type="string">
<column name="login"/>
</property>
<property name="password" type="string">
<column name="password"/>
</property>
<property name="customerType" type="long">
<column name="i_customer_type"/>
</property>
<property name="billingPeriod" type="integer">
<column name="i_billing_period"/>
</property>
<property name="creditLimit" type="float">
<column name="credit_limit"/>
</property>
<property name="creditCard" type="long">
<column name="i_credit_card"/>
</property>
<property name="environment" type="integer">
<column name="i_env"/>
</property>
<property name="template" type="long">
<column name="i_template"/>
</property>
<property name="taxId" type="string">
<column name="tax_id"/>
</property>
<property name="paymentTerm" type="long">
<column name="i_payment_term"/>
</property>
<property name="blocked" type="yes_no">
<column name="blocked"/>
</property>
<property name="ppmEnabled" type="yes_no">
<column name="ppm_enabled"/>
</property>
<property name="representative" type="long">
<column name="i_rep"/>
</property>
<property name="drmEnabled" type="yes_no">
<column name="drm_enabled"/>
</property>
<property name="maxAbbreviatedLength" type="integer">
<column name="max_abbreviated_length"/>
</property>
<property name="passwordTimeStamp" type="java.util.Date">
<column name="password_timestamp"/>
</property>
<property name="outDateFormat" type="string">
<column name="out_date_format"/>
</property>
<property name="outTimeFormat" type="string">
<column name="out_time_format"/>
</property>
<property name="outDateTimeFormat" type="string">
<column name="out_date_time_format"/>
</property>
<property name="inDateFormat" type="string">
<column name="in_date_format"/>
</property>
<property name="inTimeFormat" type="string">
<column name="in_time_format"/>
</property>
<property name="onlinePaymentProcessor" type="integer">
<column name="i_online_payment_processor"/>
</property>
<property name="merchantAccountPassword" type="string">
<column name="merch_acc_password"/>
</property>
<property name="merchantAccountLogin" type="string">
<column name="merch_acc_login"/>
</property>
<property name="reccuringEnabled" type="yes_no">
<column name="reccuring_enabled"/>
</property>
<property name="testMode" type="yes_no">
<column name="test_mode"/>
</property>
<property name="acl" type="long">
<column name="i_acl"/>
</property>
<property name="openingBalance" type="float">
<column name="opening_balance"/>
</property>
<property name="minAllowedPayment" type="float">
<column name="min_allowed_payment"/>
</property>
<property name="merchantAccountCurrency" type="string">
<column name="merch_acc_iso_4217"/>
</property>
<property name="language" type="string">
<column name="i_lang"/>
</property>
<property name="cldTranslationRule" type="string">
<column name="cld_translation_rule"/>
</property>
<property name="creditLimitWarning" type="string">
<column name="credit_limit_warning"/>
</property>
<property name="callShopEnabled" type="yes_no">
<column name="callshop_enabled"/>
</property>
<property name="billedTo" type="java.util.Date">
<column name="billed_to"/>
</property>
<property name="routingPlan" type="long">
<column name="i_routing_plan"/>
</property>
<property name="volumeDiscountPlan" type="long">
<column name="i_vd_plan"/>
</property>
<property name="creationDate" type="java.util.Date">
<column name="creation_date"/>
</property>
<property name="cliInTranslationRule" type="string">
<column name="cli_in_translation_rule"/>
</property>
<property name="musicOnHold" type="long">
<column name="i_moh"/>
</property>
<many-to-one name="tariff" column="i_tariff"
class="netspace.datastore.porta.to.Tariff"/>
<many-to-one name="tariffIncoming" column="i_tariff_incoming"
class="netspace.datastore.porta.to.Tariff"/>
<many-to-one name="timeZone" column="i_time_zone"
class="netspace.datastore.porta.to.TimeZone"/>
<many-to-one name="parent" column="i_parent"
class="netspace.datastore.porta.to.Customer"/>
</class>
</hibernate-mapping>
Relevent section:Code:
<property name="timeStamp" type="java.util.Date">
<column name="timestamp"/>
</property>
Full stack trace of any exception that occurs:Code:
2005-12-08 16:15:17,104 [main] (JDBCExceptionReporter.java:57) WARN net.sf.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: S1009
2005-12-08 16:15:17,104 [main] (JDBCExceptionReporter.java:57) WARN net.sf.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: S1009
2005-12-08 16:15:17,105 [main] (JDBCExceptionReporter.java:58) ERROR net.sf.hibernate.util.JDBCExceptionReporter - Cannot convert value '0000-00-00 00:00:00' from column 10 to TIMESTAMP.
2005-12-08 16:15:17,105 [main] (JDBCExceptionReporter.java:58) ERROR net.sf.hibernate.util.JDBCExceptionReporter - Cannot convert value '0000-00-00 00:00:00' from column 10 to TIMESTAMP.
2005-12-08 16:15:17,109 [main] (JDBCExceptionReporter.java:57) WARN net.sf.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: S1009
2005-12-08 16:15:17,109 [main] (JDBCExceptionReporter.java:57) WARN net.sf.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: S1009
2005-12-08 16:15:17,110 [main] (JDBCExceptionReporter.java:58) ERROR net.sf.hibernate.util.JDBCExceptionReporter - Cannot convert value '0000-00-00 00:00:00' from column 10 to TIMESTAMP.
2005-12-08 16:15:17,110 [main] (JDBCExceptionReporter.java:58) ERROR net.sf.hibernate.util.JDBCExceptionReporter - Cannot convert value '0000-00-00 00:00:00' from column 10 to TIMESTAMP.
2005-12-08 16:15:17,111 [main] (DAOException.java:35) FATAL netspace.datastore.porta.dao.exception.DAOException - Error finding: Unable to perform find
HBBaseDAO.java netspace.datastore.porta.dao.hibernate.HBBaseDAO find (96)
HBBatchDAO.java netspace.datastore.porta.dao.hibernate.HBBatchDAO find (45)
HBBatchDAOTest.java netspace.tests.netspace.datastore.porta.dao.HBBatchDAOTest testFind (82)
NativeMethodAccessorImpl.java sun.reflect.NativeMethodAccessorImpl invoke0 (-2)
NativeMethodAccessorImpl.java sun.reflect.NativeMethodAccessorImpl invoke (39)
DelegatingMethodAccessorImpl.java sun.reflect.DelegatingMethodAccessorImpl invoke (25)
Method.java java.lang.reflect.Method invoke (585)
MethodHelper.java org.testng.internal.MethodHelper invokeMethod (352)
Invoker.java org.testng.internal.Invoker invokeMethod (343)
Invoker.java org.testng.internal.Invoker invokeTestMethods (509)
TestMethodWorker.java org.testng.internal.TestMethodWorker run (90)
TestRunner.java org.testng.TestRunner privateRun (620)
TestRunner.java org.testng.TestRunner run (503)
SuiteRunner.java org.testng.SuiteRunner privateRun (200)
SuiteRunner.java org.testng.SuiteRunner run (126)
TestNG.java org.testng.TestNG run (285)
TestNG.java org.testng.TestNG privateMain (372)
TestNG.java org.testng.TestNG main (321)
Name and version of the database you are using:MySQL 4.0.21
The generated SQL (show_sql=true):Code:
select this.i_batch as i_batch4_, this.name as name4_, this.iso_4217 as iso_42174_, this.description as descript4_4_, this.i_env as i_env4_, this.i_customer as i_customer4_, customer1_.i_customer as i_customer0_, customer1_.refnum as refnum0_, customer1_.name as name0_, customer1_.timestamp as timestamp0_, customer1_.balance as balance0_, customer1_.iso_4217 as iso_42170_, customer1_.companyname as companyn7_0_, customer1_.salutation as salutation0_, customer1_.firstname as firstname0_, customer1_.midinit as midinit0_, customer1_.lastname as lastname0_, customer1_.baddr1 as baddr10_, customer1_.baddr2 as baddr20_, customer1_.baddr3 as baddr30_, customer1_.baddr4 as baddr40_, customer1_.baddr5 as baddr50_, customer1_.city as city0_, customer1_.state as state0_, customer1_.zip as zip0_, customer1_.country as country0_, customer1_.note as note0_, customer1_.cont1 as cont10_, customer1_.phone1 as phone10_, customer1_.faxnum as faxnum0_, customer1_.phone2 as phone20_, customer1_.cont2 as cont20_, customer1_.email as email0_, customer1_.bcc as bcc0_, customer1_.send_statistics as send_st29_0_, customer1_.login as login0_, customer1_.password as password0_, customer1_.i_customer_type as i_custo32_0_, customer1_.i_billing_period as i_billi33_0_, customer1_.credit_limit as credit_34_0_, customer1_.i_credit_card as i_credi35_0_, customer1_.i_env as i_env0_, customer1_.i_template as i_template0_, customer1_.tax_id as tax_id0_, customer1_.i_payment_term as i_payme39_0_, customer1_.blocked as blocked0_, customer1_.ppm_enabled as ppm_ena41_0_, customer1_.i_rep as i_rep0_, customer1_.drm_enabled as drm_ena43_0_, customer1_.max_abbreviated_length as max_abb44_0_, customer1_.password_timestamp as passwor45_0_, customer1_.out_date_format as out_dat46_0_, customer1_.out_time_format as out_tim47_0_, customer1_.out_date_time_format as out_dat48_0_, customer1_.in_date_format as in_date49_0_, customer1_.in_time_format as in_time50_0_, customer1_.i_online_payment_processor as i_onlin51_0_, customer1_.merch_acc_password as merch_a52_0_, customer1_.merch_acc_login as merch_a53_0_, customer1_.reccuring_enabled as reccuri54_0_, customer1_.test_mode as test_mode0_, customer1_.i_acl as i_acl0_, customer1_.opening_balance as opening57_0_, customer1_.min_allowed_payment as min_all58_0_, customer1_.merch_acc_iso_4217 as merch_a59_0_, customer1_.i_lang as i_lang0_, customer1_.cld_translation_rule as cld_tra61_0_, customer1_.credit_limit_warning as credit_62_0_, customer1_.callshop_enabled as callsho63_0_, customer1_.billed_to as billed_to0_, customer1_.i_routing_plan as i_routi65_0_, customer1_.i_vd_plan as i_vd_plan0_, customer1_.creation_date as creatio67_0_, customer1_.cli_in_translation_rule as cli_in_68_0_, customer1_.i_moh as i_moh0_, customer1_.i_tariff as i_tariff0_, customer1_.i_tariff_incoming as i_tarif71_0_, customer1_.i_time_zone as i_time_72_0_, customer1_.i_parent as i_parent0_, tariff2_.i_tariff as i_tariff1_, tariff2_.name as name1_, tariff2_.period as period1_, tariff2_.currency as currency1_, tariff2_.free_sec as free_sec1_, tariff2_.connect_fee as connect_6_1_, tariff2_.login_fee as login_fee1_, tariff2_.i_env as i_env1_, tariff2_.description as descript9_1_, tariff2_.post_call_surcharge as post_ca10_1_, tariff2_.i_tariff_template_upload as i_tarif11_1_, tariff2_.i_tariff_template_download as i_tarif12_1_, tariff2_.short_description as short_d13_1_, tariff2_.routing_ext as routing14_1_, tariff2_.volume_based as volume_15_1_, tariff2_.rounding as rounding1_, tariff2_.formula as formula1_, tariff2_.i_customer as i_customer1_, tariff2_.i_dest_group_set as i_dest_19_1_, tariff3_.i_tariff as i_tariff2_, tariff3_.name as name2_, tariff3_.period as period2_, tariff3_.currency as currency2_, tariff3_.free_sec as free_sec2_, tariff3_.connect_fee as connect_6_2_, tariff3_.login_fee as login_fee2_, tariff3_.i_env as i_env2_, tariff3_.description as descript9_2_, tariff3_.post_call_surcharge as post_ca10_2_, tariff3_.i_tariff_template_upload as i_tarif11_2_, tariff3_.i_tariff_template_download as i_tarif12_2_, tariff3_.short_description as short_d13_2_, tariff3_.routing_ext as routing14_2_, tariff3_.volume_based as volume_15_2_, tariff3_.rounding as rounding2_, tariff3_.formula as formula2_, tariff3_.i_customer as i_customer2_, tariff3_.i_dest_group_set as i_dest_19_2_, timezone4_.i_time_zone as i_time_z1_3_, timezone4_.iso_3166_1_a2 as iso_31662_3_, timezone4_.TZ as TZ3_, timezone4_.comments as comments3_, timezone4_.format as format3_ from Batch this left outer join Customers customer1_ on this.i_customer=customer1_.i_customer left outer join Tariffs tariff2_ on customer1_.i_tariff=tariff2_.i_tariff left outer join Tariffs tariff3_ on customer1_.i_tariff_incoming=tariff3_.i_tariff left outer join Time_Zones timezone4_ on customer1_.i_time_zone=timezone4_.i_time_zone where this.i_batch=?
Debug level Hibernate log excerpt:
not sure..
Hey,
I have a column named 'timestamp' that is actually a DATETIME() field (it's out of my control that it is called timestamp, or I would rename it). Anyway, for some reason Hibernate (or possibly JDBC) tries to set this up as a timestamp (perhaps being too smart for it's own good..) - obviously this fails as it's not a MySQL timestamp column. The same table has another column that is called "password_timestamp" that is also a DATETIME() field, this column has NO ISSUES - which is what lead me to believe it was the name of the column that caused the issues. I have also tried using the sql-type setting to no avail. Any help with this issue would be appreciated, I am at loose ends!
Cheers,
David