我已使用 JPA 1.0 在我的 Google AppEngine 项目中使用注释的类中将javax.persistence.PostLoad注释附加到我的方法中(出于兼容性原因,我已在 Eclipse 项目的 Google AppEngine 属性中检查了Use Datanucleus JDO/JPA 版本“v1” ) . 在我使用该方法执行 SELECT 查询后,该方法不会触发。为什么不?private void onPostLoad()javax.persistence.Entityjavax.persistence.Query.getSingleResult()
它的对应物@OnPrePersist工作得很好。我也尝试使用加载对象entityManager.find(),但无济于事