use of org.hibernate.classic.Session in project intellij-community by JetBrains.
the class HibernateResourceInspection method foo2.
public void foo2() {
final SessionFactory factory = null;
final Session session = factory.openSession();
}
use of org.hibernate.classic.Session in project intellij-community by JetBrains.
the class HibernateResourceInspection method foo3.
public void foo3() {
final SessionFactory factory = null;
final Session session = factory.openSession();
session.close();
}
use of org.hibernate.classic.Session in project gocd by gocd.
the class PipelineSqlMapDaoCachingTest method setup.
@Before
public void setup() throws Exception {
transactionSynchronizationManager = mock(TransactionSynchronizationManager.class);
goCache = new StubGoCache(new TestTransactionSynchronizationManager());
goCache.clear();
mockTemplate = mock(SqlMapClientTemplate.class);
repository = mock(MaterialRepository.class);
environmentVariableDao = mock(EnvironmentVariableDao.class);
mockSessionFactory = mock(SessionFactory.class);
repository = mock(MaterialRepository.class);
transactionTemplate = mock(TransactionTemplate.class);
configFileDao = mock(GoConfigDao.class);
pipelineDao = new PipelineSqlMapDao(null, repository, goCache, environmentVariableDao, transactionTemplate, null, transactionSynchronizationManager, null, configFileDao, mock(Database.class), mockSessionFactory);
pipelineDao.setSqlMapClientTemplate(mockTemplate);
session = mock(Session.class);
when(mockSessionFactory.getCurrentSession()).thenReturn(session);
when(configFileDao.load()).thenReturn(GoConfigMother.defaultCruiseConfig());
}
use of org.hibernate.classic.Session in project gocd by gocd.
the class PipelineStateDaoCachingTest method setup.
@Before
public void setup() throws Exception {
transactionSynchronizationManager = mock(TransactionSynchronizationManager.class);
goCache = new StubGoCache(new TestTransactionSynchronizationManager());
goCache.clear();
mockTemplate = mock(SqlMapClientTemplate.class);
repository = mock(MaterialRepository.class);
environmentVariableDao = mock(EnvironmentVariableDao.class);
mockSessionFactory = mock(SessionFactory.class);
repository = mock(MaterialRepository.class);
transactionTemplate = mock(TransactionTemplate.class);
configFileDao = mock(GoConfigDao.class);
pipelineStateDao = new PipelineStateDao(null, repository, goCache, environmentVariableDao, transactionTemplate, null, transactionSynchronizationManager, null, configFileDao, mock(Database.class), mockSessionFactory);
pipelineStateDao.setSqlMapClientTemplate(mockTemplate);
session = mock(Session.class);
when(mockSessionFactory.getCurrentSession()).thenReturn(session);
when(configFileDao.load()).thenReturn(GoConfigMother.defaultCruiseConfig());
}
use of org.hibernate.classic.Session in project intellij-community by JetBrains.
the class HibernateResourceInspection method foo5.
public void foo5() {
SessionFactory factory = null;
Session session = null;
try {
session = factory.openSession();
} finally {
session.close();
}
}
Aggregations