开发者

NHibernate identity : int or long

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜