mirror of
https://github.com/Qortal/qortal.git
synced 2025-03-30 09:05:52 +00:00
No need for database.DB class as the code is specific to HSQLDB so moved into relevant repository.hsqldb classes. Top-level Repository instance (e.g. HSQLDBRepository) is used within subclasses, e.g. HSQLDBBlockRepository, so they can share the same repository state, like underlying SQL Connection for easier transactional support. HSQLDBRepository subclasses now call checkedExecute() on top-level repository instance, instead of passing Connection to obsolete DB.checkedExecute. No need for qora.block.BlockFactory any more as those methods are now in repository. More work on Blocks and Transactions in general.
16 lines
364 B
Java
16 lines
364 B
Java
package repository;
|
|
|
|
public abstract class RepositoryManager {
|
|
|
|
private static RepositoryFactory repositoryFactory;
|
|
|
|
public static void setRepositoryFactory(RepositoryFactory newRepositoryFactory) {
|
|
repositoryFactory = newRepositoryFactory;
|
|
}
|
|
|
|
public static Repository getRepository() throws DataException {
|
|
return repositoryFactory.getRepository();
|
|
}
|
|
|
|
}
|