开发者

NHibernate identity : int or long

开发者 https://www.devze.com 2022-12-24 04:53 出处:网络
I begin my NHibernate mapping. In major cases I use int type but for some entities I need to persist million of objets. Is long type for identi开发者_如何学JAVAty will be the best choice ?Int32 (or ju

I begin my NHibernate mapping. In major cases I use int type but for some entities I need to persist million of objets. Is long type for identi开发者_如何学JAVAty will be the best choice ?


Int32 (or just int) is fine for "millions." You only need to start thinking about Int64 (long) if you will have billions of rows.

A signed int can support IDs up to 2,147,483,647.

See Int32.MaxValue.


Int will work for values up to 2,147,483,647. That should be fine for "millions of objects."

For data ranges, see the Integral Types Table. If you really need more, you could use uint.

0

精彩评论

暂无评论...
验证码 换一张
取 消