1. 如何保存双向关联
When you update a bidirectional association you must update both ends.
parent.getChildren().add(child);
child.setParent(parent);
2. persisit和save的区别
Both methods make a transient instance persistent. However, the persist() method doesn't guarantee that the identifier value will be assigned to the persistent instance immediately, the assignment might happen at flush time.
The persist() method also guarantees that it will not execute an INSERT statement if it is called outside of transaction boundaries. This is useful in long-running conversations with an extended Session/persistence context.
The save() method does not guarantee the same, it returns an identifier, and if an INSERT has to be executed to get the identifier (e.g. "identity" generator, not "sequence"), this INSERT happens immediately, no matter if you are inside or outside of a transaction. This is not good in a long-running conversation with an extended Session/persistence context.
persist不会立即执行insert语句, 也不会立即返回identity.save相反, 很及时.
3. Hibernate是否支持视图
支持视图
4. 二级缓存second level cache是不同于query cache的, 二级缓存主要被用于get(), load(), 查询缓存 must use the query cache to cache HQL, SQL, or criteria query result sets.
分享到:
相关推荐
本资源"Common-problems-of-the-C-language.zip_The Common"旨在帮助新手解决这些常见问题,从而更高效地学习和理解C语言。 1. **内存管理**:C语言提供了动态内存分配功能,如`malloc()`、`calloc()`、`realloc()`...
C++ Gotchas Avoiding Common Problems in Coding and Design 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
the Little Book of Common Sense Investing
The Certified Software Tester (CSTE) program was developed by leading software testing professionals as a means of recognizing software testers who demonstrate a predefined level of testing ...
Given very few images containing a common object of interest under severe variations in appearance, we detect the common object and provide a compact visual representation of that object, depicted by ...
The greatest common divisor of integers x and y is the largest integer that evenly divides both x and y. Write a recursive function gcd that returns the greatest common divisor of x and y, define ...
These are the most common problems you encounter when you deal with data. You will get real world practice, with real world data. I'll teach you how to "think" in SQL, how to analyze data problems, ...
However, their most common link is that they are usually hidden in people's heads or in the back pages of space-constrained conference papers. As a result newcomers to the field waste much time ...
《Detect-the-common-of-images-master源码解析》 在信息技术领域,图像处理与计算机视觉是至关重要的组成部分,它们广泛应用于人脸识别、自动驾驶、智能监控等多个场景。本篇将详细解析"Detect-the-common-of-...
The Common Language Infrastructure Annotated Standard
《hibernate-common-annotations.jar:Hibernate ORM框架中的核心注解库详解》 在Java世界里,ORM(Object-Relational Mapping)框架是连接数据库与应用程序的重要桥梁,而Hibernate作为其中的佼佼者,深受广大...
钱德拉塞卡晚年写给普通读者看的自然哲学的数学的原理,英文原版
- **Startup and Helpers**: This section covers the initialization of Hibernate and the use of helper classes to simplify common tasks. - **Loading and Storing Objects**: Finally, you'll learn how to ...
the processing of data is still at the core of our systemsand all the more as the volume of data under management seems to be increasing even faster than the speed of processors. The most vital ...
The book covers a large number of the most common interview problems, as well as Ruby implementations of all major data structures and algorithms. All code has been thoroughly tested, and is written ...
a minimum mean square error (MMSE) estimator is an estimation method which minimizes the mean square error (MSE) of the fitted values of a dependent variable, which is a common measure of estimator ...
Common Design Patterns for Symbian OS: The Foundations of Smartphone Software Paperback: 444 pages Publisher: Wiley (December 3, 2008) Language: English ISBN-10: 0470516356 ISBN-13: 978-0470516355 ...
中国人群长QT综合征患者的基因型-表型分析以及基于家系成员ECG特点的基因分型预测,高元丰,刘文玲,目的:目前已发现可引起长QT综合征突变中的90%集中在KCNQ1、KCNH2以及SCN5A三个基因上(对应1-3型长QT综合征)。...
This is an example of how to use the Common Dialog. This demonstrates most of the event procedures of the CM Dialog control.