@Override public PersistentCollection wrap(SharedSessionContractImplementor session, Object collection) { return new PersistentMap( session, (java.util.Map) collection ); }
@Override public PersistentCollection instantiate( SharedSessionContractImplementor session, CollectionPersister persister, Serializable key) { return new PersistentMap( session ); }
@Override public <E> PersistentCollection<E> instantiateWrapper( Object key, PersistentCollectionDescriptor<?, Map<?, ?>, E> collectionDescriptor, SharedSessionContractImplementor session) { return new PersistentMap<>( session, collectionDescriptor, key ); }
@Override public <E> PersistentCollection<E> instantiateWrapper( Object key, PersistentCollectionDescriptor<?, LinkedHashMap<?, ?>, E> collectionDescriptor, SharedSessionContractImplementor session) { return new PersistentMap<>( session, collectionDescriptor, key ); }
@Override public <E> PersistentCollection<E> wrap( Map<?, ?> rawCollection, PersistentCollectionDescriptor<?, Map<?, ?>, E> collectionDescriptor, SharedSessionContractImplementor session) { return new PersistentMap<>( session, collectionDescriptor, rawCollection ); } }
@Override public <E> PersistentCollection<E> wrap( LinkedHashMap<?, ?> rawCollection, PersistentCollectionDescriptor<?, LinkedHashMap<?, ?>, E> collectionDescriptor, SharedSessionContractImplementor session) { return new PersistentMap<>( session, collectionDescriptor, rawCollection ); }
public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) { return new PersistentMap(session); }
public PersistentCollection wrap(SessionImplementor session, Object collection) { return new PersistentMap( session, (java.util.Map) collection ); }
public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) { return new PersistentMap(session); }
public PersistentCollection wrap(SessionImplementor session, Object collection) { return new PersistentMap( session, (java.util.Map) collection ); }
public PersistentMap 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 PersistentMap(null, new HashMap<Object, Object>()) : new PersistentMap(null)); } }
/** * Tests that the Hibernate {@link PersistentMap} can be serialized, but in way that * deserialized class will be java map and but not {@link PersistentMap}. * * @throws SerializationException * SerializationException */ @Test public void hibernatePersistentMap() throws SerializationException { PersistentMap object = new PersistentMap(); Object deserialized = serializeBackAndForth(object); assertThat(deserialized, is(not(instanceOf(PersistentMap.class)))); assertThat(deserialized, is(instanceOf(Map.class))); }
if (initialized) { Map<?, ?> map = ((ExternalizablePersistentMap)value).getContentAsMap(target, comparator); coll = (sorted ? new PersistentSortedMap(null, (SortedMap<?, ?>)map) : new PersistentMap(null, map)); coll = (sorted ? new PersistentSortedMap() : new PersistentMap());