Code example for SessionFactory

Methods: getCurrentSession

0
 
			if (cache != null) { 
				cache.remove("net.jforum.entities.Forum#" + toForumId);
			} 
 
			Topic topic = (Topic)this.sessionFactory.getCurrentSession().get(Topic.class, topicIds[0]);
			Forum forum = topic.getForum();
 
			this.clearCacheRegion(this.factoryImplementor.getQueryCache("forumDAO.getTotalPosts#" + forum.getId()));
			this.clearCacheRegion(this.factoryImplementor.getQueryCache("forumDAO.getTotalTopics#" + forum.getId()));
 
			Cache cache2 = this.factoryImplementor.getSecondLevelCacheRegion("net.jforum.entities.Forum");
 
			if (cache2 != null) { 
				cache2.remove("net.jforum.entities.Forum#" + forum.getId());
			} 
		} 
	} 
 
	/** 
Experience pair programming with AI  Get Codota for Java