问题描述
我要寻找一个解决方案,以持续的DetachedCriteria NHibernate的对象数据库。我已经找到了NHibernateUtil和GetSerializable方法,但我不能确定如何使用它序列化的DetachedCriteria对象。任何帮助将大大AP preciated。谢谢你。
I am looking for a solution to persist NHibernate DetachedCriteria objects to a database. I have tracked down the NHibernateUtil and the GetSerializable method, but I'm unsure how to use it to serialize a DetachedCriteria object. Any help on this would be greatly appreciated. Thank you.
推荐答案
的DetachedCriteria是序列化的,因为它没有连接到一个会话,它应该只需定期做.NET对象序列化此处描述是可行的:
DetachedCriteria is serializable and because it is not connected to a session, it should be doable by just doing regular .net object serialization as described here:
如果序列化为二进制格式它可以作为持续字节数组为二进制BLOB字段(NHibernateUtil.BinaryBlob.SqlType)。
If serialized to a binary format it could be persisted as byte-array to a binary blob field (NHibernateUtil.BinaryBlob.SqlType).
这篇关于我如何序列化的DetachedCriteria NHibernate的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!