热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

模拟考试

设为首页

收藏此页面

订阅邮箱地址

Hibernate 面试题与答案

Test your skills through the online practice test: Hibernate Quiz Online Practice Test

相关差异对比

问题 36. If you want to see the Hibernate generated SQL statements on console, what should we do?

In Hibernate configuration file set as follows:
<property name="show_sql">true</property>

这有帮助吗? 添加评论 查看评论
 

问题 37. What are derived properties?

The properties that are not mapped to a column, but calculated at runtime by evaluation of an expression are called derived properties. The expression can be defined using the formula attribute of the element. People who read this also read:
Core Java Questions
Spring Questions
SCJP 6.0 Certification
EJB Interview Questions
Servlets Questions

这有帮助吗? 添加评论 查看评论
 

问题 38. What is component mapping in Hibernate?

* A component is an object saved as a value, not as a reference
* A component can be saved directly without needing to declare interfaces or identifier properties
* Required to define an empty constructor
* Shared references not supported

这有帮助吗? 添加评论 查看评论
 

问题 39. What is the difference between sorted and ordered collection in hibernate?

sorted collection vs. order collection
sorted collection :-
A sorted collection is sorting a collection by utilizing the sorting features provided by the Java collections framework. The sorting occurs in the memory of JVM which running Hibernate, after the data being read from database using java comparator.
If your collection is not large, it will be more efficient way to sort it.

order collection :-
Order collection is sorting a collection by specifying the order-by clause for sorting this collection when retrieval.
If your collection is very large, it will be more efficient way to sort it .

这有帮助吗? 添加评论 查看评论
 

问题 40. How will you configure Hibernate?

The configuration files hibernate.cfg.xml (or hibernate.properties) and mapping files *.hbm.xml are used by the Configuration class to create (i.e. configure and bootstrap hibernate) the SessionFactory, which in turn creates the Session instances. Session instances are the primary interface for the persistence service.

" hibernate.cfg.xml (alternatively can use hibernate.properties): These two files are used to configure the hibernate sevice (connection driver class, connection URL, connection username, connection password, dialect etc). If both files are present in the classpath then hibernate.cfg.xml file overrides the settings found in the hibernate.properties file.

" Mapping files (*.hbm.xml): These files are used to map persistent objects to a relational database. It is the best practice to store each object in an individual mapping file (i.e mapping file per class) because storing large number of persistent classes into one mapping file can be difficult to manage and maintain. The naming convention is to use the same name as the persistent (POJO) class name. For example Account.class will have a mapping file named Account.hbm.xml. Alternatively hibernate annotations can be used as part of your persistent class code instead of the *.hbm.xml files.

这有帮助吗? 添加评论 查看评论
 

用户评价最有帮助的内容:

版权所有 © 2026,WithoutBook。
JDBC vs HibernateJPA vs HibernateHibernate 3 vs Hibernate 4