---
title: "解决org.hibernate.exception.SQLGrammarException:could not insert"
author: "xiaofengxbf"
date: "2013-11-14T22:40:05Z"
tags: []
categories: ["数据库"]
slug: "org-hibernate-exception-sqlgrammarexception-could-not-insert"
draft: false
lastmod: "2013-11-14T22:40:05Z"
id: 1974927
url: "https://xiaofengxbf.iteye.com/blog/1974927"
---

在用hibernate做开发时，有时候会遇到org.hibernate.exception.SQLGrammarException:could not insert这样的错误。

错误原因：一般是数据库表中的字段包含了数据库的关键字（保留字）

处理方法：修改数据库中和关键字产生冲突的字段名，重新映射字段名和bean中的类名