惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
H
Heimdal Security Blog
K
Kaspersky official blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
Schneier on Security
G
GRAHAM CLULEY
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
CERT Recently Published Vulnerability Notes
Google DeepMind News
Google DeepMind News
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
C
Cisco Blogs
Cyberwarzone
Cyberwarzone
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
Security Archives - TechRepublic
Security Archives - TechRepublic
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 司徒正美
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
V
Visual Studio Blog
博客园 - Franky
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
Jina AI
Jina AI
P
Proofpoint News Feed
P
Proofpoint News Feed
有赞技术团队
有赞技术团队
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
Spread Privacy
Spread Privacy
Application and Cybersecurity Blog
Application and Cybersecurity Blog
IT之家
IT之家
S
Security Affairs
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
N
News | PayPal Newsroom
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
NISL@THU
NISL@THU

博客园 - 昊子

工作流参考模型(Workflow Reference Model) DNN default document的异常错误 如何使用GoogleCode提供的SVN Source Control服务 Norton PartitionMagic 8.0 Resizing Boot Partition 智能提示和那些值得崇拜的人 推荐一个Flex & AIR皮肤站点 SessionDiskCache 0.1版发布 Flex locale Flex Repeater 多层嵌套 从没走远 SubmitMask 1.0 发布 如何获取Footer中的子控件 DNN学习笔记 之一 配置 使用NHibernate时产生的一个错误 NHibernate官方文档 之 NHibernate指南-前言 C#反转单向链表 C#事件编程 静态构造函数和静态成员变量初始化的调用时间 结束无谓的讨论吧
NHibernate和SqlImage
昊子 · 2006-06-12 · via 博客园 - 昊子

开发中遇到一个问题SqlServer的Image类型影射为byte[]时截断了数据,变成8k,查了下NH文档

Table 5.5. Large Object Mapping Types

NHibernate Type .NET Type Database Type Remarks
StringClob System.String DbType.String type="StringClob" must be specified. Entire field is read into memory.
BinaryBlob System.Byte[] DbType.Binary type="BinaryBlob" must be specified. Entire field is read into memory.
Serializable Any System.Object that is marked with SerializableAttribute. DbType.Binary type="Serializable" should be specified. This is the fallback type if no NHibernate Type can be found for the Property.

解决如下

原hbm.xml

        <property  name="NH_FileContent" type="byte[]">
            
<column name="FileContent" length="2147483647" sql-type="image" not-null="false"/>
        
</property>

改为

        <property  name="NH_FileContent" type="BinaryBlob">
            
<column name="FileContent" length="2147483647" sql-type="image" not-null="false"/>
        
</property>

.net中的类型不用改