While documenting the @Subselect and @Synchronize annotations, I came up with the following test case in the documentation folder. If we replace:
AccountSummary summary = entityManager.createQuery(
"select s " +
"from AccountSummary s " +
"where s.id = :id", AccountSummary.class)
.setParameter( "id", account.getId() )
.getSingleResult();
to a direct fetching call:
AccountSummary summary = entityManager.find( AccountSummary.class, account.getId() );
the test will fail. Also, notice that we need to call flush() manually before refresh(). That might also need to trigger a flush. |