HQL&Criteria
发布日期:2021-06-30 16:53:10
浏览次数:2
分类:技术文章
本文共 988 字,大约阅读时间需要 3 分钟。
Obviously, criteria queries are more difficult to read if they get more complex—a good reason to prefer them for dynamic and programmatic query generation, but to use externalized HQL and JPA QL for predefined queries.
A proxy is initialized if you call any method that is not the identifier getter
method, a collection is initialized if you start iterating through its elements or ifyou call any of the collection-management operations, such as size() and contains().Hibernate provides an additional setting that is mostly useful for large collections; they can be mapped as extra lazy.
@OneToMany
@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)private Set<Bid> bids = new HashSet<Bid>();
The collection is no longer
initialized if you call size(), contains(), or isEmpty()—the database is queriedto retrieve the necessary information. If it’s a Map or a List, the operations containsKey()and get() also query the database directly.转载地址:https://laurence.blog.csdn.net/article/details/5564956 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
初次前来,多多关照!
[***.217.46.12]2024年04月17日 13时33分00秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
JS中document对象和window对象有什么区别
2019-04-30
【python练习题】遍历1
2019-04-30
【matlab】显示图片且下方显示文字
2019-04-30
关于greater<int>以及类模板的一些理解
2019-04-30
对于时间复杂度的通俗理解
2019-04-30
如何输入多组数据并输出每组数据的和?
2019-04-30
基于CentOS 7的Linux常用命令行命令
2019-04-30
行阶梯型矩阵
2019-04-30
信号量机制
2019-04-30
临界资源与临界区
2019-04-30
matlab中uint8,double,im2double和im2uint8的区别
2019-04-30
数字图像处理总复习
2019-04-30
图像去噪(包含修正的阿尔法均值滤波及通用滤波方法代码)
2019-04-30
SVM进行人脸检测
2019-04-30
C++学习笔记
2019-04-30
图像处理学习笔记
2019-04-30
Machine Learning Onramp on MATLAB 学习笔记
2019-04-30
Machine Learning with MATLAB 1.1 to 2.2
2019-04-30
Learning DSP with MATLAB
2019-04-30
用MATLAB实现m序列的生成(MATLAB 2021a适用)
2019-04-30