使用Hibernate的 isNotEmpty( ) 方法 报错: No result defined .... and result dataAccessFailure
数据访问失败
出错代码:
cardy.add(Restrictions.isNotEmpty("grade.cardtype.cardtype"));
try...catch之后发现报了一个更细节的错: does not reference a collection
原因: isNotEmpty( )需要对象的属性是集合,而cardtype只是一个对象引用
解决: 用isNotNull( ) 方法
控制台打印sql时也多了一个条件:
this_.CARDTYPE is not null
使用Hibernate的 isNotEmpty( ) 方法 报错: No result defined .... and result dataAccessFailure的更多相关文章
- vs中正常IIS发布网站后css样式、图片丢失jQuery报错 $ is not defined
问题描述: VS运行能够正常看到样式和图片 ,IIS发布后样式丢失.图片不显示.并且jQuery报错“$ is not defined”. 问题分析: 1.首先怀疑是样式文件.图片等发布的时候没有发布 ...
- idea hibernate console 执行hql报错
报错信息 hql> select a from GDXMZD a[2019-08-29 13:45:01] org.hibernate.service.spi.ServiceException: ...
- apache include 文件包含引用的方法 报错 [an error occurred while processing this directive]
今天遇到在某平台买的虚拟主机服务器不支持 下面的这样的写法 <!--#Include file="/templets/2013new/header.htm"--> ...
- git push报错:error: RPC failed; result=22, HTTP code = 413
新项目推送到服务器时报错: error: RPC failed; result=22, HTTP code = 413| 7.66 MiB/s fatal: The remote end hun ...
- Hibernate常出现的报错
刚开始学习hibernate的时候,第一次就遇到了空指针异常,结果是我的配置文件处理错误(主要是数据库表的字段与就java实体类的属性名单词写错了):一般是报空指针异常的话,多半是配置文件的问题. 但 ...
- Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister报错解决办法
在做Hibernate框架数据库的关联关系映射练习中出现了Could not get constructor for org.hibernate.persister.entity.SingleTabl ...
- Hibernate实现limit查询报错 :unexpected token: limit near line 1, column 33 [from pojo.Product p order by id limit ?,? ]
原因: hibernate无法识别limit, hql语句更不能这样写String hql="from Product p order by id limit ?,? "; 解决 ...
- hibernate+spring+tomcat启动报错Not supported by BasicDataSource
最近使用hibernate+spring+jsp的小项目制作过程中出现一些错误,例如: java.lang.UnsupportedOperationException: Not supported b ...
- hibernate jpa 2.0 报错Hibernate cannot unwrap interface java.sql.Connection
今天在做报表的时候,利用Hibernate JPA 2.0需要获取数据库连接com.sql.Connection的时候获取不到,网上说用这种方式解决: entityManager.getTransac ...
随机推荐
- Basic Tutorials of Redis(4) -Set
This post will introduce you to some usages of Set in Redis.The Set is a unordered set,it means that ...
- 【MVVM Light】Messager的使用
一.前言 在MVVM编程的模式中,有时候我们会遇到一个很尴尬的情况: 若干个xaml.cs都复用一个ViewModel,当ViewModel想传递一个特定的消息给某一个xaml.cs的时候 ...
- Navisworks 2014 Api 简单的使用
初次接触Navisworks Api .NET 的二次开发.主要是研究了一下.关于NavisWorks 结构树的加载. void LoadModel() { //清空当前的结构树信息 treeVie ...
- Is-A,Has-A,Use-A(转载)
原文地址:http://blog.csdn.net/loveyou128144/article/details/4749576 而Is-A,Has-A,Use-A则是用来描述类与类之间关系的.简单的说 ...
- 节日来了发个HTML5红包
效果图: 请关注微信公众号 何问起 , 账号ihewenqi ,或者微信扫描下图二维码: 关注后发送 愚人节 ,或 微信节日红包 ,可以体验效果. 代码如下: <!DOCTYPE html> ...
- 移动web开发调试工具AlloyLever介绍
简介 web调试有几个非常频繁的刚需:看log.看error.看AJAX发包与回包.其他的如timeline和cookie以及localstorage就不是那么频繁,但是AlloyLever都支持.如 ...
- js实现无缝循环滚动
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Linux 学习
远程登录Linux(05) 文本方式远程: putty SecureCRT winSCP SshClient图形方式远程:Xmanager Xming ifconfigps -ef | gr ...
- xcode8 storyboard 控件显示错位
升级xcode8 后选择device 为6s 出现上面的情况,控件显示异常.使用Update Frame 显示正常.不能选择Update Constraints 如果误选 commend + Z ...
- android 自定义控件——(三)水平线、虚线
----------------------------------View虚线或者直线(源代码下有属性解释)--------------------------------------------- ...