tech.ydb.yoj.repository.test.sample.TestDbImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yoj-repository-test Show documentation
Show all versions of yoj-repository-test Show documentation
Basic tests which all YOJ Repository implementations must pass.
The newest version!
package tech.ydb.yoj.repository.test.sample;
import lombok.experimental.Delegate;
import tech.ydb.yoj.repository.db.Repository;
import tech.ydb.yoj.repository.db.StdTxManager;
import tech.ydb.yoj.repository.db.Tx;
import tech.ydb.yoj.repository.db.TxManager;
public class TestDbImpl implements TestDb {
@Delegate
private final TxManager txManagerImpl;
public TestDbImpl(R repository) {
txManagerImpl = new StdTxManager(repository)
.withLogStatementOnSuccess(true);
}
@Delegate
protected TestEntityOperations db() {
return (TestEntityOperations) Tx.Current.get().getRepositoryTransaction();
}
}