@Override public PersistentCollection instantiate(SharedSessionContractImplementor session, CollectionPersister persister, Serializable key) { return new PersistentSet( session ); }
@Override public PersistentCollection wrap(SharedSessionContractImplementor session, Object collection) { return new PersistentSet( session, (java.util.Set) collection ); }
@Override public <E> PersistentCollection<E> wrap( Set<?> rawCollection, PersistentCollectionDescriptor<?, Set<?>, E> collectionDescriptor, SharedSessionContractImplementor session) { return new PersistentSet<>( session, collectionDescriptor, rawCollection ); }
@Override public <E> PersistentCollection<E> instantiateWrapper( Object key, PersistentCollectionDescriptor<?, Set<?>, E> collectionDescriptor, SharedSessionContractImplementor session) { return new PersistentSet<>( session, collectionDescriptor, key ); }
@Override public <E> PersistentCollection<E> instantiateWrapper( Object key, PersistentCollectionDescriptor<?, LinkedHashSet<?>, E> collectionDescriptor, SharedSessionContractImplementor session) { return new PersistentSet( session, collectionDescriptor, key ); }
@Override public <E> PersistentCollection<E> wrap( LinkedHashSet<?> rawCollection, PersistentCollectionDescriptor<?, LinkedHashSet<?>, E> collectionDescriptor, SharedSessionContractImplementor session) { return new PersistentSet( session, collectionDescriptor, rawCollection ); }
public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) { return new PersistentSet(session); }
public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) { return new PersistentSet(session); }
public PersistentCollection wrap(SessionImplementor session, Object collection) { return new PersistentSet( session, (java.util.Set) collection ); }
public PersistentCollection wrap(SessionImplementor session, Object collection) { return new PersistentSet( session, (java.util.Set) collection ); }
public Object create(Kryo kryo, Input input, Class type) { return (new PersistentSet( (SharedSessionContractImplementor) entityManager.unwrap(Session.class))); } });
public PersistentSet newInstance(ExtendedObjectInput in, String className) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { PersistentCollectionSnapshot snapshot = new JMFPersistentCollectionSnapshot(null); snapshot.readInitializationData(in); return (snapshot.isInitialized() ? new PersistentSet(null, new HashSet<Object>()) : new PersistentSet(null)); } }
/** * Tests that the Hibernate {@link PersistentSet} can be serialized, but in way that * deserialized class will be java set and but not {@link PersistentSet}. * * @throws SerializationException * SerializationException */ @Test public void hibernatePersistentSet() throws SerializationException { PersistentSet object = new PersistentSet(); Object deserialized = serializeBackAndForth(object); assertThat(deserialized, is(not(instanceOf(PersistentSet.class)))); assertThat(deserialized, is(instanceOf(Set.class))); }
PersistentSet persistentSet = new PersistentSet(null, (Set<?>) detachedCollection); changeCollectionOwner(persistentSet, owner); HashMap<Object, Object> snapshot = new HashMap<>();
if (initialized) { Set<?> set = ((ExternalizablePersistentSet)value).getContentAsSet(target, comparator); coll = (sorted ? new PersistentSortedSet(null, (SortedSet<?>)set) : new PersistentSet(null, set)); coll = (sorted ? new PersistentSortedSet() : new PersistentSet());
if (unwrapProxy((((PersistentCollection) propertyValue).getOwner())) != unwrapProxy(owner)) { if (propertyValue instanceof PersistentSet) { clonedPropertyValue = (E) new PersistentSet(