Nhibernate 和 MySQL 中 BLOB 的索引前缀长度
在我的数据模型中,有一个具有 byte[] Hash
属性的类,该属性被转换为 BLOB。我希望此列/属性是唯一的。
根据这个MySQL手册页面,我需要指定BLOB 的索引前缀长度,否则不允许在 BLOB 上建立索引。
CREATE TABLE test (blob_col BLOB, INDEX(blob_col(10)));
在(流利的)NHibernate 中我该怎么做?
谢谢
In my data model there is a class with a byte[] Hash
property, which is translated into BLOB. I want this column/property to be unique.
According to this MySQL manual page, I need to specify an index prefix length for the BLOB otherwise it doesn't allow indexing on BLOB.
CREATE TABLE test (blob_col BLOB, INDEX(blob_col(10)));
In (Fluent) NHibernate how can I do it?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
hbm.xml 文件或字符串中的数据库对象和 new Configuration.Configure().Add()
http://ayende.com/blog/3947/nhibernate-mapping-database-object
database-object in a hbm.xml file or string and
new Configuration.Configure().Add()
http://ayende.com/blog/3947/nhibernate-mapping-database-object