Skip to content

1.2

Choose a tag to compare

@BalusC BalusC released this 29 Oct 11:48
· 151 commits to main since this release
db8e622

Minor release with new entity base classes, value based keyset paging, nullness annotations and auditing fixes. Not a drop-in replacement for 1.1.x: see "Breaking changes".

Breaking changes

  • Page: the public constructors are now private. Use Page.of(...) or Page.with()...build(). #42
  • Page#getLast() is removed. Use Page#getLastOrderingValues(). #42
  • Bool.value(Boolean) is now Bool.value(boolean) and Bool.isTruthy(Object) now returns boolean. Source compatible, but code compiled against a previous version must be recompiled. #41

New features

  • LockedEntity and LockedBaseEntity: only a @Version column, without created and lastModified. #51
  • Page.with().range(offset, limit, lastOrderingValues, reversed): keyset paging with only the ordering values of the last seen record, e.g. its ID. A Page no longer holds an entity. #42
  • The public API is annotated with jakarta.annotation.Nullable where null is accepted or returned. #40

Auditing changes

  • Snapshots of audited values are kept per entity instance and released along with it. Before, every loaded entity stayed in memory. #53
  • Two persistence contexts updating the same entity are both audited. #53
  • A second change of the same entity after a flush is audited against the previous flush. #53
  • Loading an audited entity outside a BaseEntityService, e.g. via a plain EntityManager, no longer throws a NullPointerException. #53
  • @Audit fields of superclasses are now audited. #53
  • @Audit fields must be of a basic type, not an entity or collection. #53
  • On OpenJPA, BaseEntityService#update() of a detached entity is now audited. A plain EntityManager#merge() outside BaseEntityService is still not audited there. #53

Bug fixes

  • Association mappings are resolved per EntityManagerFactory and per field path. A filter on a path reached via a second path or back through the root entity, e.g. phones.owner.groups, no longer throws UnsupportedOperationException. With multiple persistence units, the first one no longer wins for all. #47
  • On OpenJPA, field paths through a @ManyToOne or @OneToOne are now resolved. #47
  • An entity whose @Table has no name falls back to the class name. #52
  • Ordering on a field without a getter falls back to field access. #49
  • A built Page is no longer modified when its Builder is reused. #42

Thanks to @EotT123 for #39 to #46 and #49.