【问题标题】:How to empty a table from DataNucleus' JDO implementation?如何从 DataNucleus 的 JDO 实现中清空表?
【发布时间】:2018-07-22 04:49:27
【问题描述】:

我正在使用 DataNucleus 的 JDO 实现来填充以 MySQL 模式打开的本地 H2 数据库上的表。

我想不时清空该表的内容(对应于启用持久性的对象)。如何在不遍历所有条目的情况下从 JDO 或 DataNucleus 上下文执行此操作?这可能吗?

【问题讨论】:

    标签: jdo datanucleus


    【解决方案1】:

    应该这样做:

    pm.newQuery(YourJDObject.class).deletePersistentAll();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多