---
title: "org.hibernate.exception.ConstraintViolationException: could not insert: [com.tes"
author: "andy136566"
date: "2011-02-12T17:33:49Z"
tags: ["Hibernate", "Java", "XML"]
categories: ["企业架构"]
slug: "org-hibernate-exception-constraintviolationexception-could-not-insert-com-tes"
draft: false
lastmod: "2011-02-12T17:33:49Z"
id: 904754
url: "https://andy136566.iteye.com/blog/904754"
---

数据库中有字段设置long varchar

用hibernate工具自动生成news.hbm.xml时，该字段的属性为type="java.lang.String"

改成type="string"之后错误消失

还不知道为什么