Class BaseHelper
- java.lang.Object
-
- com.evolveum.midpoint.repo.sql.helpers.BaseHelper
-
@Component public class BaseHelper extends Object
Core functionality needed in all members of SQL service family. Taken out of SqlBaseService in order to be accessible from other helpers without having to autowire SqlRepositoryServiceImpl (as it causes problems with Spring AOP proxies.)- Author:
- lazyman, mederly
-
-
Constructor Summary
Constructors Constructor Description BaseHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.hibernate.Session
beginReadOnlyTransaction()
org.hibernate.Session
beginTransaction()
org.hibernate.Session
beginTransaction(boolean readOnly)
void
cleanupSessionAndResult(org.hibernate.Session session, OperationResult result)
@NotNull SqlRepositoryConfiguration
getConfiguration()
org.hibernate.SessionFactory
getSessionFactory()
org.springframework.orm.hibernate5.LocalSessionFactoryBean
getSessionFactoryBean()
void
handleGeneralCheckedException(Throwable ex, org.hibernate.Session session, OperationResult result)
void
handleGeneralException(Throwable ex, org.hibernate.Session session, OperationResult result)
void
handleGeneralRuntimeException(RuntimeException ex, org.hibernate.Session session, OperationResult result)
int
logOperationAttempt(String oid, String operation, int attempt, @NotNull RuntimeException ex, OperationResult result)
void
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
-
-
-
Method Detail
-
getSessionFactory
public org.hibernate.SessionFactory getSessionFactory()
-
setSessionFactory
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
-
getSessionFactoryBean
public org.springframework.orm.hibernate5.LocalSessionFactoryBean getSessionFactoryBean()
-
beginReadOnlyTransaction
public org.hibernate.Session beginReadOnlyTransaction()
-
beginTransaction
public org.hibernate.Session beginTransaction()
-
beginTransaction
public org.hibernate.Session beginTransaction(boolean readOnly)
-
getConfiguration
@NotNull public @NotNull SqlRepositoryConfiguration getConfiguration()
-
cleanupSessionAndResult
public void cleanupSessionAndResult(org.hibernate.Session session, OperationResult result)
-
handleGeneralException
public void handleGeneralException(Throwable ex, org.hibernate.Session session, OperationResult result)
-
handleGeneralRuntimeException
public void handleGeneralRuntimeException(RuntimeException ex, org.hibernate.Session session, OperationResult result)
-
handleGeneralCheckedException
public void handleGeneralCheckedException(Throwable ex, org.hibernate.Session session, OperationResult result)
-
logOperationAttempt
public int logOperationAttempt(String oid, String operation, int attempt, @NotNull @NotNull RuntimeException ex, OperationResult result)
-
-