Class RestoreDao
java.lang.Object
com.atlassian.confluence.impl.backuprestore.restore.dao.RestoreDao
Allows to perform all DB operations required for space and site restore.
- Since:
- 7.20.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Contains an insert SQL script and a collection of values for the whole insert batch -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Supplier<org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate>
protected final org.springframework.transaction.PlatformTransactionManager
-
Constructor Summary
ConstructorsConstructorDescriptionRestoreDao
(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
Modifier and TypeMethodDescription<T> T
doInReadOnlyTransaction
(org.springframework.transaction.support.TransactionCallback<T> callback) <T> T
doInTransaction
(org.springframework.transaction.support.TransactionCallback<T> callback) generateIds
(org.hibernate.id.IdentifierGenerator identifierGenerator, Object fakeObject, int count) Generates multiple ids.insertRecordsInTransaction
(Collection<RestoreDao.RecordsForBatchInsert> recordsForBatchInserts) Inserts records for different tables in one transaction.runNativeQueryInTransaction
(String query, Map<String, ?> paramMap, int limit) int
runNativeUpdateQuery
(String query, Map<String, ?> paramMap) int
setNextHiValue
(long nextHi)
-
Field Details
-
transactionManager
protected final org.springframework.transaction.PlatformTransactionManager transactionManager -
jdbcTemplateSupplier
protected final Supplier<org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate> jdbcTemplateSupplier
-
-
Constructor Details
-
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 Details
-
setNextHiValue
public int setNextHiValue(long nextHi) -
getNextHiValue
-
generateIds
public Collection<Serializable> 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) -
runNativeUpdateQuery
-
doInTransaction
public <T> T doInTransaction(org.springframework.transaction.support.TransactionCallback<T> callback) -
doInReadOnlyTransaction
public <T> T doInReadOnlyTransaction(org.springframework.transaction.support.TransactionCallback<T> callback)
-