Code example for PersistentBag

Methods: wasInitialized

0
			try { 
				Catalog catalog = (Catalog) fullTextSession.get( Catalog.class, 1L );
				PersistentSet catalogItems = (PersistentSet) catalog.getCatalogItems();
				PersistentBag consumers = (PersistentBag) catalog.getConsumers();
 
				assertFalse( "consumers should not be initialized", consumers.wasInitialized() );
				assertFalse( "catalogItems should not be initialized", consumers.wasInitialized() );
 
				updateCatalogsCollection( fullTextSession, catalog );
 
				if ( ( withClassBridgeOnItem || withClassBridgeOnCatalog ) && depth > 1 ) {
					assertTrue( "catalogItems should have been initialized", catalogItems.wasInitialized() );
				} 
				else { 
					assertFalse( "catalogItems should not be initialized", catalogItems.wasInitialized() );
				} 
			} 
			finally { 
				fullTextSession.close();
			} 
Experience pair programming with AI  Get Codota for Java