Looking for a drop-in replacement for a java.util.Map

前端 未结 6 2041
夕颜
夕颜 2021-02-01 23:57

Problem

Following up on this question, it seems that a file- or disk-based Map implementation may be the right solution to the problems I mentioned there.

6条回答
  •  失恋的感觉
    2021-02-02 00:40

    I came accross jdbm2 a few weeks ago. The usage is very simple. You should be able to get it to work in half an hour. One drawback is that the object which is put into the map must be serializable, i.e. implement Serializable. Other Cons are given in their website.

    However, all object persistence database are not a permanent solution for storing objects of you own java class. If you decide to make change to the fields of the class, you will no longer be able to reteive the object from the map collection. It is ideal to store standard serializable classes line String, Integer, etc.

提交回复
热议问题