Storing EnumSet in a database?

前端 未结 10 1810
借酒劲吻你
借酒劲吻你 2020-12-03 21:24

So in C++/C# you can create flags enums to hold multiple values, and storing a single meaningful integer in the database is, of course, trivial.

In Java you have Enu

10条回答
  •  一向
    一向 (楼主)
    2020-12-03 21:51

    EnumSet implements Serializable, but there's a lot of overhead if you use that (it is written as an array of IDs, not a BitSet as you might expect, plus the object stream header.)

提交回复
热议问题