Skip to content

Commit

Permalink
Prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Jul 20, 2018
1 parent 376b967 commit 14323b7
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 7 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ Not yet released

### New features

None

### Bug fixes

None

### Backwards-incompatible changes

None

## 1.3.0-Alpha2

20/07/2018 - [Release tag](https://github.com/Blazebit/blaze-persistence/releases/tag/1.3.0-Alpha2) [Resolved issues](https://github.com/Blazebit/blaze-persistence/issues?utf8=%E2%9C%93&q=is%3Aissue+milestone%3A1.3.0+is%3Aclosed+closed%3A%3C2018-07-21)

### New features

* Add support for providing entity view optional parameters in spring-data repositories via `@OptionalParam`
* Introduced `EMBEDDING_VIEW` function as proper replacement for many `OUTER` function uses in entity views
* Smoothen support for embeddables in updatable entity views
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,30 @@ FROM Cat c

NOTE: Although JPA does not mandate the support for subqueries in the `SELECT` clause, every major JPA provider supports it.

You can even use the `OUTER` function or macros within the correlation join path!

[source,java]
----
CriteriaBuilder<Long> cb = cbf.create(em, Long.class)
.from(Cat.class, "c")
.selectSubquery()
.from("OUTER(kittens)", "kitty")
.select("COUNT(kitty.id)")
.end();
----

This will result in the same JPQL as before as `OUTER` will refer to the query root of the outer query.

[source,sql]
----
SELECT
(
SELECT COUNT(kitty.id)
FROM c.kittens kitty
)
FROM Cat c
----

[[anchor-entity-joins]]
==== Entity joins

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ interface CatView {
return subqueryBuilder.from(Cat.class, "subCat")
.select("COUNT(*)")
.whereOr()
.where("subCat.father.id").eqExpression("OUTER(id)")
.where("subCat.mother.id").eqExpression("OUTER(id)")
.where("subCat.father.id").eqExpression("EMBEDDING_VIEW(id)")
.where("subCat.mother.id").eqExpression("EMBEDDING_VIEW(id)")
.endOr()
.end();
}
Expand All @@ -334,9 +334,9 @@ SELECT
FROM Cat cat
----

In the subquery provider before you saw the usage of `OUTER` which is gone in the final query.
This is because `OUTER` is a way to refer to attributes of the parent query root without having to refer to the concrete the query alias.
For more information on this check out the documentation of the link:{core_doc}#outer-function[`OUTER` function]
In the subquery provider before you saw the usage of `EMBEDDING_VIEW` which is gone in the final query.
This is because `EMBEDDING_VIEW` is a way to refer to attributes of the relation of the entity view into which the subquery is embedded without having to refer to the concrete the query alias.
For more information on this check out the documentation of the <<embedding-view,`EMBEDDING_VIEW` function>>

TIP: The subquery was just used for illustration purposes and could be replaced with a basic mapping `SIZE(kittens)` which would also generate a more efficient query.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The flushing, by default, is done by executing JPQL DML statements, but can be c

To declare an entity view as being creatable, it is required to additionally annotate it with `@CreatableEntityView`.
Note that updatable entity views for embeddable types are implicitly also creatable, yet the `@CreatableEntityView` annotation can still be applied for further configuration.
By default, a creatable entity view is validated against the backing model regarding it's _persistability_ i.e. it is checked if an instance could be successfully persisted regarding the non-null constraints of the entity model.
By default, a creatable entity view is valid@ated against the backing model regarding it's _persistability_ i.e. it is checked if an instance could be successfully persisted regarding the non-null constraints of the entity model.
This allows to catch errors early that occur when adding new attributes to the entity model but forgetting to do so in the entity view.
The validation can be disabled by setting the `validatePersistability` attribute on the `@CreatableEntityView` to `false`
but can also be controlled in a fine grained manner by excluding specific entity attributes from the validation via the `excludedEntityAttributes` attribute.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,18 @@ by constructing a `KeysetPageRequest`. Note that constructing a `KeysetPageReque
the Spring Data Rest integration might come in handy. For stateful server side frameworks, it's best to put the `KeysetAwarePage` into a session like storage
to be able to use the `previousOrFirst()` and `next()` methods for retrieving `KeysetPageable` objects.

When using named query parameters in an entity view, these parameters are usually passed in as optional parameters rather than normal query parameters.
Since there is currently no possibility to provide a custom `EntityViewSetting` object for a repository method, it is possible to annotate a parameter with `@OptionalParam`
to designate it as being an optional parameter and to be included in the generated `EntityViewSetting`.

[source,java]
----
@Transactional(readOnly = true)
public interface SimpleCatViewRepository extends Repository<Cat, Long> {
List<SimpleCatView> findAll(@OptionalParam Locale language);
}
----

All other Spring Data repository features like restrictions, pagination, slices and ordering are supported as usual.
Please consult the Spring Data documentation for further information.

Expand Down
2 changes: 1 addition & 1 deletion website/src/main/jbake/content/downloads.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

[.releases]
|===
| 1.3.0-Alpha1 | 2018-07-05 | https://github.com/Blazebit/blaze-persistence/releases/download/1.3.0-Alpha1/blaze-persistence-dist-1.3.0-Alpha1.zip[*Download*, window="_blank"] link:news/2018/blaze-persistence-1.2.1-and-1.3.0-Alpha1-release.html[More...]
| 1.3.0-Alpha2 | 2018-07-20 | https://github.com/Blazebit/blaze-persistence/releases/download/1.3.0-Alpha2/blaze-persistence-dist-1.3.0-Alpha2.zip[*Download*, window="_blank"] link:news/2018/blaze-persistence-1.3.0-Alpha2-release.html[More...]
| 1.2.1 | 2018-07-05 | https://github.com/Blazebit/blaze-persistence/releases/download/1.2.1/blaze-persistence-dist-1.2.1.zip[*Download*, window="_blank"] link:news/2018/blaze-persistence-1.2.1-and-1.3.0-Alpha1-release.html[More...]
| 1.1.1 | 2016-09-29 | https://github.com/Blazebit/blaze-persistence/releases/download/1.1.1/blaze-persistence-dist-1.1.1.zip[*Download*, window="_blank"] link:news/2016/blaze-persistence-1.1.1-release.html[More...]
|===
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
= Blaze-Persistence 1.3.0-Alpha2 Release
Christian Beikov
2018-07-05 0
:description: Blaze-Persistence version 1.3.0-Alpha2 was just released
:page: news
:icon: christian_head.png
:jbake-tags: announcement,release
:jbake-type: post
:jbake-status: published
:linkattrs:

Blaze-Persistence version 1.3.0-Alpha2 adds a few new features but mainly focused on bug fixes!

The main features are the support for the new https://github.com/Blazebit/blaze-persistence/issues/367[`EMBEDDING_VIEW` function, window="_blank"] in entity views,
that finally allows to refer to the entity relation of a view that embeds a `SubqueryProvider` or `CorrelationProvider`, but also in case of simple subviews.
Giovanni Lovato did his first PR and added support for passing entity view optional parameters to spring data repository methods via https://github.com/Blazebit/blaze-persistence/issues/325[`@OptionalParam`, window="_blank"],
thank you for that!
A few other notable changes and fixes
* https://github.com/Blazebit/blaze-persistence/issues/421[*#421*, window="_blank"] Allow the use of `OUTER` and macros for subquery correlation joins
* https://github.com/Blazebit/blaze-persistence/issues/597[*#597*, window="_blank"] Smoothen support for associations in embeddables especially in updatable entity views
* https://github.com/Blazebit/blaze-persistence/issues/601[*#601*, window="_blank"] Fix problems in entity views with `SELECT` fetching of entities with embedded ids
* https://github.com/Blazebit/blaze-persistence/issues/602[*#602*, window="_blank"] Fix problems in entity views with `SUBSELECT` fetching when subview uses named parameters multiple times
* https://github.com/Blazebit/blaze-persistence/issues/608[*#608*, window="_blank"] Omit null precedence +++<!-- PREVIEW-SUFFIX --><!-- </p></li></ul></div> --><!-- PREVIEW-END -->+++ emulation expression on MySQL when it matches the native behavior
We are making good progress on the 1.3 timeline, but a final release will probably take a few more weeks as we preferred fixing bugs that new users encountered over strictly following our plan.
Currently, we assume we can do the 1.3.0 final release by mid August, and we will most likely publish another Alpha release by end of July.
Grab the release while it's hot! We appreciate any feedback, so let us know what you think of this release :)

0 comments on commit 14323b7

Please sign in to comment.