---
title: "hibernate 未明确定义列错误"
author: "crud0906"
date: "2010-09-23T19:02:16Z"
tags: ["Hibernate", "SQL"]
categories: ["企业架构"]
slug: "hibernate"
draft: false
lastmod: "2010-09-23T19:02:16Z"
id: 769990
url: "https://crud0906.iteye.com/blog/769990"
---

今天在项目中碰到这个错误，经过初步调试找到了错误的位置，将打印出的SQL语句拿到PL/SQL里面执行，发现出现了如下问题 select \[color=darkred]this\_.Bdz\_id \[/color]as Bdz1\_480\_7\_, this\_.gis\_id as gis2\_480\_7\_, this\_.jg\_id as jg3\_480\_7\_, this\_.bianma as bianma480\_7\_, this\_.mingzi as mingzi480\_7\_, this\_.userflag as userflag480\_7\_, this\_.nosf6 as nosf7\_480\_7\_, \[color=darkred] this\_.bdz\_id \[/color]as bdz1\_480\_7\_, 对于bdz\_id字段查询了两次，所以在外层再次嵌套查询的时候会出现未明确定义列，出现此问题的原因是什么呢？经过思考，只可能是配置文件出错，详细检查后发现 而在多对一的配置时候 所以才会出现查询了两次bdz\_id,只要把两处改成一样即可