如何抑制 JPA 警告?

How to suppress JPA warnings?

我有一个 App Engine 端点,它必须先调用 detach(),然后才能修改某些实体字段并返回响应。但每次我看到以下日志时,它都会淹没我的开发人员控制台日志。我怎样才能抑制这个讨厌的和不必要的警告?

org.datanucleus.ObjectManagerImpl detachObject: Object ... was detached before its changes could be flushed. Changes will not reach the datastore. This is likely the result of a JPA detach() call before flush(), which is a stupid thing to do anyway, but it was your choice.

我只需要将 EntityManager FlushModeType 配置为 COMMIT 并且在调用 commit() 后不调用任何东西。