hibernate

https://docs.jboss.org/hibernate/orm/3.3/reference/en/html/index.html
http://docs.jboss.org/hibernate/orm/4.2/devguide/en-US/html_single/
http://docs.jboss.org/hibernate/orm/5.1/userguide/html_single/Hibernate_User_Guide.html

Configurations
https://docs.jboss.org/hibernate/orm/3.3/reference/en/html/session-configuration.html
http://docs.jboss.org/hibernate/orm/4.2/devguide/en-US/html_single/

hibernate.properties VS hibernate.cfg.xml
Hibernate的配置文件有两种形式:一种是XML格式的文件,一种是properties属性文件。XML格式的配置文件中,除了基本的Hibernate配置信息,还可以指定具体的持久化类的映射文件,这可以避免将持久化类的配置文件硬编码在程序中。XML格式的配置文件的默认文件名为hibernate.cfg.xml。位置:src/hibernate.cfg.xml。properties形式的配置文件默认文件名是hibernate.properties,在配置文件中包含了一系列属性的配置,Hibernate将根据这些属性来连接数据库。位置:src/hibernate.properties。properties形式的配置文件和XML格式的配置文件可以同时使用。当同时使用两种类型的配置文件时,XML配置文件中的设置会覆盖properties配置文件的相同的属性。在Hibernate发布包的etc路径下,提供了一个hibernate.properties文件,该文件列出了Hibernate 的所有属性。使用etc路径下的hibernate.properties文件作为配置文件的模板,修改此模板文件作为Hibernate配置文件,这种方式的确是快速进入Hibernate开发的方法。但是对于实际开发,通常会使用hibernate.cfg.xml文件作为配置文件。

SessionFactory
Why use only one SessionFactory Object per application?
What is Hibernate SessionFactory?
Reasons why Hibernate’s sessionFactory is thread safe
SessionFactory is Hibernates concept of a single datastore and is threadsafe so that many threads can access it concurrently and request for sessions and immutable cache of compiled mappings for a single database. A SessionFactory is usually only built once at startup. SessionFactory should be wrapped in some kind of singleton so that it can be easily accessed in an application code.

Session
openSession VS getCurrentSession
http://stackoverflow.com/questions/8046662/hibernate-opensession-vs-getcurrentsession
http://myjourneyonjava.blogspot.com/2013/12/difference-between-opensession-and.html

What is session in hibernate
http://www.tutorialspoint.com/hibernate/hibernate_sessions.htm

transient | persistent | detached
http://stackoverflow.com/questions/2573739/what-are-detached-persistance-and-transient-object-in-hibernate
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/objectstate.html

My favourite hibernate interview questions with answers?
http://www.javalobby.org/java/forums/t104442.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值