Skip to content

YOJ 2.6.16 (API improvements)

Compare
Choose a tag to compare
@nvamelichev nvamelichev released this 01 May 12:51
· 40 commits to main since this release

⚠️ Those migrating from versions < 2.6.15 should first consult the release notes for 2.6.15.

Key changes ( ❌ denotes breaking changes )

  • YdbTable now exposes its QueryExecutor to subclasses via a protected getExecutor() method, and adds a public getSchema() method for getting entity schema used for mapping the rows of this table. This makes custom tables with custom queries a little less quirky (but this is still far from an official way of creating custom statements; that will be explored in #43).
  • ➕ New @InternalApi annotation that clearly specifies which publicly visible parts of YOJ API (interfaces, classes, methods, fields, constants, and so on) are implementation details exposed for cross-package and cross-module usage.
  • Table interface method find(Set<ID>) is now required. Direct implementors of Table must implement this new method (either by delegating to another Table or by using the internal TableQueryImpl utility). Those who extended AbstractDelegatingTable don't need to do anything.
  • Table interface has dropped the getFirstLevelCache() method. There is no replacement.
    • Direct implementors of Table should just delete their implementation of getFirstLevelCache().
    • Users of Table.getFirstLevelCache() should do one of the following:
      • Reconsider their usage of Internal API.
      • If the usage cannot be eliminated, obtain a FirstLevelCache instance by getting it from current RepositoryTransaction's TransactionLocal:
        var tx = Tx.Current.get();
        var repositoryTransaction = tx.getRepositoryTransaction();
        var transactionLocal = repositoryTransaction.getTransactionLocal();
        var cache = transactionLocal.firstLevelCache(<table descriptor>);
        First-level cache can only be used if you have a RepositoryTransaction instance or can obtain it from current Tx instance (which is established by TxManager, so if you're inside a transaction body, you can do this). First-level cache is per-table descriptor per-transaction; its behavior outside of transaction is undefined.