MapDB:如何移除一个HashMap?

huangapple 未分类评论51阅读模式
标题翻译

MapDB: How to remove a HashMap?

问题

我有一个包含多个HashMap的MapDB。

 DBMaker.Maker mapmk = DBMaker.fileDB(this.dbfile);
 DB mapdb = mapmk.make();

 HTreeMap<String, String> map1 = mapdb.hashMap("abc").createOrOpen();
 map1.put("max", "123");

 HTreeMap<String, String> map2 = mapdb.hashMap("def").createOrOpen();
 map2.put("sam", "098");

 HTreeMap<String, String> map3 = mapdb.hashMap("ghi").createOrOpen();

如何从DB中删除整个映射(例如map2 = "def"),以及其包含的所有键值对?

英文翻译

I have a MapDB with multiple HashMaps.

 DBMaker.Maker mapmk = DBMaker.fileDB (this.dbfile);
 DB mapdb = mapmk.make ();

 HTreeMap &lt;String, String&gt; map1 = mapdb.hashMap (&quot;abc&quot;).createOrOpen ();
 map1.put(&quot;max&quot;, &quot;123&quot;);

 HTreeMap &lt;String, String&gt; map2 = mapdb.hashMap (&quot;def&quot;).createOrOpen ();
 map2.put(&quot;sam&quot;, &quot;098&quot;);

 HTreeMap &lt;String, String&gt; map3 = mapdb.hashMap (&quot;ghi&quot;).createOrOpen ();

How can I remove a whole map (e.g. map2 = "def") with all its key/value-pairs from the DB?

huangapple
  • 本文由 发表于 2020年5月30日 23:31:02
  • 转载请务必保留本文链接:https://java.coder-hub.com/62104692.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定