hibernate錯誤java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss

來源:互聯網
上載者:User

java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss

<2012-08-09 11:51:43,546> DEBUG (HibernateTemplate.java:410) [http-8095-1] (org.rd.framework.hibernate.DefaultHibernateTemplate) - Found thread-bound Session for HibernateTemplate
Hibernate: select viewdevice0_.index_field as index1_226_, viewdevice0_.equipment_no as equipment2_226_, viewdevice0_.asset_category as asset3_226_, viewdevice0_.equipment_name as equipment4_226_, viewdevice0_.equipment_state as equipment5_226_, viewdevice0_.model
as model226_, viewdevice0_.register_person as register7_226_, viewdevice0_.register_date as register8_226_, viewdevice0_.use_dept as use9_226_, viewdevice0_.use_person as use10_226_, viewdevice0_.use_person_no as use11_226_, viewdevice0_.manage_dept as manage12_226_,
viewdevice0_.manage_person as manage13_226_, viewdevice0_.fact_scrapped_date as fact14_226_, viewdevice0_.should_scraped_date as should15_226_, viewdevice0_.finance_recorded_date as finance16_226_, viewdevice0_.original_value as original17_226_, viewdevice0_.supplier
as supplier226_, viewdevice0_.make_business as make19_226_, viewdevice0_.serial_no as serial20_226_, viewdevice0_.warranty_start_date as warranty21_226_, viewdevice0_.warranty_end_date as warranty22_226_, viewdevice0_.use_date as use23_226_ from view_device
viewdevice0_
<2012-08-09 11:51:44,171> ERROR (JDBCExceptionReporter.java:78) [http-8095-1] (org.hibernate.util.JDBCExceptionReporter) - An SQLException was provoked by the following failure: java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
<2012-08-09 11:51:44,812> DEBUG (HibernateTemplate.java:435) [http-8095-1] (org.rd.framework.hibernate.DefaultHibernateTemplate) - Not closing pre-bound Hibernate Session after HibernateTemplate

原因:

manage_person是varchar2類型,我錯誤的配成了Date類型,就報這個錯誤
      <key-property name="manage_person" type="java.util.Date">
          <column name="manage_person" />
      </key-property>
改成
      <key-property name="manage_person" type="java.lang.String">
          <column name="manage_person" />
      </key-property>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.