try {
initializeData( fulltextSessionBuilder );
FullTextSession fullTextSession = fulltextSessionBuilder.openFullTextSession();
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();
}