tech.ydb.yoj.repository.db.Repository Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yoj-repository Show documentation
Show all versions of yoj-repository Show documentation
Core YOJ (YDB ORM for Java) abstractions and APIs for domain entities, repositories, transactions etc.
The newest version!
package tech.ydb.yoj.repository.db;
import java.util.Set;
public interface Repository {
default void createTablespace() {
}
default void checkDataCompatibility() {
}
default void checkSchemaCompatibility() {
}
> SchemaOperations schema(Class c);
/**
* @deprecated For testing purposes only. Will only reliably work for tables that were created or inspected
* using calls to {@link #schema(Class)}.
*/
@Deprecated
Set>> tables();
default RepositoryTransaction startTransaction() {
return startTransaction(IsolationLevel.SERIALIZABLE_READ_WRITE);
}
default RepositoryTransaction startTransaction(IsolationLevel isolationLevel) {
return startTransaction(TxOptions.create(isolationLevel));
}
RepositoryTransaction startTransaction(TxOptions options);
void dropDb();
String makeSnapshot();
void loadSnapshot(String id);
default boolean healthCheck() {
return true;
}
default void shutdown() {
}
}