怎么查看hibernate源码下载

Hibernate源码1-基础案例-爱编程
Hibernate源码1-基础案例
Hiberntae源码版本:
&&&&&&&&&&&&5.0
入门代码示例:
// A SessionFactory is set up once for an application!
final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()
.configure() // configures settings from hibernate.cfg.xml
sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory();
catch (Exception e) {
// The registry would be destroyed by the SessionFactory, but we had trouble building the SessionFactory
// so destroy it manually.
StandardServiceRegistryBuilder.destroy( registry );
&这是官网入门的案例;主要是用一个标准服务注册机构建器来获得SessionFactory;
本文目的:
&&&&&&&&&&&&1,了解StandardServiceRegistryBuilder
&&&&&&&&&&&&&2,探寻SessionFactory的由来;
源码阅读:
1,标准注册机构造器的构造方法
* Create a default builder.
* 创建一个默认的标准注册机的构造器
public StandardServiceRegistryBuilder() {
this( new BootstrapServiceRegistryBuilder().enableAutoClose().build() );
* Create a builder with the specified bootstrap services.
* 创建一个带引导注册机的标准注册机的构造器
* @param bootstrapServiceRegistry Provided bootstrap registry to use.
public StandardServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry) {
this( bootstrapServiceRegistry,
LoadedConfig.baseline() );
* Create a builder with the specified bootstrap services.
* 创建一个引导注册机和配置信息的标准注册机的构造器
* @param bootstrapServiceRegistry Provided bootstrap registry to use.
public StandardServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry, LoadedConfig loadedConfigBaseline) {
this.settings = Environment.getProperties();
this.bootstrapServiceRegistry = bootstrapServiceR
this.configLoader = new ConfigLoader( bootstrapServiceRegistry );
this.aggregatedCfgXml = loadedConfigB
& & 标准注册机构造器有三个构造方法:分别为默认构造 &引导其构造 和定制化构造;这三个构造器是联动的,我们可以默认初始化引导器注册机和默认路径配置信息;
& & 默认初始化引导器注册机:
this( new BootstrapServiceRegistryBuilder().enableAutoClose().build() );
* See the discussion on {@link #disableAutoClose}.
This method enables
* the auto-closing.
* 设置注册机关闭方式为自动
* @return this, for method chaining
public BootstrapServiceRegistryBuilder enableAutoClose() {
this.autoCloseRegistry =
* Build the bootstrap registry.
* 构建引导注册机
* @return The built bootstrap registry
public BootstrapServiceRegistry build() {
//类加载器服务
与JVM的类加载器不用 没有采用双亲委派机制(/lanxuezaipiao/p/4138511.html)
final ClassLoaderService classLoaderS
if ( providedClassLoaderService == null ) {
// Use a set.
As an example, in JPA, OsgiClassLoader may be in both
// the providedClassLoaders and the overridenClassLoader.
//这段代码的意思没看明白
先不管应该是后面有用到
final Set classLoaders = new HashSet();
if ( providedClassLoaders != null )
classLoaders.addAll( providedClassLoaders );
classLoaderService = new ClassLoaderServiceImpl( classLoaders );
classLoaderService = providedClassLoaderS
final IntegratorServiceImpl integratorService = new IntegratorServiceImpl(
providedIntegrators,
classLoaderService
//开始实例化引导注册器
入参有注册器关闭策略
类加载器服务 策略选择器 ???
return new BootstrapServiceRegistryImpl(
autoCloseRegistry,
classLoaderService,
strategySelectorBuilder.buildSelector( classLoaderService ),
integratorService
至此标注注册机构造器已经拥有了引导器注册机;联动至第三个构造方法 &我们现在已经拥有了一个标准注册机的注册器
2,configure()方法 用来读取hbm.cfg.xml信息
3,build()构建标准注册机构造器
5,多元数据源MetadataSources
* Entry point into working with sources of metadata information (mapping XML, annotations).
Tell Hibernate
* about sources and then call {@link #buildMetadata()}, or use {@link #getMetadataBuilder()} to customize
* how sources are processed (naming strategies, etc).
映射配置文件
注解的入口;
* @author Steve Ebersole
* @since 5.0
public MetadataSources() {
this( new BootstrapServiceRegistryBuilder().build() );
* Create a metadata sources using the specified service registry.
* @param serviceRegistry The service registry to use.
public MetadataSources(ServiceRegistry serviceRegistry) {
// service registry really should be either BootstrapServiceRegistry or StandardServiceRegistry type...
if ( ! isExpectedServiceRegistryType( serviceRegistry ) ) {
LOG.debugf(
"Unexpected ServiceRegistry type [%s] encountered during building of MetadataS may cause " +
"problems later attempting to construct MetadataBuilder",
serviceRegistry.getClass().getName()
this.serviceRegistry = serviceR
this.xmlMappingBinderAccess = new XmlMappingBinderAccess( serviceRegistry );
版权所有 爱编程 (C) Copyright 2012. . All Rights Reserved.
闽ICP备号-3
微信扫一扫关注爱编程,每天为您推送一篇经典技术文章。hibernate4.1.4最新源码现时在哪发布的呢 - Java Web开发当前位置:& &&&hibernate4.1.4最新源码现时在哪发布的呢hibernate4.1.4最新源码现时在哪发布的呢&&网友分享于:&&浏览:66次hibernate4.1.4最新源码现在在哪发布的呢下载下来的包中没有了源码文件,以前的版本是有的,不知jboss把源码包放哪了,有知道的朋友,帮个忙。------解决方案--------------------google 搜索一下
------解决方案--------------------http://sourceforge.net/projects/hibernate/files/hibernate4/
12345678910
12345678910
12345678910 上一篇:下一篇:文章评论相关解决方案 12345678910 Copyright & &&版权所有2011年4月 Java大版内专家分月排行榜第二2010年8月 Java大版内专家分月排行榜第二2010年5月 Java大版内专家分月排行榜第二2008年2月 Java大版内专家分月排行榜第二2007年7月 Java大版内专家分月排行榜第二
2011年2月 Java大版内专家分月排行榜第三2010年9月 Java大版内专家分月排行榜第三2008年9月 Java大版内专家分月排行榜第三2008年1月 Java大版内专家分月排行榜第三2007年11月 Java大版内专家分月排行榜第三2007年9月 Java大版内专家分月排行榜第三
本帖子已过去太久远了,不再提供回复功能。MyEclipse中查看struts spring hibernate源码_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
MyEclipse中查看struts spring hibernate源码
上传于|0|0|文档简介
&&在MyEclipse中查看struts spring hibernate源码的方法
阅读已结束,如果下载本文需要使用0下载券
想免费下载更多文档?
定制HR最喜欢的简历
你可能喜欢MyEclipse怎么查看Hibernate源码
看图&&就明白了
我的是我自己的web project下的 Web App Libraries&下的&Hibernate-core-4.3.6.final.jar
然后右击就会弹出下图
就这么简单
本分类共有文章4篇,更多信息详见
& 2012 - 2016 &
&All Rights Reserved. &
/*爱悠闲图+*/
var cpro_id = "u1888441";}

我要回帖

更多关于 hibernate 源码 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信