Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
ce3c72f8
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ce3c72f8
编写于
8月 26, 2009
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
compatibility with Hibernate 3.5 beta 1
上级
4a7c2997
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
3 deletion
+10
-3
org.springframework.orm/src/main/java/org/springframework/orm/hibernate3/LocalSessionFactoryBean.java
...ringframework/orm/hibernate3/LocalSessionFactoryBean.java
+10
-3
未找到文件。
org.springframework.orm/src/main/java/org/springframework/orm/hibernate3/LocalSessionFactoryBean.java
浏览文件 @
ce3c72f8
...
...
@@ -18,6 +18,7 @@ package org.springframework.orm.hibernate3;
import
java.io.File
;
import
java.lang.reflect.Array
;
import
java.lang.reflect.Method
;
import
java.sql.Connection
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
...
...
@@ -35,7 +36,6 @@ import org.hibernate.SessionFactory;
import
org.hibernate.cache.CacheProvider
;
import
org.hibernate.cfg.Configuration
;
import
org.hibernate.cfg.Environment
;
import
org.hibernate.cfg.Mappings
;
import
org.hibernate.cfg.NamingStrategy
;
import
org.hibernate.dialect.Dialect
;
import
org.hibernate.engine.FilterDefinition
;
...
...
@@ -52,6 +52,7 @@ import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy;
import
org.springframework.jdbc.support.JdbcUtils
;
import
org.springframework.jdbc.support.lob.LobHandler
;
import
org.springframework.util.ClassUtils
;
import
org.springframework.util.ReflectionUtils
;
import
org.springframework.util.StringUtils
;
/**
...
...
@@ -578,9 +579,15 @@ public class LocalSessionFactoryBean extends AbstractSessionFactoryBean implemen
if
(
this
.
typeDefinitions
!=
null
)
{
// Register specified Hibernate type definitions.
Mappings
mappings
=
config
.
createMappings
();
// Use reflection for compatibility with both Hibernate 3.3 and 3.5:
// the returned Mappings object changed from a class to an interface.
Method
createMappings
=
Configuration
.
class
.
getMethod
(
"createMappings"
);
Method
addTypeDef
=
createMappings
.
getReturnType
().
getMethod
(
"addTypeDef"
,
String
.
class
,
String
.
class
,
Properties
.
class
);
Object
mappings
=
ReflectionUtils
.
invokeMethod
(
createMappings
,
config
);
for
(
TypeDefinitionBean
typeDef
:
this
.
typeDefinitions
)
{
mappings
.
addTypeDef
(
typeDef
.
getTypeName
(),
typeDef
.
getTypeClass
(),
typeDef
.
getParameters
());
ReflectionUtils
.
invokeMethod
(
addTypeDef
,
mappings
,
typeDef
.
getTypeName
(),
typeDef
.
getTypeClass
(),
typeDef
.
getParameters
());
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录