【问题标题】:How get new data from database after change java ee更改java ee后如何从数据库中获取新数据
【发布时间】:2022-01-05 21:25:53
【问题描述】:

在我的方法中,我修改了数据库中的数据,我想用同样的方法来检索我的新数据 java ee 应用程序

注意:我在我的 accountRepository 中使用 entitymanager

示例

 @Transactional(value = Transactional.TxType.SUPPORTS)
    public Account getAccount(Account account) {
    
        accountRepository.create(new Account("test");
    
        return accountRepository.getAllAccount();
    }

【问题讨论】:

    标签: java postgresql ejb entitymanager


    【解决方案1】:

    您可以使用刷新和刷新方法:entity manager.refresh(entity);

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-14
      • 1970-01-01
      • 2013-01-25
      • 1970-01-01
      • 1970-01-01
      • 2021-12-11
      • 2011-03-05
      相关资源
      最近更新 更多