---
title: "hibernate中timestamp插入为null问题"
author: "softdn"
date: "2009-08-01T23:03:39Z"
tags: []
slug: "hibernate-timestamp-null"
draft: false
lastmod: "2009-08-01T23:03:58Z"
id: 437726
url: "https://softdn.iteye.com/blog/437726"
---

1，hibernate自动生成的对应表中两个非空字段insTime和updTime时间字段的映射是，java.sql.timestamp类型

     正确赋值应该是ry.setInsTime(new Timestamp(System.currentTimeMillis()));// ry：人员

     这样就不会出现null错误