Skip to content

Releases: Blazebit/blaze-persistence

1.6.4

27 Dec 12:34
Compare
Choose a tag to compare

We are happy to announce the fourth bug fix release of the 1.6 series. This release again contains not only bug fixes, but also some new features and bug fixes that I would like to highlight.

Jakarta artifacts

As of this release, we are publishing artifact variants with an artifact id suffix -jakarta which, as the name suggests, are Jakarta EE compatible.
This means that these artifacts depend on and use the jakarta.* namespace. We will most likely continue to ship separate artifacts for Jakarta EE compatibility until version 2.0.
With version 2.0 we will switch our main artifacts to use the jakarta namespace and instead produce -javaee artifacts for some time.

Ordered Set-Aggregate functions

Blaze-Persistence now supports ordered set-aggregate functions and the JPQL.Next language was extended to support the WITHIN GROUP clause syntax.
We added support for the PERCENTILE_CONT, PERCENTILE_DISC and MODE ordered set-aggregate functions and most importantly,
we also added a function for the SQL standard LISTAGG ordered set-aggregate function as alternative to GROUP_CONCAT
which we emulate on all major databases that have a supported vendor specific variant of the string aggregation, just like we did for GROUP_CONCAT before.

Have fun with string aggregations like LISTAGG(e.name, ', ') WITHIN GROUP (ORDER BY e.name)

JPA Criteria extensions

A great addition was made in the JPA Criteria module which now supports defining a WINDOW, analogously to the SQL WINDOW clause.
A WINDOW can be applied to window functions, as well as aggregate functions which are then used as window functions, and ordered set-aggregate functions.
Another nice addition is the possibility to specify a FILTER clause predicate for aggregate and ordered set-aggregate functions.

Here is a quick example that aggregates cat names that have an age greater than 10 as comma separated list, grouped by owner.

BlazeCriteriaBuilder cb = BlazeCriteria.get(criteriaBuilderFactory);
BlazeCriteriaQuery<Tuple> tupleQuery = cb.createTupleQuery();
BlazeRoot<Cat> cat = tupleQuery.from(Cat.class, "c");
tupleQuery.multiselect(
	cb.listagg(cat.get(Cat_.name), cb.literal(", "))
		.filter(cb.greaterThan(cat.get(Cat_.age), 10L))
		.withinGroup(cb.asc(cat.get(Cat_.name)))
);
tupleQuery.groupBy(cat.get(Cat_.owner));

Tuple actual = tupleQuery.createCriteriaBuilder(em).getResultList().get(0);

New GraphQL integrations

While helping a user to get started with SPQR, a GraphQL framework that is popular in the Spring ecosystem, a SPQR example application was developed.
Since the integration with SPQR was non-trivial, we introduced a new module that serves as integration between Blaze-Persistence and SPQR named blaze-persistence-integration-graphql-spqr
along with a new documentation section describing the setup.
The user wanted to go further and make use of updatable entity-views through GraphQL mutations, which we didn't have experience with so far.
It was very interesting to get into this and we are pretty happy with the way the integration turned out.

TLDR, GraphQL mutations are now supported for all GraphQL integration modules except for Netflix DGS, which can only be supported until version 4.6,
as the 4.6 release removed support for customizing the deserialization. Please help us convince the maintainers of DGS to consider adding an SPI by commenting and voting on the GitHub discussion

Take a look into the example applications to get a sense for how this can work out with your favorite framework!

Entity-View deserialization through JSONB

Since SmallRye GraphQL, the most popular implementation of MicroProfile GraphQL, relies on JSONB and we wanted to add support for GraphQL mutations for all GraphQL integration modules,
we decided to develop an entity-view integration for JSONB as well. Unlike Jackson, JSONB unfortunately doesn't provide support for registering deserializer object per type,
but instead requires to register a deserializer class per type, which means we have to generate these deserializer classes before registration.
The unfortunate consequence of this is, that this is currently a JVM only feature. We have plans to create an SPI that allows influencing code generation, which will solve this problem.

See the documentation for details about the setup of the JSONB integration.

While working on the JSONB integration, we noticed that our assumption about Jackson being the de-facto standard JSON framework for JAX-RS to be wrong,
as JSONB the only supported JSON serialization framework on MicroProfile GraphQL. This lead to a small breaking change.

JAX-RS integration split

Due to the addition of the JSONB integration, which also required a dedicated JAX-RS integration variant, we decided to split the blaze-persistence-integration-jaxrs artifact
and move out the Jackson framework specific parts into a separate module blaze-persistence-integration-jaxrs-jackson.

We are sorry for the inconvenience, but when updating to 1.6.4 you now have to additionally add the Jackson module dependency, as the blaze-persistence-integration-jaxrs now only contains the API classes.

Quarkus improvements/fixes

Just like in the CDI integration, we now fire a EntityViewConfiguration event that allows customization of configuration, registration of custom basic types etc.

We were informed that JSON serialization for entity views didn't work for native images which was now fixed. Thanks for the report!

Merry Christmas and a happy new year

We hope you enjoy this late Christmas present and wish you all a happy new year!

Take a look into the changelog for a full list of changes and improvements.

Enjoy the release and stay tuned for the next one!

1.6.3

10 Oct 09:12
Compare
Choose a tag to compare

We are happy to announce the third bug fix release of the 1.6 series. This release again contains not only bug fixes, but also some new features that I would like to highlight.

Yet again, thanks to the extensive testing of Eugen Mayer from KontextWork we polished the GraphQL integration even further.
The integration now supports inferring nullability of entity view attributes for the generated GraphQL schema based on the mapping expression.
On top of that, he also helped us fix an issue with the "single valued association id access optimization" for non primary key based foreign keys, which now also avoids producing a join.

We fixed a few bugs and lifted certain limitations for entity views:

  • Fix pagination issues when JOIN fetching for a collection and SUBSELECT fetching was used
  • Support SUBSELECT fetching when main query builder uses LIMIT/OFFSET and/or ORDER BY clauses
  • Validate more uses of MULTISET fetching for proper type support to avoid runtime errors
  • Validate mapping index expressions properly regarding their typing
  • Fix issues with setter determination in entity views when same named methods with different arguments exist
  • Fix concurrency issue in entity view annotation processor leading to strange errors

Thanks to our awesome community we fixed:

  • JPA Criteria bug regarding joins over embeddables and parameter handling issues
  • Fix compatibility with Quarkus 2.1+ by registering ValuesEntity in deployment integration
  • Fix base URI determination in Spring HATEOAS integration to be compatible with Spring HATEOAS 1.3.4
  • Fix parsing of LIKE predicate with parameter in ESCAPE
  • Fix literal parsing issues with a single backslash to match the requirements of the JPA spec
  • Fix rendering of literals in JPA Criteria and introduce configuration option to control value rendering
  • Make sure LIMIT/OFFSET is respected when generating a count query

The changes we had to do to in the string literal parsing and rendering to match the expectation of the JPA spec unvealed a non-standard compliant behavior of PostgreSQL,
which uses a backslash as default escape character in a LIKE predicate when no escape character is given.
We automatically escape the LIKE pattern now to guarantee the same behavior across databases, but this escaping might lead to double escaping if you already did escaping for PostgreSQL.

Make sure to remove your escaping i.e. replace("\\", "\\\\") from your code when updating to Blaze-Persistence 1.6.3.

Another thing to watch out in this release is the stricter type validation in entity views. Previously we didn't properly type validate all mapping expressions,
which could have lead to some runtime exceptions. Now that we do type validation, you might see startup failures though due to unsafe expressions.
A prime example of a possible issue is the comparison of an enum attribute with a string or integer i.e. the SQL representation.
A expression like case when type = 'KEY' then ... should be replaced with case when type = package.MyEnum.KEY then ... so that the comparison has matching types.

Take a look into the changelog for a full list of changes and improvements.

Enjoy the release and stay tuned for the next one!

1.6.2

05 Sep 17:33
Compare
Choose a tag to compare

We are happy to announce the second bug fix release of the 1.6 series. This release contains not only bug fixes, but also quite a few new features/integrations that I would like to highlight.

I'm very happy that Eugen Mayer from KontextWork did some extensive testing of the GraphQL integration (which obviously uncovered some bugs)
and prototyped the support for newer graphql-java versions as required for integrating with the Netflix DGS runtime.
Thanks to his help, we now also have an example that showcases how our GraphQL integration can be used with Netflix DGS. On top of that, we also added support for SmallRye GraphQL through the Microprofile GraphQL API,
as well as added an example application for that and updated the documentation by describing the necessary steps to setup the integration for the various runtimes.

The support for Spring Boot/Data 2.5 is now also ensured and verified as we added a new profile for testing the new version.

Thanks a lot to Jan-Willem Gmelig Meyling for his great work for the support for QueryDSL 5.0, the new FunctionContributor SPI
and the support for chunk-processing results through the new Stream<T> getResultStream() method that was also introduced with JPA 2.2 on javax.persistence.Query.

Take a look into the changelog for a full list of changes and improvements.

Enjoy the release and stay tuned for the next one!

1.6.1

08 Jul 07:17
Compare
Choose a tag to compare

We are happy to announce the first bug fix release of the 1.6 series. This release mainly contains bug fixes and one new feature that I would like to highlight.

The Entity-View annotation processor was adapted to be able to run in an incremental fashion i.e. within an incremental Gradle build and was parallelized to improve compilation times.
A big thank you goes out to KontextWork and their employees! They sponsored this feature as they had trouble with the build and compilation times and couldn't stand it anymore.

Now we can all enjoy improved generation and compilation times :)

As for the bug fixes, we improved the SQL we render for VALUES clauses and subqueries in the FROM clause to make it easier for certain database optimizers to efficient generate plans.
We also improved the support for running on the module path. While migrating a client application we noticed some issues, but with 1.6.1 they should be gone!

Take a look into the changelog for a full list of changes and improvements.

Enjoy the release and stay tuned for the next one!

1.6.0

24 Apr 18:33
Compare
Choose a tag to compare

We are happy to announce the final release of the 1.6 series. This release mainly fixes bugs and adds a few optimizations.

Some users were still using the 1.5 series although the 1.6 Alpha releases were already considered stable.
To avoid confusion about the stability of releases, we will try to avoid using the Alpha label in the future.

Take a look into the changelog for a full list of changes and improvements.

Enjoy the release and stay tuned for the next one!

1.6.0-Alpha2

17 Jan 23:39
Compare
Choose a tag to compare

We are happy to announce the second alpha release of the 1.6 series. We introduced a few new features and fixed quite a few bugs.

A big thank you goes out to Dane Lowe for implementing the conversion support from entities to entity views.
I'd also like to thank Ritesh and slyoldfox for investigating and fixing
issues they faced.

Most of the enhancements delivered in this release improve the performance of a few types of queries. The support for GROUPING SETS is user facing
which allows creating summarizations of aggregated data. For more information about grouping sets, take a look into the documentation.

This version now also adds support for Spring Data 2.4 and thus also Spring Framework 5.3.
We also worked on the support for Java 16 and thanks to slyoldfox, it seems we now also support the use of Spring Boot Dev-Tools.

Since we fixed a query plan cache related issue that could lead to wrong queries being executed in some cases, you should update as soon as possible to avoid running into these issues.

Take a look into the changelog for a full list of changes and improvements.

Enjoy the release and stay tuned for the next one!

1.6.0-Alpha1

21 Oct 22:51
Compare
Choose a tag to compare

We are happy to announce the first alpha release of the 1.6 series. We introduced two very interesting features that I would like to highlight.
The first is the support for specifying collection behavior for a multi-collection via the new @MultiCollectionMapping annotation which can be used
to configure a comparator or ordering for the collection within the indexed collection/map.
The next notable feature is the support for secondary entity view roots which can be imagined like correlations on steroids.

Since we also fixed a few issues, some in the Spring Data integration,
and one concurrency issue during entity view updater initialization, you should update as soon as possible to avoid running into these issues.

If you want to know more about the new features, take a look into the updated core
and entity view documentation.

Take a look into the changelog for a full list of changes and improvements.

I wish you all the best, stay safe and healthy in this hard times! Enjoy the release and stay tuned for the next one!

1.5.1

14 Sep 13:59
Compare
Choose a tag to compare

Here comes the first fix release for 1.5 containing a fix for our Hibernate 5.4 integration.
Hibernate 5.4.19.Final introduced a change that broke our integration and since Quarkus updates the Hibernate version pretty quickly,
we decided to publish a public 1.5 release containing this fix.

1.5.0

03 Sep 14:23
Compare
Choose a tag to compare

The last big feature for the 1.5 series, the support for custom index/key mapping expressions for List and Map entity view attributes,
was finally finished, which lead to this wonderful release today!

This release is pretty big, containing many bug fixes and quite a few great features.
The most notable features are JSON functions to access/manipulate fields of JSON columns, the support for joins in DML statements and the support for custom index/key mapping expressions for List and Map entity view attributes via the new @MappingIndex annotation.

If you want to know more about the new features or bug fixes, take a look into the changelog for a full list of changes and improvements.

This release concludes the planned community releases for the 1.5 series. We will publish community bug fix releases only for critical bug fixes.
If you need long term support please consider the commercial support options.

The master branch will now switch to the 1.6 series with the codename Lockjaw. Have fun with the release!

1.5.0-Alpha5

08 Jun 20:48
Compare
Choose a tag to compare

We recently switched from using JDK 9 to JDK 14 for our releases and accidentally compiled MR-JAR contents with the Java 14 classfile version.
This release fixes that, so that you can run Blaze-Persistence again with all Java versions from 9 to 13.
We also fixed a query plan caching bug for DML queries that are using the RETURNING clause along with other advanced features like CTEs.

If you want to know more about the new features or bug fixes, take a look into the changelog for a full list of changes and improvements.

We cut down the plan for the final 1.5 release down to the bare minimum. We will deliver further improvements through bug-fix releases.