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.
精彩评论