/** * Add a collection to the cache, creating a new collection entry for it * * @param collection The collection for which we are adding an entry. * @param persister The collection persister */ private void addCollection(PersistentCollection collection, CollectionPersister persister) { final CollectionEntry ce = new CollectionEntry( persister, collection ); collectionEntries.put( collection, ce ); }
/** * Custom deserialization routine used during deserialization of a * Session/PersistenceContext for increased performance. * * @param ois The stream from which to read the entry. * @param session The session being deserialized. * * @return The deserialized CollectionEntry * * @throws IOException * @throws ClassNotFoundException */ public static CollectionEntry deserialize( ObjectInputStream ois, SessionImplementor session) throws IOException, ClassNotFoundException { return new CollectionEntry( (String) ois.readObject(), (Serializable) ois.readObject(), (Serializable) ois.readObject(), (session == null ? null : session.getFactory()) ); } }
@Override public CollectionEntry addInitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id) throws HibernateException { final CollectionEntry ce = new CollectionEntry( collection, persister, id, flushing ); ce.postInitialize( collection ); addCollection( collection, ce, id ); return ce; }
@Override public void addUninitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id) { final CollectionEntry ce = new CollectionEntry( collection, persister, id, flushing ); addCollection( collection, ce, id ); if ( persister.getBatchSize() > 1 ) { getBatchFetchQueue().addBatchLoadableCollection( collection, ce ); } }
@Override public void addInitializedDetachedCollection(CollectionPersister collectionPersister, PersistentCollection collection) throws HibernateException { if ( collection.isUnreferenced() ) { //treat it just like a new collection addCollection( collection, collectionPersister ); } else { final CollectionEntry ce = new CollectionEntry( collection, session.getFactory() ); addCollection( collection, ce, collection.getKey() ); } }
@Override public void addUninitializedDetachedCollection(CollectionPersister persister, PersistentCollection collection) { final CollectionEntry ce = new CollectionEntry( persister, collection.getKey() ); addCollection( collection, ce, collection.getKey() ); if ( persister.getBatchSize() > 1 ) { getBatchFetchQueue().addBatchLoadableCollection( collection, ce ); } }
/** * add a collection we just loaded up (still needs initializing) */ @Override public void addUninitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id) { CollectionEntry ce = new CollectionEntry(collection, persister, id, flushing); addCollection(collection, ce, id); }
/** * Add a collection to the cache, creating a new collection entry for it * * @param collection The collection for which we are adding an entry. * @param descriptor The collection descriptor */ private void addCollection(PersistentCollection collection, PersistentCollectionDescriptor descriptor) { final CollectionEntry ce = new CollectionEntry( descriptor, collection ); collectionEntries.put( collection, ce ); }
/** * Add a collection to the cache, creating a new collection entry for it * * @param collection The collection for which we are adding an entry. * @param persister The collection persister */ private void addCollection(PersistentCollection collection, CollectionPersister persister) { CollectionEntry ce = new CollectionEntry( persister, collection ); collectionEntries.put( collection, ce ); }
/** * add a collection we just loaded up (still needs initializing) */ @Override public void addUninitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id) { CollectionEntry ce = new CollectionEntry(collection, persister, id, flushing); addCollection(collection, ce, id); }
/** * Add a collection to the cache, creating a new collection entry for it * * @param collection The collection for which we are adding an entry. * @param persister The collection persister */ private void addCollection(PersistentCollection collection, CollectionPersister persister) { CollectionEntry ce = new CollectionEntry( persister, collection ); collectionEntries.put( collection, ce ); }
/** * add a collection we just pulled out of the cache (does not need initializing) */ @Override public CollectionEntry addInitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id) throws HibernateException { CollectionEntry ce = new CollectionEntry(collection, persister, id, flushing); ce.postInitialize(collection); addCollection(collection, ce, id); return ce; }
@Override public CollectionEntry addInitializedCollection(PersistentCollectionDescriptor descriptor, PersistentCollection collection, Object id) throws HibernateException { final CollectionEntry ce = new CollectionEntry( collection, descriptor, id, flushing ); ce.postInitialize( collection ); addCollection( collection, ce, id ); return ce; }
/** * add a collection we just pulled out of the cache (does not need initializing) */ @Override public CollectionEntry addInitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id) throws HibernateException { CollectionEntry ce = new CollectionEntry(collection, persister, id, flushing); ce.postInitialize(collection); addCollection(collection, ce, id); return ce; }
/** * add a detached uninitialized collection */ @Override public void addUninitializedDetachedCollection(CollectionPersister persister, PersistentCollection collection) { CollectionEntry ce = new CollectionEntry( persister, collection.getKey() ); addCollection( collection, ce, collection.getKey() ); }
/** * add a detached uninitialized collection */ @Override public void addUninitializedDetachedCollection(CollectionPersister persister, PersistentCollection collection) { CollectionEntry ce = new CollectionEntry( persister, collection.getKey() ); addCollection( collection, ce, collection.getKey() ); }
@Override public void addInitializedDetachedCollection(PersistentCollectionDescriptor descriptor, PersistentCollection collection) throws HibernateException { if ( collection.isUnreferenced() ) { //treat it just like a new collection addCollection( collection, descriptor ); } else { final CollectionEntry ce = new CollectionEntry( collection, session.getFactory() ); addCollection( collection, ce, collection.getKey() ); } }
/** * add an (initialized) collection that was created by another session and passed * into update() (ie. one with a snapshot and existing state on the database) */ @Override public void addInitializedDetachedCollection(CollectionPersister collectionPersister, PersistentCollection collection) throws HibernateException { if ( collection.isUnreferenced() ) { //treat it just like a new collection addCollection( collection, collectionPersister ); } else { CollectionEntry ce = new CollectionEntry( collection, session.getFactory() ); addCollection( collection, ce, collection.getKey() ); } }
@Override public void addUninitializedCollection(PersistentCollectionDescriptor descriptor, PersistentCollection collection, Object collectionKey) { final CollectionEntry ce = new CollectionEntry( collection, descriptor, collectionKey, flushing ); if ( !collection.wasInitialized() ) { collection.beforeInitialize( -1, descriptor ); } addCollection( collection, ce, collectionKey ); if ( descriptor.getBatchSize() > 1 ) { getBatchFetchQueue().addBatchLoadableCollection( collection, ce ); } }
@Override public void addUninitializedDetachedCollection(PersistentCollectionDescriptor descriptor, PersistentCollection collection) { final CollectionEntry ce = new CollectionEntry( descriptor, collection.getKey() ); addCollection( collection, ce, collection.getKey() ); if ( descriptor.getBatchSize() > 1 ) { getBatchFetchQueue().addBatchLoadableCollection( collection, ce ); } }