Code example for PersistenceContext

Methods: addCollectionHolderaddNewCollectiongetCollectionHolder

0
			//TODO: move into collection type, so we can use polymorphism! 
			if ( collectionType.hasHolder() ) { 
 
				if (collection==CollectionType.UNFETCHED_COLLECTION) return null; 
 
				PersistentCollection ah = persistenceContext.getCollectionHolder(collection); 
				if (ah==null) { 
					ah = collectionType.wrap(session, collection); 
					persistenceContext.addNewCollection( persister, ah ); 
					persistenceContext.addCollectionHolder(ah); 
				} 
				return null; 
			} 
			else { 
 
				PersistentCollection persistentCollection = collectionType.wrap(session, collection); 
				persistenceContext.addNewCollection( persister, persistentCollection ); 
 
                if (LOG.isTraceEnabled()) LOG.trace("Wrapped collection in role: " + collectionType.getRole()); 
 
				return persistentCollection; //Force a substitution! 
 
Contextual code suggestions in your IDE  Get Codota for Java