Hibernate ORM CollectionKey - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM CollectionKey class.

This code example shows how to use the following methods:
					new CollectionKey( ce.getLoadedPersister(), ce.getLoadedKey() ) 
			); 
		} 
	} 
} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
 
	/** 
	 * Add an collection to the cache, with a given collection entry. 
	 * 
	 * @param coll The collection for which we are adding an entry. 
	 * @param entry The entry representing the collection. 
	 * @param key The key of the collection's entry. 
	 */ 
	private void addCollection(PersistentCollection coll, CollectionEntry entry, Serializable key) { 
		collectionEntries.put( coll, entry ); 
		CollectionKey collectionKey = new CollectionKey( entry.getLoadedPersister(), key ); 
		PersistentCollection old = ( PersistentCollection ) collectionsByKey.put( collectionKey, coll ); 
		if ( old != null ) { 
			if ( old == coll ) { 
				throw new AssertionFailure("bug adding collection twice"); 
			} 
			// or should it actually throw an exception? 
			old.unsetSession( session ); 
			collectionEntries.remove( old ); 
			// watch out for a case where old is still referenced 
Full Snippet Info
2
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE