---
title: "hibernate插入时间默认不支持时分秒的小bug"
author: "jusescn"
date: "2009-07-10T15:07:09Z"
tags: []
slug: "hibernate-bug"
draft: false
lastmod: "2009-07-10T15:07:09Z"
id: 423345
url: "https://jusescn.iteye.com/blog/423345"
---

hibernate插入时间默认不支持时分秒的小bug

hibernate 默认date使用的是 java.text.date格式。这种格式不支持时分秒。

解决办法：将hibernate的 pojo对应的 .hbm.xml文件中的 date类型改为

java.util.date类型就可以解决了