Пример #1
0
  public void evictCollection(Object value, CollectionType type) {

    final Object pc;
    if (type.hasHolder(getSession().getEntityMode())) {
      pc = getSession().getPersistenceContext().removeCollectionHolder(value);
    } else if (value instanceof PersistentCollection) {
      pc = value;
    } else {
      return; // EARLY EXIT!
    }

    PersistentCollection collection = (PersistentCollection) pc;
    if (collection.unsetSession(getSession())) evictCollection(collection);
  }
Пример #2
0
  Object processCollection(Object collection, CollectionType type) throws HibernateException {

    if (collection == CollectionType.UNFETCHED_COLLECTION) {
      return null;
    }

    if (collection != null) {
      final PersistentCollection coll;
      if (type.hasHolder()) {
        coll = getSession().getPersistenceContext().getCollectionHolder(collection);
      } else {
        coll = (PersistentCollection) collection;
      }

      Collections.processReachableCollection(coll, type, owner, getSession());
    }

    return null;
  }