Class RestoreDao
- java.lang.Object
-
- com.atlassian.confluence.impl.backuprestore.restore.dao.RestoreDao
-
public class RestoreDao extends Object
Allows to perform all DB operations required for space and site restore.- Since:
- 7.20.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RestoreDao.RecordsForBatchInsert
Contains an insert SQL script and a collection of values for the whole insert batch
-
Field Summary
Fields Modifier and Type Field Description protected Supplier<org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate>
jdbcTemplateSupplier
protected org.springframework.transaction.PlatformTransactionManager
transactionManager
-
Constructor Summary
Constructors Constructor Description RestoreDao(org.hibernate.SessionFactory sessionFactory, org.springframework.transaction.PlatformTransactionManager transactionManager)
RestoreDao(org.hibernate.SessionFactory sessionFactory, org.springframework.transaction.PlatformTransactionManager transactionManager, Supplier<org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate> jdbcTemplateSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
doInReadOnlyTransaction(org.springframework.transaction.support.TransactionCallback<T> callback)
<T> T
doInTransaction(org.springframework.transaction.support.TransactionCallback<T> callback)
Collection<Object>
generateIds(org.hibernate.id.IdentifierGenerator identifierGenerator, Object fakeObject, int count)
Generates multiple ids.Long
getNextHiValue()
Collection<ImportedObjectV2>
insertRecordsInTransaction(Collection<RestoreDao.RecordsForBatchInsert> recordsForBatchInserts)
Inserts records for different tables in one transaction.List<DbRawObjectData>
runNativeQueryInTransaction(String query, Map<String,?> paramMap, int limit)
int
runNativeUpdateQuery(String query, Map<String,?> paramMap)
int
setNextHiValue(long nextHi)
-
-
-
Field Detail
-
transactionManager
protected final org.springframework.transaction.PlatformTransactionManager transactionManager
-
jdbcTemplateSupplier
protected final Supplier<org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate> jdbcTemplateSupplier
-
-
Constructor Detail
-
RestoreDao
public RestoreDao(org.hibernate.SessionFactory sessionFactory, org.springframework.transaction.PlatformTransactionManager transactionManager)
-
RestoreDao
public RestoreDao(org.hibernate.SessionFactory sessionFactory, org.springframework.transaction.PlatformTransactionManager transactionManager, Supplier<org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate> jdbcTemplateSupplier)
-
-
Method Detail
-
setNextHiValue
public int setNextHiValue(long nextHi)
-
getNextHiValue
public Long getNextHiValue()
-
generateIds
public Collection<Object> generateIds(org.hibernate.id.IdentifierGenerator identifierGenerator, Object fakeObject, int count)
Generates multiple ids. Currently, it still generates ids one by one, but the implementation can be replaced in the future.
-
insertRecordsInTransaction
public Collection<ImportedObjectV2> insertRecordsInTransaction(Collection<RestoreDao.RecordsForBatchInsert> recordsForBatchInserts)
Inserts records for different tables in one transaction.- Returns:
- persisted objects
-
runNativeQueryInTransaction
public List<DbRawObjectData> runNativeQueryInTransaction(String query, Map<String,?> paramMap, int limit)
-
doInTransaction
public <T> T doInTransaction(org.springframework.transaction.support.TransactionCallback<T> callback)
-
doInReadOnlyTransaction
public <T> T doInReadOnlyTransaction(org.springframework.transaction.support.TransactionCallback<T> callback)
-
-