znnevergiveup 2013-08-02 09:17
浏览 191
已采纳

hibernate 的问题啊

用DetachedCriteria类 组装查询条件,咋个生成这样的sql语句了捏? 如果没没条件的话还行 ,一加上where条件查询,就会出 where y1_.... 然后就报错:列名 'y1_' 无效。上一段打印出的sql

[code="java"]
select top 14 this_.id as y0_, this_.CODE as y1_, this_.PROJECT_NAME as y2_, this_.PROJECT_STATE as y3_, this_.PROJECT_CLASS as y4_, this_.CUSTOMER_ID as y5_, this_.CUSTOMER_DEPARTMENT_MAIN as y6_, this_.CUSTOMER_DEPARTMENT_HELP as y7_, this_.CUSTOMER_LINKMAN as y8_, this_.CUSTOMER_LINKMAN_PHONE as y9_, this_.CUSTOMER_CODE as y10_, this_.UNIT_PLAN as y11_, this_.UNIT_PLAN_LINKMAN as y12_, this_.UNIT_PLAN_LINKMAN_PHONE as y13_, this_.SUPERVISOR as y14_, this_.SUPERVISOR_LINKMAN as y15_, this_.SUPERVISOR_LINKMAN_PHONE as y16_, this_.PROJECT_CUSTODIAN as y17_, this_.PROJECT_DEPARTMENT as y18_, this_.PROJECT_DEPARTMENT_CUSTODIAN as y19_, this_.PROJECT_MANAGER as y20_, this_.SAFETY_OFFICER as y21_, this_.QUALITY_INSPECTOR as y22_, this_.LIBRARIAN as y23_, this_.BULIDERS as y24_, this_.MATERIALMAN as y25_, this_.TECHONLOGY as y26_, this_.FILE_TRANSFER as y27_, this_.BUILD_STATE as y28_, this_.COMPANYMANAGE_ID as y29_, this_.PROJECT_DATE as y30_, this_.USER_ID as y31_, this_.ACCESSORY_NAME as y32_ from project this_ where (y1_ like ? and y2_ like ?) order by y1_ desc
[/code]

  • 写回答

5条回答 默认 最新

  • zyn010101 2013-08-02 09:41
    关注

    CODE列存在么?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?