Can't load from Oracle when Id is Guid in NHibernate

孤街醉人 提交于 2019-12-13 05:13:35

问题


We're saving an object to NHibernate where the Id is typed Guid. Based on other things we've found we have this as a type char(36).

  • We create an object and save it via NHibernate. This works fine and we see 64599239BB0C1C48B44C36D9F9267830 in the column.
  • When we then try to load using a guid we don't get any results and NHibernate Profiler shows that the WHERE clause is looking for 0x64599239BB0C1C48B44C36D9F9267830 which isn't matching.

Obviously we're doing something wrong.. so any ideas what?


回答1:


The data type on the database should be RAW, and of 16 length. This is what trying to recreate the database using NHibernate produces.



来源:https://stackoverflow.com/questions/5494669/cant-load-from-oracle-when-id-is-guid-in-nhibernate

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!