本文是研究Hibernate源码时的记录,希望能给各位在看源码时能提供一些思路。有兴趣的,可以在下面留言讨论。,
buildSettings初始化Hibernate: 事务设置 JDBC和连接设置 SQL生成设置 Query解析设置 二级缓存设置 SQL异常包装 统计和日志 表自动生成设置
AnnotationSessionFactoryBean在函数afterPropertiesSet中会将实体类绑定到Table对象上。 在AnnotationConfigruation类中会调用AnnotationBinder.bindClass( clazz, inheritanceStatePerClass, mappings )来进行绑定。
- org.hibernate.jdbc.util.SQLStatementLogger
org.hibernate.cfg.NamingStrategy该接口定义了类名-表名,属性名-字段名等。 org.hibernate.cfg.EJB3NamingStrategy 处理SQL语句的输出(格式化)
org.hibernate.Interceptor为拦截器的根接口,该接口中的抽象方法比较多;出于方便,可以使用org.hibernate.EmptyInterceptor这个接口。 事务相关函数 操作持久化对象相关函数 操作集合对象相关函数 其他函数
org.hibernate.event.EventListeners该类中定义了Hibernate支持的所有事件监听器。本文有一篇文章介绍的是“Hibernate字段数据加密”,就是利用了Hibernate的事件机制实现的。
org.hibernate.stat.Statistics为统计接口 [caption id="attachment_4468" align="aligncenter" width="300"]
![CategorizedStatistics](https://static.oschina.net/uploads/img/201612/31204519_YbQd.png)
CategorizedStatistics[/caption]
org.hibernate.jmx.StatisticsService
Hibernate支持JPA的一些持久化注解类,对此的支持您可以从下面的介绍来了解到。 org.hibernate.cfg.Ejb3Column该类提供了对JPA注解类javax.persistence.Column的解析。 未完待续。。。