---
title: "No row with the given identifier exists错误解决！"
author: "yoscar"
date: "2010-06-18T12:39:52Z"
tags: ["Hibernate", "SQL"]
categories: ["企业架构"]
slug: "no-row-with-the-given-identifier-exists"
draft: false
lastmod: "2010-06-18T12:39:52Z"
id: 693824
url: "https://yoscar.iteye.com/blog/693824"
---

昨天为了统一数据库，删除了些数据，没想到把管理的数据删除了，所以报了No row with the given identifier exists的错，刚开始检查数据库映射文件，以为是有个字段弄错了，因为Hibernate的映射文件是手工写的，又检查了后台代码和sql语句，改来改去之后还是报这个错，无赖之下在网上找了原因，最后猛然想起来在统一数据库的时候删除了（user表和班级表的关联字段的值，在user表中删除了班级跟user关联的值），解决办法是在班级表中删除user表中没有的值。
另请见：http://www.iteye.com/topic/189723