github immutables/immutables 2.8.1
2.8.1 Criteria & Repositories API, Update

latest releases: 2.10.1, 2.10.0, 2.9.3...
4 years ago

Immutables team is happy to announce Immutables 2.8.1 release.

This release 2.8.1 comes one month after 2.8.0 and contains several improvements, bugfixes and new functionalities.

Notable changes

Criteria

  • Generate criteria DSL from existing JavaBeans(spec) classes. Useful for projects which use JavaBeans for legacy reasons or not yet fully migrated to immutables. See #1103
  • Pluggable ID resolution. Introduce IdResolver interface to allow users to provide their own annotations (or logic) for ID attribute selection. It complements default @Criteria.Id annotation.
  • Initial support for partial updates. Allow partial changes to be applied directly by the backend (if supported).
repository.update(person.id.is(123))
  .set(person.name, "Changed Name")
  .set(person.age, 33)
  .execute()
  • Support top-level count() operation similar to COUNT(*) in SQL
repository.findAll().count();
repository.find(person.age.greaterThan(33)).count();
  • Add upsert / update operations on entity in Writable interface

Mongo jackson adapter

  • Support BSON undefined type which is converted to java null (9a64881)
  • Support BSON binary data (76fb7b44)
  • Lazily read values from bson stream (1c07466). Potentially a performance improvement since values don't have to be deserialized unless required by deserializer. Allows faster skipChildren() calls.
  • Make BsonGenerator null safe on strings and numbers (ba78d7)

Mongo repositories

Changes related to mongo repositories (predecessor to criteria).

  • Enable _id initialization in MongoDB (#1074). PR from André Rouél
  • bson4gson adapter. Support BSON undefined type translated to java null
  • bson4gson adapter. Friendlier type conversion between BSON temporal types and java numbers (int / long etc.)
  • bson4gson adapter. Fix peek() method in JsonReader (6f1247)
  • Require Java 8

Codegen

  • Support lazy hashing via lazyhash attribute. Contrary to existing prehash, lazyhash would compute hashcode on first access to hashCode() method.
  • Changed how META-INF/annotations/org.immutables.value.immutable is read - disabled URLConnection caching. PR-1060 from Canay ÖZEL
  • Set optBits for Modifiable, Default maps. PR-1086 from Dylan Wragge

Third party library upgrades and other dependencies

  • Jackson databind 2.8.11.3 -> 2.8.11.4 (9ea18)
  • Mongo java (sync) driver 3.10.1 -> 3.11.0 (33f98d4)
  • Mongo reactive streams 1.11 -> 1.12 (fed2e07)
  • rxjava2 2.2.10 -> 2.2.12 (c6e06ce)
  • ErrorProne 2.3.2 -> 2.3.3 (b62fab4f)
  • Remove utility maven module (1089). All modules will declare dependencies explicitly.

Thanks to all contributors. In no particular order:

Don't miss a new immutables release

NewReleases is sending notifications on new releases.