Пример #1
0
 public ObjectAdapter lazilyLoaded(Object pojo) {
   if (!(pojo instanceof PersistenceCapable)) {
     return null;
   }
   final PersistenceCapable persistenceCapable = (PersistenceCapable) pojo;
   return frameworkSynchronizer.lazilyLoaded(persistenceCapable, CalledFrom.OS_LAZILYLOADED);
 }
Пример #2
0
  /**
   * Not API; provides the ability to force a reload (refresh in JDO terms) of the domain object
   * wrapped in the {@link ObjectAdapter}.
   */
  public void refreshRoot(final ObjectAdapter adapter) {

    final Object domainObject = adapter.getObject();
    if (domainObject == null) {
      // REVIEW: is this possible?
      throw new ObjectNotFoundException(adapter.getOid());
    }

    try {
      getPersistenceManager().refresh(domainObject);
    } catch (final RuntimeException e) {
      throw new ObjectNotFoundException(adapter.getOid(), e);
    }

    // possibly redundant because also called in the post-load event
    // listener, but (with JPA impl) found it was required if we were ever to
    // get an eager left-outer-join as the result of a refresh (sounds possible).

    frameworkSynchronizer.postLoadProcessingFor(
        (PersistenceCapable) domainObject, CalledFrom.OS_RESOLVE);
  }