https://in.relation.to/In Relation To Blog2024-03-22T12:27:07+00:00https://in.relation.to/2024/03/20/orm-65cr1/Hibernate 6.5.0.CR12024-03-22T12:27:07+00:002024-03-20T00:00:00+00:00Steve Ebersole
6.5 brings many new features, in addition to many improvements and fixes.
Java Time Handling
Java Time objects can now be directly marshalled through the JDBC driver as defined by JDBC 4.2.
In previous versions, Hibernate would handle Java Time objects using java.sql.Date, java.sql.Time or
java.sql.Timestamp references as intermediate forms.
Another behavioral change with this is handling for timezones. OffsetDateTime, OffsetTime and
ZonedDateTime all encode explicit timezone information. With direct marshalling, Hibernate simply
passes along the value as-is. In the legacy behavior, since the java.sql variants do not
encode timezone information, Hibernate generally has to specially handle timezones when converting to
those intermediate forms.
For 6.5 this...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>6.5 brings many new features, in addition to many improvements and fixes.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="java-time"><a class="anchor" href="#java-time" />Java Time Handling</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Java Time objects can now be directly marshalled through the JDBC driver as defined by JDBC 4.2.
In previous versions, Hibernate would handle Java Time objects using <code>java.sql.Date</code>, <code>java.sql.Time</code> or
<code>java.sql.Timestamp</code> references as intermediate forms.</p>
</div>
<div class="paragraph">
<p>Another behavioral change with this is handling for timezones. <code>OffsetDateTime</code>, <code>OffsetTime</code> and
<code>ZonedDateTime</code> all encode explicit timezone information. With direct marshalling, Hibernate simply
passes along the value as-is. In the legacy behavior, since the <code>java.sql</code> variants do not
encode timezone information, Hibernate generally has to specially handle timezones when converting to
those intermediate forms.</p>
</div>
<div class="paragraph">
<p>For 6.5 this behavior is disabled by default. To opt-in,</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="properties">hibernate.type.prefer_java_type_jdbc_types=true</code></pre>
</div>
</div>
<div class="paragraph">
<p>See the <a href="https://docs.jboss.org/hibernate/orm/6.5/javadocs/org/hibernate/cfg/MappingSettings.html#PREFER_JAVA_TYPE_JDBC_TYPES">setting Javadoc</a> for additional details.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="query-cache-layout"><a class="anchor" href="#query-cache-layout" />Configurable Query Cache Layout</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In Hibernate ORM 6.0 the query cache layout changed from a "shallow" representation of entities and collections,
to a "full" representation. This was done to support re-materializing join fetched data from the query cache data
without hitting the database. Storing the full data in the query cache leads to a higher memory consumption,
which in turn might also hurt application throughput due to a higher garbage collection activity.</p>
</div>
<div class="paragraph">
<p>6.5 adds the ability to configure the format in which query results are stored in the query cache, either</p>
</div>
<div class="ulist">
<ul>
<li>
<p>globally via the <code>hibernate.cache.query_cache_layout</code> setting</p>
</li>
<li>
<p>per entity or collection via the <code>@QueryCacheLayout</code> annotation</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The global <code>hibernate.cache.query_cache_layout</code> setting defaults to the <code>AUTO</code> value,
which will automatically choose <code>SHALLOW</code> or <code>FULL</code> for an entity/collection,
depending on whether the entity/collection is cacheable.</p>
</div>
<div class="paragraph">
<p>Applications that want to retain the <code>FULL</code> cache layout that Hibernate ORM 6.0 used should configure
the global property <code>hibernate.cache.query_cache_layout=FULL</code>.
Applications that want the cache layout that Hibernate ORM 5 and older versions used should configure
the global property <code>hibernate.cache.query_cache_layout=SHALLOW</code>.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
<div class="paragraph">
<p>Even with the <code>SHALLOW</code> cache layout, the association eagerness implied through join fetches will be respected,
and associations will be eagerly initialized. So there is no change of behavior when choosing a different cache layout.</p>
</div>
<div class="paragraph">
<p>With <code>SHALLOW</code>, Hibernate might need to hit the database to materialize the associated data <strong>if it does not exist in the second level cache</strong>.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="record-as-idclass"><a class="anchor" href="#record-as-idclass" />Allow Java record as @IdClass</h2>
<div class="sectionbody">
<div class="paragraph">
<p>A Java record can now be used as an <code>@IdClass</code></p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java">record PK(<span style="color:#0a8;font-weight:bold">Integer</span> key1, <span style="color:#0a8;font-weight:bold">Integer</span> key2) {}
<span style="color:#007">@Entity</span>
<span style="color:#007">@IdClass</span>(PK.class)
<span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">AnEntity</span> {
<span style="color:#007">@Id</span> <span style="color:#0a8;font-weight:bold">Integer</span> key1;
<span style="color:#007">@Id</span> <span style="color:#0a8;font-weight:bold">Integer</span> key2;
...
}</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="auto-filters"><a class="anchor" href="#auto-filters" />Support for Auto Enabled Filters</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Filters can now be automatically enabled for each Session and StatelessSession</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@FilterDef</span>(
name=<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">active-filter</span><span style="color:#710">"</span></span>,
condition=<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">status = true</span><span style="color:#710">"</span></span>,
autoEnabled=<span style="color:#069">true</span>
)
<span style="color:#007">@Filter</span>(name=<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">active-filter</span><span style="color:#710">"</span></span>)
<span style="color:#007">@Entity</span>
<span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">DeletableEntity</span> {
...
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Can be combined with the ability to dynamically resolve condition parameters, e.g.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">TenantIdResolver</span> <span style="color:#088;font-weight:bold">implements</span> Supplier<<span style="color:#0a8;font-weight:bold">String</span>> {
<span style="color:#007">@Override</span>
<span style="color:#088;font-weight:bold">public</span> <span style="color:#0a8;font-weight:bold">String</span> get() {
<span style="color:#080;font-weight:bold">return</span> SomeContext.determineTenantId();
}
}
<span style="color:#007">@FilterDef</span>(
name=<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">tenancy-filter</span><span style="color:#710">"</span></span>,
condition=<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">tenant_id = :tenantId</span><span style="color:#710">"</span></span>,
autoEnabled=<span style="color:#069">true</span>,
parameter = <span style="color:#007">@ParamDef</span>(
name=<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">tenantId</span><span style="color:#710">"</span></span>,
type=<span style="color:#0a8;font-weight:bold">String</span>.class,
resolver=TenantIdResolver.class
)
)
<span style="color:#007">@Filter</span>(name=<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">tenancy-filter</span><span style="color:#710">"</span></span>)
<span style="color:#007">@Entity</span>
<span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">SensitiveData</span> {
...
}</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="sqm-mutation-joins"><a class="anchor" href="#sqm-mutation-joins" />Joined Mutation Queries</h2>
<div class="sectionbody">
<div class="paragraph">
<p>UPDATE and DELETE queries can now use joins, e.g.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code>delete from Person p where p.association.someAttr = 1</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="manually-assigned-generated-ids"><a class="anchor" href="#manually-assigned-generated-ids" />Manually Assigned Identifiers with custom <code>Generator</code></h2>
<div class="sectionbody">
<div class="paragraph">
<p>Manually assigned identifier values can now be used with custom a <code>Generator</code> thanks to the new <code>allowAssignedIdentifiers()</code> method.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">MyIdGenerator</span> <span style="color:#088;font-weight:bold">implements</span> Generator {
...
<span style="color:#007">@Override</span> <span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">boolean</span> allowAssignedIdentifiers() {
<span style="color:#080;font-weight:bold">return</span> <span style="color:#069">true</span>;
}
}
<span style="color:#007">@IdGeneratorType</span>(MyIdGenerator.class)
<span style="color:#007">@Target</span>({METHOD, FIELD})
<span style="color:#007">@Retention</span>(RUNTIME)
<span style="color:#007">@interface</span> MyGeneratedId {
}
<span style="color:#007">@Entity</span>
<span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Book</span> {
<span style="color:#007">@Id</span> <span style="color:#007">@MyGeneratedId</span>
<span style="color:#0a8;font-weight:bold">Integer</span> id;
...
}
<span style="color:#0a8;font-weight:bold">Book</span> book = <span style="color:#080;font-weight:bold">new</span> <span style="color:#0a8;font-weight:bold">Book</span>(<span style="color:#00D">1</span>,...)
session.persist(book);</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="query-result-count"><a class="anchor" href="#query-result-count" />SelectionQuery.getResultCount()</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Selection queries now have the ability to report the number of results there will
be in the final result.</p>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important" />
</td>
<td class="content">
This triggers a query against the database.
</td>
</tr>
</table>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#0a8;font-weight:bold">Query</span> query = session.createQuery(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">from Person</span><span style="color:#710">"</span></span>);
<span style="color:#339;font-weight:bold">int</span> results = query.getResultCount();</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="key-pagination"><a class="anchor" href="#key-pagination" />Key-based Pagination</h2>
<div class="sectionbody">
<div class="paragraph">
<p>As an incubating feature, 6.5 offers support for <a href="https://docs.jboss.org/hibernate/orm/6.5/introduction/html_single/Hibernate_Introduction.html#key-based-pagination">key-based pagination</a> (sometimes called "keyset" pagination) via both <code>SelectionQuery</code> and <a href="https://docs.jboss.org/hibernate/orm/6.5/introduction/html_single/Hibernate_Introduction.html#key-based-paging">generated query methods</a>.</p>
</div>
<div class="paragraph">
<p>Please see the Javadoc for <a href="https://docs.jboss.org/hibernate/orm/6.5/javadocs/org/hibernate/query/KeyedPage.html"><code>KeyedPage</code></a> and <a href="https://docs.jboss.org/hibernate/orm/6.5/javadocs/org/hibernate/query/KeyedResultList.html"><code>KeyedResultList</code></a> for more information.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="on-conflict"><a class="anchor" href="#on-conflict" />ON CONFLICT Clause for Insert Queries</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Both HQL and Criteria now support an optional ON CONFLICT clause to allow controlling what
should happen when a constraint violation occurs, e.g.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code>insert into Person (id, name)
values (1, 'John')
on conflict do nothing</code></pre>
</div>
</div>
<div class="paragraph">
<p>See the <a href="https://docs.jboss.org/hibernate/orm/6.5/userguide/html_single/Hibernate_User_Guide.html#hql-insert">User Guide</a> for more details.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="stateless-session"><a class="anchor" href="#stateless-session" />Work on StatelessSession</h2>
<div class="sectionbody">
<div class="paragraph">
<p><code>StatelessSession</code> now supports <a href="https://hibernate.atlassian.net/browse/HHH-17620">filters</a> and <a href="https://hibernate.atlassian.net/browse/HHH-17673">SQL logging</a></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="jakarta-data"><a class="anchor" href="#jakarta-data" />Jakarta Data</h2>
<div class="sectionbody">
<div class="paragraph">
<p>6.5 also includes a tech preview of Jakarta Data based on the Hibernate annotation processor.</p>
</div>
</div>
</div>
https://in.relation.to/2024/02/28/hibernate-search-7-1-0-Final/Hibernate Search 7.1.0.Final is out!2024-03-22T12:27:07+00:002024-02-28T00:00:00+00:00Marko Bekhta
We are pleased to announce the release of Hibernate Search 7.1.0.Final.
Compared to Hibernate Search 7.0,
this release introduces vector search capabilities,
allows looking up the capabilities of each field in the metamodel,
adds a new query string predicate,
simplifies the entity registration in the Standalone POJO mapper,
brings compatibility with Elasticsearch 8.12 and OpenSearch 2.12,
upgrades to Lucene 9.9,
and brings other bugfixes and improvements.
What’s new compared to Hibernate Search 7.0
Dependency upgrades
Lucene
The Lucene backend now uses Lucene 9.9.
Besides other improvements it brings better vector search performance.
Elasticsearch
The Elasticsearch backend works with Elasticsearch 8.12 as well as other versions that were already compatible.
OpenSearch
The Elasticsearch backend works with OpenSearch 2.12...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We are pleased to announce the release of Hibernate Search 7.1.0.Final.</p>
</div>
<div class="paragraph">
<p>Compared to Hibernate Search 7.0,
this release introduces vector search capabilities,
allows looking up the capabilities of each field in the metamodel,
adds a new query string predicate,
simplifies the entity registration in the Standalone POJO mapper,
brings compatibility with Elasticsearch 8.12 and OpenSearch 2.12,
upgrades to Lucene 9.9,
and brings other bugfixes and improvements.</p>
</div>
<div class="paragraph">
<p><!-- more --></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new-compared-to-hibernate-search-7-0"><a class="anchor" href="#whats-new-compared-to-hibernate-search-7-0" />What’s new compared to Hibernate Search 7.0</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="dependency-upgrades"><a class="anchor" href="#dependency-upgrades" />Dependency upgrades</h3>
<div id="lucene-version" class="dlist">
<dl>
<dt class="hdlist1">Lucene</dt>
<dd>
<p>The Lucene backend now uses Lucene 9.9.
Besides other improvements it brings better vector search performance.</p>
</dd>
</dl>
</div>
<div id="elasticsearch-version" class="dlist">
<dl>
<dt class="hdlist1">Elasticsearch</dt>
<dd>
<p>The Elasticsearch backend works with Elasticsearch 8.12 as well as other versions that were already compatible.</p>
</dd>
</dl>
</div>
<div id="opensearch-version" class="dlist">
<dl>
<dt class="hdlist1">OpenSearch</dt>
<dd>
<p>The Elasticsearch backend works with OpenSearch 2.12 as well as other versions that were already compatible.</p>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="vector-search"><a class="anchor" href="#vector-search" />Vector search for Lucene and Elasticsearch Backends</h3>
<div class="paragraph">
<p>Hibernate Search now allows vector search in Lucene and Elasticsearch backends as an incubating feature.
Vector search provides the tools to search over binary (images, audio or video) or text data:
external tools convert that data to vectors (arrays of bytes or floats, also called "embeddings"),
which are then used for indexing and queries in Hibernate Search.
Hibernate Search introduces a new field type — <code>@VectorField</code> and a new predicate <code>knn</code>, so that the vectors can be indexed
and then searched upon.</p>
</div>
<div class="paragraph">
<p>Vector fields can work with vector data represented as <code>byte</code> or <code>float</code> arrays in the documents.
Out of the box <code>byte[]</code> and <code>float[]</code> property types will work with the new field type. For any other entity property types,
a custom <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#binding-valuebridge">value bridge</a>
or <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#binding-valuebridge-valuebinder">value binder</a> should be implemented.
Keep in mind that indexed vectors <strong>must</strong> be of the same length
and that this length should be specified upfront for the schema to be created:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java"><span style="color:#007">@Entity</span>
<span style="color:#007">@Indexed</span>
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Book</span> {
<span style="color:#007">@Id</span>
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">Integer</span> id;
<span style="color:#007">@VectorField</span>(dimension = <span style="color:#00D">512</span>)
<span style="color:#088;font-weight:bold">private</span> <span style="color:#339;font-weight:bold">float</span><span style="color:#339;font-weight:bold">[]</span> coverImageEmbeddings;
<span style="color:#777">// Other properties ...</span>
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Searching for vector similarities is performed via a <code>knn</code> predicate:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java"><span style="color:#339;font-weight:bold">float</span><span style="color:#339;font-weight:bold">[]</span> coverImageEmbeddingsVector = <span style="color:#777">/*...*/</span>
<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f ->
<span style="color:#777">// provide the number of similar documents to look for:</span>
f.knn( <span style="color:#00D">5</span> )
<span style="color:#777">// the name of the vector field:</span>
.field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">coverImageEmbeddings</span><span style="color:#710">"</span></span> )
<span style="color:#777">// matched documents will be the ones whose indexed vector</span>
<span style="color:#777">// is "most similar" to this vector</span>
.matching( coverImageEmbeddingsVector )
<span style="color:#777">// additionally an optional filter can be supplied</span>
<span style="color:#777">// to provide a regular fulltext search predicate</span>
.filter( f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors.firstName</span><span style="color:#710">"</span></span> ).matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">arthur</span><span style="color:#710">"</span></span> ) )
).fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="paragraph">
<p>Note that each backend may have its own specifics and limitations with regard to the vector search.
For more details look at the related <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#search-dsl-predicate-knn-limitations">documentation</a>.</p>
</div>
</div>
<div class="sect2">
<h3 id="metamodel-field-capabilities"><a class="anchor" href="#metamodel-field-capabilities" />Looking up the capabilities of each field in the metamodel</h3>
<div class="paragraph">
<p>It is now possible to see which capabilities (predicates/sorts/projections/etc.)
are available for a field when <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#mapping-inspect">inspecting the metamodel</a>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java">SearchMapping mapping = <span style="color:#777">/*...*/</span> ;
<span style="color:#777">// Retrieve a SearchIndexedEntity:</span>
SearchIndexedEntity<<span style="color:#0a8;font-weight:bold">Book</span>> bookEntity = mapping.indexedEntity( <span style="color:#0a8;font-weight:bold">Book</span>.class );
<span style="color:#777">// Get the descriptor for that index.</span>
<span style="color:#777">// The descriptor exposes the index metamodel:</span>
IndexDescriptor indexDescriptor = bookEntity.indexManager().descriptor();
<span style="color:#777">// Retrieve a field by name</span>
<span style="color:#777">// and inspect its capabilities if such field is present:</span>
indexDescriptor.field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">releaseDate</span><span style="color:#710">"</span></span> ).ifPresent( field -> {
<span style="color:#080;font-weight:bold">if</span> ( field.isValueField() ) {
<span style="color:#777">// Get the descriptor for the field type:</span>
IndexValueFieldTypeDescriptor type = field.toValueField().type();
<span style="color:#777">// Inspect the "traits" of a field type:</span>
<span style="color:#777">// each trait represents a predicate/sort/projection/aggregation</span>
<span style="color:#777">// that can be used on fields of that type.</span>
<span style="color:#0a8;font-weight:bold">Set</span><<span style="color:#0a8;font-weight:bold">String</span>> traits = type.traits();
<span style="color:#080;font-weight:bold">if</span> ( traits.contains( IndexFieldTraits.Aggregations.RANGE ) ) {
<span style="color:#777">// ...</span>
}
<span style="color:#080;font-weight:bold">if</span> ( traits.contains( IndexFieldTraits.Predicates.EXISTS ) ) {
<span style="color:#777">// ...</span>
}
<span style="color:#777">// ...</span>
}
} );</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="search-dsl-predicate-query-string"><a class="anchor" href="#search-dsl-predicate-query-string" />Query string predicate</h3>
<div class="paragraph">
<p>The <code>queryString</code> predicate matches documents according to a structured query given as a string.
It allows building more advanced query strings (using Lucene’s query language) and has more configuration options than a
<a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#search-dsl-predicate-simple-query-string"><code>simpleQueryString</code> predicate</a>.</p>
</div>
<div class="exampleblock">
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f -> f.queryString().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">description</span><span style="color:#710">"</span></span> )
.matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">robots +(crime investigation disappearance)^10 +</span><span style="color:#b0b">\"</span><span style="color:#D20">investigation help</span><span style="color:#b0b">\"</span><span style="color:#D20">~2 -/(dis)?a[p]+ea?ance/</span><span style="color:#710">"</span></span> ) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="paragraph">
<p>The query string, in this predicate, will result in a boolean query with 4 clauses:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>a should clause matching <code>robots</code>;</p>
</li>
<li>
<p>two must clauses</p>
<div class="ulist">
<ul>
<li>
<p>another boolean query constructed from <code>(crime || investigation || disappearance)</code> string with a boost of <code>10</code></p>
</li>
<li>
<p>a query matching the phrase <code>investigation help</code> with the phrase slop equals to <code>2</code></p>
</li>
</ul>
</div>
</li>
<li>
<p>a must not clause matching a regular expression <code>(dis)?a[p]+ea?ance</code></p>
<div class="paragraph">
<p>Note that each of the mentioned clauses may itself end up being translated into other types of queries.</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="paragraph">
<p>See this section of the reference documentation on the <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#search-dsl-predicate-query-string"><code>queryString</code> predicate</a>
for more information.</p>
</div>
</div>
<div class="sect2">
<h3 id="standalon-pojo-mapper-simpler-entity-registration"><a class="anchor" href="#standalon-pojo-mapper-simpler-entity-registration" />Simpler entity registration in the Standalone POJO mapper</h3>
<div class="paragraph">
<p>Hibernate Search simplifies how <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#concepts-entity">entities</a> can be defined.
For standalone mapper now it is enough to annotate your entities with the <code>@SearchEntity</code> annotation.</p>
</div>
<div class="exampleblock">
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java"><span style="color:#007">@SearchEntity</span> <i class="conum" data-value="1" /><b>(1)</b>
<span style="color:#777">// ... Other annotations, e.g. @Indexed if this entity needs to be mapped to an index.</span>
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Book</span> {
<span style="color:#007">@Id</span>
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">Integer</span> id;
<span style="color:#777">// Other properties ...</span>
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1" /><b>1</b></td>
<td>Annotate the type with <code>@SearchEntity</code> so it is treated as an entity.</td>
</tr>
</table>
</div>
</div>
</div>
<div class="paragraph">
<p>Another update related to this is a way the <code>SearchMappingBuilder</code> builder is created.
Now it requires an annotated type source to be provided.</p>
</div>
<div class="exampleblock">
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java">CloseableSearchMapping searchMapping =
SearchMapping.builder( AnnotatedTypeSource.fromClasses( <i class="conum" data-value="1" /><b>(1)</b>
<span style="color:#0a8;font-weight:bold">Book</span>.class, Associate.class, Manager.class ))
.property( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">hibernate.search.backend.hosts</span><span style="color:#710">"</span></span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">elasticsearch.mycompany.com</span><span style="color:#710">"</span></span> ) <i class="conum" data-value="2" /><b>(2)</b>
<span style="color:#777">// ...</span>
.build(); <i class="conum" data-value="3" /><b>(3)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1" /><b>1</b></td>
<td>Create a builder, passing an <code>AnnotatedTypeSource</code> to let Hibernate Search know where to look for annotations.
<div class="paragraph">
<p>Thanks to <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#mapping-classpath-scanning">classpath scanning</a>,
your <code>AnnotatedTypeSource</code> only needs to include one class
from each JAR containing annotated types.
Other types should be automatically discovered.</p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="2" /><b>2</b></td>
<td>Set additional configuration properties.</td>
</tr>
<tr>
<td><i class="conum" data-value="3" /><b>3</b></td>
<td>Build the <code>SearchMapping</code>.</td>
</tr>
</table>
</div>
</div>
</div>
<div class="paragraph">
<p>See this section of the reference documentation on the <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#mapping-entitydefinition">entity definition</a>
for more information.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="new-since-last-cr"><a class="anchor" href="#new-since-last-cr" />What’s new compared to Hibernate Search 7.0.0.CR1</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5083">HSEARCH-5083</a>: Upgrade to AWS SDK 2.24.1.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5091">HSEARCH-5091</a>: Upgrade to Elasticsearch <strong>client</strong> 8.12.2.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5087">HSEARCH-5087</a>: Add compatibility with OpenSearch 2.12.0.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5039">HSEARCH-5039</a>: Fix an issue with knn predicates that require multi-tenant filters.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5088">HSEARCH-5088</a>: Limit OpenSearch vector search capabilities to 2.9+ versions.
While earlier versions of OpenSearch have already introduced the vector search capabilities,
2.9 is the first version where all features required for integration were introduced.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>And more. For a full list of changes since the previous releases,
please see the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32265">release notes</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/7.1/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="getting-started-migrating"><a class="anchor" href="#getting-started-migrating" />Getting started, migrating</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For new applications,
refer to the getting started guide:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.1/getting-started/orm/en-US/html_single/">here for the Hibernate ORM integration</a></p>
</li>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.1/getting-started/standalone/en-US/html_single/">here for the Standalone POJO Mapper</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For existing applications, Hibernate Search 7.1 is a drop-in replacement for 7.0,
assuming you also upgrade the dependencies.
Information about deprecated configuration and API
is included in the <a href="https://docs.jboss.org/hibernate/search/7.1/migration/html_single/">migration guide</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2024/02/12/hibernate-search-7-1-0-CR1/Hibernate Search 7.1.0.CR1 is out2024-03-22T12:27:07+00:002024-02-12T00:00:00+00:00Marko Bekhta
We just published Hibernate Search 7.1.0.CR1,
a first candidate release of the next minor version of Hibernate Search.
This version brings a lot of updates and improvements for working with a Standalone POJO mapper,
new query string predicate,
and takes advantage of Elasticsearch 8.12 to remove some of the limitations on vector search capabilities.
What’s new
For a summary of all new features and improvements since 7.0,
head to the dedicated page on hibernate.org.
Dependency upgrades
Hibernate ORM (HSEARCH-5078)
Hibernate Search now depends on Hibernate ORM 6.4.4.Final.
Lucene (HSEARCH-5069)
The Lucene backend now uses Lucene 9.9.2,
which brings some bug fixes related to vector search.
Elasticsearch (HSEARCH-5077)
The Elasticsearch backend now is compatible with Elasticsearch...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We just published Hibernate Search 7.1.0.CR1,
a first candidate release of the next minor version of Hibernate Search.</p>
</div>
<div class="paragraph">
<p>This version brings a lot of updates and improvements for working with a Standalone POJO mapper,
new query string predicate,
and takes advantage of Elasticsearch 8.12 to remove some of the limitations on vector search capabilities.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
<div class="paragraph">
<p>For a summary of all new features and improvements since 7.0,
head to <a href="https://hibernate.org/search/releases/7.1/#whats-new">the dedicated page on hibernate.org</a>.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="dependency-upgrades"><a class="anchor" href="#dependency-upgrades" />Dependency upgrades</h3>
<div id="orm-version" class="dlist">
<dl>
<dt class="hdlist1">Hibernate ORM (<a href="https://hibernate.atlassian.net/browse/HSEARCH-5078">HSEARCH-5078</a>)</dt>
<dd>
<p>Hibernate Search now depends on Hibernate ORM 6.4.4.Final.</p>
</dd>
</dl>
</div>
<div id="lucene-version" class="dlist">
<dl>
<dt class="hdlist1">Lucene (<a href="https://hibernate.atlassian.net/browse/HSEARCH-5069">HSEARCH-5069</a>)</dt>
<dd>
<p>The Lucene backend now uses Lucene 9.9.2,
which brings some bug fixes related to vector search.</p>
</dd>
</dl>
</div>
<div id="elasticsearch-version" class="dlist">
<dl>
<dt class="hdlist1">Elasticsearch (<a href="https://hibernate.atlassian.net/browse/HSEARCH-5077">HSEARCH-5077</a>)</dt>
<dd>
<p>The Elasticsearch backend now is compatible with Elasticsearch latest 8.12.1 as well as with other versions that were already compatible.</p>
</dd>
</dl>
</div>
<div id="others-version" class="dlist">
<dl>
<dt class="hdlist1">Others</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5077">HSEARCH-5077</a>: Upgrade to Elasticsearch <strong>client</strong> 8.12.1</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5074">HSEARCH-5074</a>: Upgrade to JBeret 2.2.1.Final</p>
</li>
</ul>
</div>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="search-dsl-predicate-knn"><a class="anchor" href="#search-dsl-predicate-knn" /><code>knn</code> predicate updates</h3>
<div class="paragraph">
<p>With the 8.12 release of Elasticsearch, a new <a href="https://www.elastic.co/guide/en/elasticsearch/reference/8.12/query-dsl-knn-query.html"><code>knn</code> query</a>
was introduced. This query is more aligned with the vector search capabilities provided by Hibernate Search,
and integration with Elasticsearch was updated to use this new query.
This means that previous limitations imposed on the vector search when using the Elastic distribution of the Elasticsearch backend
are now removed.</p>
</div>
<div class="paragraph">
<p>It also means that vector search on Elasticsearch is now only available with Elasticsearch 8.12 and later;
Hibernate Search no longer supports vector search on Elasticsearch 8.11 and earlier.</p>
</div>
<div class="paragraph">
<p>To remind how vector search works: for vector fields to be indexed, they should be annotated with a <code>@VectorField</code> annotation:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java"><span style="color:#007">@Entity</span>
<span style="color:#007">@Indexed</span>
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Book</span> {
<span style="color:#007">@Id</span>
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">Integer</span> id;
<span style="color:#007">@VectorField</span>(dimension = <span style="color:#00D">512</span>)
<span style="color:#088;font-weight:bold">private</span> <span style="color:#339;font-weight:bold">float</span><span style="color:#339;font-weight:bold">[]</span> coverImageEmbeddings;
<span style="color:#777">// Other properties ...</span>
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Then, searching for vector similarities is performed via a <code>knn</code> predicate:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java"><span style="color:#339;font-weight:bold">float</span><span style="color:#339;font-weight:bold">[]</span> coverImageEmbeddingsVector = <span style="color:#777">/*...*/</span>
<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f ->
<span style="color:#777">// provide the number of similar documents to look for:</span>
f.knn( <span style="color:#00D">5</span> )
<span style="color:#777">// the name of the vector field:</span>
.field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">coverImageEmbeddings</span><span style="color:#710">"</span></span> )
<span style="color:#777">// matched documents will be the ones whose indexed vector</span>
<span style="color:#777">// is "most similar" to this vector</span>
.matching( coverImageEmbeddingsVector )
).fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="paragraph">
<p>See this section of the reference documentation on <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#mapping-directfieldmapping-annotations-vectorfield">vector fields</a>
and the one on a <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#search-dsl-predicate-knn"><code>knn</code> predicate</a>
for more information.</p>
</div>
</div>
<div class="sect2">
<h3 id="search-dsl-predicate-query-string"><a class="anchor" href="#search-dsl-predicate-query-string" />Query string predicate</h3>
<div class="paragraph">
<p>The <code>queryString</code> predicate matches documents according to a structured query given as a string.
It allows building more advanced query strings (using Lucene’s query language) and has more configuration options than a
<a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#search-dsl-predicate-simple-query-string"><code>simpleQueryString</code> predicate</a>.</p>
</div>
<div class="exampleblock">
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f -> f.queryString().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">description</span><span style="color:#710">"</span></span> )
.matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">robots +(crime investigation disappearance)^10 +</span><span style="color:#b0b">\"</span><span style="color:#D20">investigation help</span><span style="color:#b0b">\"</span><span style="color:#D20">~2 -/(dis)?a[p]+ea?ance/</span><span style="color:#710">"</span></span> ) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="paragraph">
<p>The query string, in this predicate, will result in a boolean query with 4 clauses:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>a should clause matching <code>robots</code>;</p>
</li>
<li>
<p>two must clauses</p>
<div class="ulist">
<ul>
<li>
<p>another boolean query constructed from <code>(crime || investigation || disappearance)</code> string with a boost of <code>10</code></p>
</li>
<li>
<p>a query matching the phrase <code>investigation help</code> with the phrase slop equals to <code>2</code></p>
</li>
</ul>
</div>
</li>
<li>
<p>a must not clause matching a regular expression <code>(dis)?a[p]+ea?ance</code></p>
<div class="paragraph">
<p>Note that each of the mentioned clauses may itself end up being translated into other types of queries.</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="paragraph">
<p>See this section of the reference documentation on the <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#search-dsl-predicate-query-string"><code>queryString</code> predicate</a>
for more information.</p>
</div>
</div>
<div class="sect2">
<h3 id="standalon-pojo-mapper-simpler-entity-registration"><a class="anchor" href="#standalon-pojo-mapper-simpler-entity-registration" />Simpler entity registration in the Standalone POJO mapper</h3>
<div class="paragraph">
<p>Hibernate Search simplifies how <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#concepts-entity">entities</a> can be defined.
For standalone mapper now it is enough to annotate your entities with the <code>@SearchEntity</code> annotation.</p>
</div>
<div class="exampleblock">
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java"><span style="color:#007">@SearchEntity</span> <i class="conum" data-value="1" /><b>(1)</b>
<span style="color:#777">// ... Other annotations, e.g. @Indexed if this entity needs to be mapped to an index.</span>
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Book</span> {
<span style="color:#007">@Id</span>
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">Integer</span> id;
<span style="color:#777">// Other properties ...</span>
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1" /><b>1</b></td>
<td>Annotate the type with <code>@SearchEntity</code> so it is treated as an entity.</td>
</tr>
</table>
</div>
</div>
</div>
<div class="paragraph">
<p>Another update related to this is a way the <code>SearchMappingBuilder</code> builder is created.
Now it requires an annotated type source to be provided.</p>
</div>
<div class="exampleblock">
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java">CloseableSearchMapping searchMapping =
SearchMapping.builder( AnnotatedTypeSource.fromClasses( <i class="conum" data-value="1" /><b>(1)</b>
<span style="color:#0a8;font-weight:bold">Book</span>.class, Associate.class, Manager.class ))
.property( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">hibernate.search.backend.hosts</span><span style="color:#710">"</span></span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">elasticsearch.mycompany.com</span><span style="color:#710">"</span></span> ) <i class="conum" data-value="2" /><b>(2)</b>
<span style="color:#777">// ...</span>
.build(); <i class="conum" data-value="3" /><b>(3)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1" /><b>1</b></td>
<td>Create a builder, passing an <code>AnnotatedTypeSource</code> to let Hibernate Search know where to look for annotations.
<div class="paragraph">
<p>Thanks to <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#mapping-classpath-scanning">classpath scanning</a>,
your <code>AnnotatedTypeSource</code> only needs to include one class
from each JAR containing annotated types.
Other types should be automatically discovered.</p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="2" /><b>2</b></td>
<td>Set additional configuration properties.</td>
</tr>
<tr>
<td><i class="conum" data-value="3" /><b>3</b></td>
<td>Build the <code>SearchMapping</code>.</td>
</tr>
</table>
</div>
</div>
</div>
<div class="paragraph">
<p>See this section of the reference documentation on the <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#mapping-entitydefinition">entity definition</a>
for more information.</p>
</div>
</div>
<div class="sect2">
<h3 id="standalon-pojo-mapper-targeting-entities-by-name"><a class="anchor" href="#standalon-pojo-mapper-targeting-entities-by-name" />Targeting entities by name in the Standalone POJO Mapper</h3>
<div class="paragraph">
<p>The standalone POJO mapper adds a new way, previously available for Hibernate ORM integration only, for creating a search scope
from type names. The type name for the standalone POJO mapper is the name used when registering an entity,
be it via the <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#mapping-entitydefinition-name"><code>@SearchEntity(name=…)</code> annotation</a>
or through the <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#mapping-entitydefinition-programmatic">programmatic definition</a> using <code>.searchEntity()</code>.</p>
</div>
<div class="exampleblock">
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java">SearchMapping searchMapping = <span style="color:#777">/* ... */</span> <i class="conum" data-value="1" /><b>(1)</b>
SearchScope<<span style="color:#0a8;font-weight:bold">Book</span>> bookScope = searchMapping.scope( <span style="color:#0a8;font-weight:bold">Book</span>.class ); <i class="conum" data-value="2" /><b>(2)</b>
SearchScope<Person> personSubTypesScope = searchMapping.scope( Person.class,
<span style="color:#0a8;font-weight:bold">List</span>.of( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">Manager</span><span style="color:#710">"</span></span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">Associate</span><span style="color:#710">"</span></span> ) ); <i class="conum" data-value="3" /><b>(3)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1" /><b>1</b></td>
<td><a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#entrypoints-search-mapping">Retrieve the <code>SearchMapping</code></a>.</td>
</tr>
<tr>
<td><i class="conum" data-value="2" /><b>2</b></td>
<td>Create a <code>SearchScope</code> targeting only the <code>Book</code> entity type using a class.</td>
</tr>
<tr>
<td><i class="conum" data-value="3" /><b>3</b></td>
<td>Create a <code>SearchScope</code> targeting only the <code>Manager</code> and <code>Associate</code> subtypes using their entity names.</td>
</tr>
</table>
</div>
</div>
</div>
<div class="paragraph">
<p>See this section of the reference documentation on the <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#entrypoints-search-scope">ways to create search scope</a>
for more information.</p>
</div>
</div>
<div class="sect2">
<h3 id="other-changes"><a class="anchor" href="#other-changes" />Other improvements and bug fixes</h3>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5020">HSEARCH-5020</a>:
Hibernate Search increases the maximum allowed vector dimension for a Lucene backend to <code>4096</code> to allow indexing longer vectors produced by some models.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5073">HSEARCH-5073</a>:
Hibernate Search now allows specifying a <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#search-dsl-predicate-simple-query-string-minimumshouldmatch">minimum-should-match parameter</a> on a simple query predicate.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>And more. For a full list of changes since the previous releases,
please see the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32251">release notes</a>.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/7.1/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="getting-started-migrating"><a class="anchor" href="#getting-started-migrating" />Getting started, migrating</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For new applications,
refer to the getting started guide:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.1/getting-started/orm/en-US/html_single/">here for the Hibernate ORM integration</a></p>
</li>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.1/getting-started/standalone/en-US/html_single/">here for the Standalone POJO Mapper</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For existing applications, Hibernate Search 7.1 is a drop-in replacement for 7.0,
assuming you also upgrade the dependencies.
Information about deprecated configuration and API
is included in the <a href="https://docs.jboss.org/hibernate/search/7.1/migration/html_single/">migration guide</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2024/02/08/orm-644-final/Hibernate ORM 6.4.4.Final released2024-03-22T12:27:07+00:002024-02-08T00:00:00+00:00Marco Belladelli
Today, we published a new maintenance release of Hibernate ORM: 6.4.4.Final.
What’s new
This release introduces some minor improvements and a few bug fixes.
You can find the full list of 6.4.4.Final changes here.
Additional resources
For additional details, see:
the release page
the Migration Guide
the Hibernate 6 Introduction
the User Guide
See also the following resources related to supported APIs:
the compatibility policy
the incubating API report (@Incubating)
the deprecated API report (@Deprecated + @Remove)
the internal API report (internal packages, @Internal)
Community
Visit the website for details on getting in touch with us....
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Today, we published a new maintenance release of Hibernate ORM: 6.4.4.Final.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This release introduces some minor improvements and a few bug fixes.</p>
</div>
<div class="paragraph">
<p>You can find the full list of 6.4.4.Final changes <a href="https://hibernate.atlassian.net/issues/?jql=project%20%3D%20HHH%20AND%20fixVersion%20%3D%206.4.4">here</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="additional-resources"><a class="anchor" href="#additional-resources" />Additional resources</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.4/">release page</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/introduction/html_single/Hibernate_Introduction.html">Hibernate 6 Introduction</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>See also the following resources related to supported APIs:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://hibernate.org/community/compatibility-policy/">compatibility policy</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/incubating/incubating.txt">incubating API report</a> (<code>@Incubating</code>)</p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/deprecated/deprecated.txt">deprecated API report</a> (<code>@Deprecated</code> + <code>@Remove</code>)</p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/internals/internal.txt">internal API report</a> (internal packages, <code>@Internal</code>)</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="community"><a class="anchor" href="#community" />Community</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Visit the <a href="https://hibernate.org/community/">website</a> for details on getting in touch with us.</p>
</div>
</div>
</div>
https://in.relation.to/2024/02/02/orm-643-final/Hibernate 6.4.3.Final Released2024-03-22T12:27:06+00:002024-02-02T00:00:00+00:00Andrea Boriero
Today, we published a new maintenance release of Hibernate ORM 6.4: 6.4.3.Final
What’s new
This release introduces a few minor improvements as well as bug fixes.
You can find the full list of 6.4.3.Final changes here.
Conclusion
For additional details, see:
the release page
the Migration Guide
the Hibernate 6 Introduction
the User Guide
See also the following resources related to supported APIs:
the compatibility policy
the incubating API report (@Incubating)
the deprecated API report (@Deprecated + @Remove)
the internal API report (internal packages, @Internal)
Feedback, issues, ideas?
To get in touch, use the usual channels:
hibernate tag on Stack Overflow (usage questions)
User forum (usage questions, general feedback)
Chat (usage questions)
Issue tracker (bug reports, feature requests)
Mailing list (development-related...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Today, we published a new maintenance release of Hibernate ORM 6.4: 6.4.3.Final</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This release introduces a few minor improvements as well as bug fixes.</p>
</div>
<div class="paragraph">
<p>You can find the full list of 6.4.3.Final changes <a href="https://hibernate.atlassian.net/issues/?jql=project%20%3D%20HHH%20AND%20fixVersion%20%3D%206.4.3">here</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="conclusion"><a class="anchor" href="#conclusion" />Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.4/">release page</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/introduction/html_single/Hibernate_Introduction.html">Hibernate 6 Introduction</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>See also the following resources related to supported APIs:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://hibernate.org/community/compatibility-policy/">compatibility policy</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/incubating/incubating.txt">incubating API report</a> (<code>@Incubating</code>)</p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/deprecated/deprecated.txt">deprecated API report</a> (<code>@Deprecated</code> + <code>@Remove</code>)</p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/internals/internal.txt">internal API report</a> (internal packages, <code>@Internal</code>)</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the usual channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://stackoverflow.com/questions/tagged/hibernate"><strong>hibernate</strong> tag on Stack Overflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-orm">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.zulipchat.com/#narrow/stream">Chat</a> (usage questions)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/jira/software/c/projects/HHH/issues">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2024/01/24/hibernate-search-7-1-0-Alpha2/Hibernate Search 7.1.0.Alpha2 is out2024-03-22T12:27:07+00:002024-01-24T00:00:00+00:00Marko Bekhta
We just published Hibernate Search 7.1.0.Alpha2,
a second alpha release of the next minor version of Hibernate Search.
This version brings more vector search capabilities and improvements
as well as integrates Elasticsearch’s/OpenSearch’s vector search capabilities.
What’s new
Hibernate Search 7.1 is still in its early stages of development:
some features are still incomplete or may change in a backward-incompatible way.
Dependency upgrades
Hibernate ORM (HSEARCH-5060)
Hibernate Search now depends on Hibernate ORM 6.4.2.Final.
Which brings among other things a couple of fixes to address
possible issues with mass indexing when an ORM discriminator multi tenancy is in use.
Lucene (HSEARCH-5043)
The Lucene backend now uses Lucene 9.9.1.
Which beyond other improvements brings better performance...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We just published Hibernate Search 7.1.0.Alpha2,
a second alpha release of the next minor version of Hibernate Search.</p>
</div>
<div class="paragraph">
<p>This version brings more vector search capabilities and improvements
as well as integrates Elasticsearch’s/OpenSearch’s vector search capabilities.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
<div class="paragraph">
<p>Hibernate Search 7.1 is still in its early stages of development:
some features are still incomplete or may change in a backward-incompatible way.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="dependency-upgrades"><a class="anchor" href="#dependency-upgrades" />Dependency upgrades</h3>
<div id="orm-version" class="dlist">
<dl>
<dt class="hdlist1">Hibernate ORM (<a href="https://hibernate.atlassian.net/browse/HSEARCH-5060">HSEARCH-5060</a>)</dt>
<dd>
<p>Hibernate Search now depends on Hibernate ORM 6.4.2.Final.
Which brings among other things a couple of fixes to address
<a href="https://hibernate.atlassian.net/browse/HSEARCH-5031">possible issues with mass indexing</a> when an ORM discriminator multi tenancy is in use.</p>
</dd>
</dl>
</div>
<div id="lucene-version" class="dlist">
<dl>
<dt class="hdlist1">Lucene (<a href="https://hibernate.atlassian.net/browse/HSEARCH-5043">HSEARCH-5043</a>)</dt>
<dd>
<p>The Lucene backend now uses Lucene 9.9.1.
Which beyond other improvements brings better performance for vector search.</p>
</dd>
</dl>
</div>
<div id="elasticsearch-version" class="dlist">
<dl>
<dt class="hdlist1">Elasticsearch (<a href="https://hibernate.atlassian.net/browse/HSEARCH-5032">HSEARCH-5032</a>)</dt>
<dd>
<p>The Elasticsearch backend now is also compatible with Elasticsearch 8.12 as well as with other versions that were already compatible.</p>
</dd>
</dl>
</div>
<div id="others-version" class="dlist">
<dl>
<dt class="hdlist1">Others</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5032">HSEARCH-5032</a>: Upgrade to Elasticsearch <strong>client</strong> 8.12.0</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5057">HSEARCH-5057</a>: Upgrade to AWS SDK 2.23.3</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5047">HSEARCH-5047</a>: Upgrade to JBeret 2.2.0.Final</p>
</li>
</ul>
</div>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="vector-search"><a class="anchor" href="#vector-search" />Vector search for Lucene and Elasticsearch Backends</h3>
<div class="paragraph">
<p>This version of Hibernate Search builds on top of the previous alpha and integrates Elasticsearch/OpenSearch vector search capabilities.
To recap: vector search provides the tools to search over binary (images, audio or video) or text data:
external tools convert that data to vectors (arrays of bytes or floats, also called "embeddings"),
which are then used for indexing and queries in Hibernate Search.
Hibernate Search introduces a new field type — <code>@VectorField</code> and a new predicate <code>knn</code>, so that the vectors can be indexed
and then searched upon.</p>
</div>
<div class="paragraph">
<p>Vector fields can work with vector data represented as <code>byte</code> or <code>float</code> arrays in the documents.
Out of the box <code>byte[]</code> and <code>float[]</code> property types will work with the new field type. For any other entity property types,
a custom <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#binding-valuebridge">value bridge</a>
or <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#binding-valuebridge-valuebinder">value binder</a> should be implemented.
Keep in mind that indexed vectors <strong>must</strong> be of the same length
and that this length should be specified upfront for the schema to be created:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java"><span style="color:#007">@Entity</span>
<span style="color:#007">@Indexed</span>
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Book</span> {
<span style="color:#007">@Id</span>
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">Integer</span> id;
<span style="color:#007">@VectorField</span>(dimension = <span style="color:#00D">512</span>)
<span style="color:#088;font-weight:bold">private</span> <span style="color:#339;font-weight:bold">float</span><span style="color:#339;font-weight:bold">[]</span> coverImageEmbeddings;
<span style="color:#777">// Other properties ...</span>
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Searching for vector similarities is performed via a <code>knn</code> predicate:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java"><span style="color:#339;font-weight:bold">float</span><span style="color:#339;font-weight:bold">[]</span> coverImageEmbeddingsVector = <span style="color:#777">/*...*/</span>
<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f ->
<span style="color:#777">// provide the number of similar documents to look for:</span>
f.knn( <span style="color:#00D">5</span> )
<span style="color:#777">// the name of the vector field:</span>
.field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">coverImageEmbeddings</span><span style="color:#710">"</span></span> )
<span style="color:#777">// matched documents will be the ones whose indexed vector</span>
<span style="color:#777">// is "most similar" to this vector</span>
.matching( coverImageEmbeddingsVector )
<span style="color:#777">// additionally an optional filter can be supplied</span>
<span style="color:#777">// to provide a regular fulltext search predicate</span>
.filter( f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors.firstName</span><span style="color:#710">"</span></span> ).matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">arthur</span><span style="color:#710">"</span></span> ) )
).fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="paragraph">
<p>By its nature a <code>knn</code> predicate will always try to find nearest vectors,
even if the found vectors are quite far away from each other, i.e. are not that similar.
This may lead to getting irrelevant results returned by the query.</p>
</div>
<div class="paragraph">
<p>To address this, a <code>knn</code> predicate allows <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#search-dsl-predicate-knn-with-similarity">configuring the minimum required similarity</a>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java"><span style="color:#339;font-weight:bold">float</span><span style="color:#339;font-weight:bold">[]</span> coverImageEmbeddingsVector = <span style="color:#777">/*...*/</span>
<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f ->
<span style="color:#777">// Create a knn predicate as usual:</span>
f.knn( <span style="color:#00D">5</span> ).field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">coverImageEmbeddings</span><span style="color:#710">"</span></span> ).matching( coverImageEmbeddingsVector )
<span style="color:#777">// Specify the required minimum similarity value, to filter out irrelevant results:</span>
.requiredMinimumSimilarity( <span style="color:#00D">5</span> ) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="paragraph">
<p>Note that each backend may have its own specifics and limitations with regard to the vector search.
For more details look at the related <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#search-dsl-predicate-knn-limitations">documentation</a>.</p>
</div>
<div class="paragraph">
<p>See this section of the reference documentation on <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#mapping-directfieldmapping-annotations-vectorfield">vector fields</a>
and the one on a <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#search-dsl-predicate-knn"><code>knn</code> predicate</a>
for more information.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
<div class="paragraph">
<p>This version of Hibernate Search brings some renaming related to the vector search. In particular:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>@VectorField#beamWidth</code> becomes <code>@VectorField#efConstruction</code> as well as all related API/SPI methods (see <a href="https://hibernate.atlassian.net/browse/HSEARCH-5056">HSEARCH-5056</a>).</p>
</li>
<li>
<p><code>@VectorField#maxConnections</code> becomes <code>@VectorField#m</code> as well as all related API/SPI methods (see <a href="https://hibernate.atlassian.net/browse/HSEARCH-5056">HSEARCH-5056</a>).</p>
</li>
<li>
<p><code>VectorSimilarity#INNER_PRODUCT</code> becomes <code>VectorSimilarity#DOT_PRODUCT</code> and <code>VectorSimilarity#MAX_INNER_PRODUCT</code> is introduced to better align naming of vector similarity functions between backends
(see <a href="https://hibernate.atlassian.net/browse/HSEARCH-5038">HSEARCH-5038</a>).</p>
</li>
</ul>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="sect2">
<h3 id="metamodel-field-capabilities"><a class="anchor" href="#metamodel-field-capabilities" />Looking up the capabilities of each field in the metamodel</h3>
<div class="paragraph">
<p>It is now possible to see which capabilities (predicates/sorts/projections/etc.)
are available for a field when <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#mapping-inspect">inspecting the metamodel</a>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java">SearchMapping mapping = <span style="color:#777">/*...*/</span> ;
<span style="color:#777">// Retrieve a SearchIndexedEntity:</span>
SearchIndexedEntity<<span style="color:#0a8;font-weight:bold">Book</span>> bookEntity = mapping.indexedEntity( <span style="color:#0a8;font-weight:bold">Book</span>.class );
<span style="color:#777">// Get the descriptor for that index.</span>
<span style="color:#777">// The descriptor exposes the index metamodel:</span>
IndexDescriptor indexDescriptor = bookEntity.indexManager().descriptor();
<span style="color:#777">// Retrieve a field by name</span>
<span style="color:#777">// and inspect its capabilities if such field is present:</span>
indexDescriptor.field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">releaseDate</span><span style="color:#710">"</span></span> ).ifPresent( field -> {
<span style="color:#080;font-weight:bold">if</span> ( field.isValueField() ) {
<span style="color:#777">// Get the descriptor for the field type:</span>
IndexValueFieldTypeDescriptor type = field.toValueField().type();
<span style="color:#777">// Inspect the "traits" of a field type:</span>
<span style="color:#777">// each trait represents a predicate/sort/projection/aggregation</span>
<span style="color:#777">// that can be used on fields of that type.</span>
<span style="color:#0a8;font-weight:bold">Set</span><<span style="color:#0a8;font-weight:bold">String</span>> traits = type.traits();
<span style="color:#080;font-weight:bold">if</span> ( traits.contains( IndexFieldTraits.Aggregations.RANGE ) ) {
<span style="color:#777">// ...</span>
}
<span style="color:#080;font-weight:bold">if</span> ( traits.contains( IndexFieldTraits.Predicates.EXISTS ) ) {
<span style="color:#777">// ...</span>
}
<span style="color:#777">// ...</span>
}
} );</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="other-changes"><a class="anchor" href="#other-changes" />Other improvements and bug fixes</h3>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5034">HSEARCH-5034</a>:
Hibernate Search will allow passing <code>BeanReference<? extends T></code> when registering beans to <code>BeanConfigurationContext</code>.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5004">HSEARCH-5004</a>:
Hibernate Search will default to Hibernate ORM’s defaults instead of forcing <code>SqlTypes.CHAR</code> for the <code>OutboxEvent</code>/<code>Agent</code> ID.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>And more. For a full list of changes since the previous releases,
please see the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32220">release notes</a>.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/7.1/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="getting-started-migrating"><a class="anchor" href="#getting-started-migrating" />Getting started, migrating</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For new applications,
refer to the getting started guide:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.1/getting-started/orm/en-US/html_single/">here for the Hibernate ORM integration</a></p>
</li>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.1/getting-started/standalone/en-US/html_single/">here for the Standalone POJO Mapper</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For existing applications, Hibernate Search 7.1 is a drop-in replacement for 7.0,
assuming you also upgrade the dependencies.
Information about deprecated configuration and API
is included in the <a href="https://docs.jboss.org/hibernate/search/7.1/migration/html_single/">migration guide</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2024/01/24/hibernate-reactive-2_2_2/Hibernate Reactive 2.2.2.Final released2024-03-22T12:27:06+00:002024-01-24T00:00:00+00:00Davide D'Alto
Hibernate Reactive 2.2.2.Final is now available!
This release is compatible with Hibernate ORM 6.4.2.Final and a minor bug fix.
The full list of changes is available on GitHub.
How can I get it?
All details are available on the
Hibernate Reactive website releases page.
If you are new to Hibernate Reactive, the official documentation is a good place to start.
Feedback, issues, ideas?
To get in touch, you can use the following channels:
hibernate-reactive tag on Stackoverflow (usage questions)
User forum or the hibernate-user stream on Zulip (usage questions, general feedback)
Issue tracker (bug reports, feature requests)
Mailing list or the hibernate-reactive-dev stream on Zulip (development-related discussions)...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://hibernate.org/reactive/releases/2.2/#getting_started">Hibernate Reactive 2.2.2.Final</a> is now available!</p>
</div>
<div class="paragraph">
<p>This release is compatible with Hibernate ORM 6.4.2.Final and a minor bug fix.</p>
</div>
<div class="paragraph">
<p><a href="https://github.com/hibernate/hibernate-reactive/releases/tag/2.2.2">The full list of changes</a> is available on GitHub.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-can-i-get-it"><a class="anchor" href="#how-can-i-get-it" />How can I get it?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available on the
<a href="https://hibernate.org/reactive/releases/2.2/#get-it">Hibernate Reactive website releases page</a>.</p>
</div>
<div class="paragraph">
<p>If you are new to Hibernate Reactive, <a href="http://hibernate.org/reactive/documentation/2.2/reference/html_single/#getting-started">the official documentation</a> is a good place to start.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, you can use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-reactive"><strong>hibernate-reactive</strong> tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-reactive">User forum</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/132096-hibernate-user"><strong>hibernate-user</strong> stream on Zulip</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://github.com/hibernate/hibernate-reactive/issues">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/205413-hibernate-reactive-dev"><strong>hibernate-reactive-dev</strong> stream on Zulip</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2024/01/18/orm-642-final/Hibernate 6.4.2.Final2024-03-22T12:27:06+00:002024-01-18T00:00:00+00:00Andrea Boriero
Today, we published a new maintenance release of Hibernate ORM 6.4: 6.4.2.Final
What’s new
This release introduces a few minor improvements as well as bug fixes.
You can find the full list of 6.4.2.Final changes here.
Conclusion
For additional details, see:
the release page
the Migration Guide
the Hibernate 6 Introduction
the User Guide
See also the following resources related to supported APIs:
the compatibility policy
the incubating API report (@Incubating)
the deprecated API report (@Deprecated + @Remove)
the internal API report (internal packages, @Internal)
Feedback, issues, ideas?
To get in touch, use the usual channels:
hibernate tag on Stack Overflow (usage questions)
User forum (usage questions, general feedback)
Chat (usage questions)
Issue tracker (bug reports, feature requests)
Mailing list (development-related...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Today, we published a new maintenance release of Hibernate ORM 6.4: 6.4.2.Final</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This release introduces a few minor improvements as well as bug fixes.</p>
</div>
<div class="paragraph">
<p>You can find the full list of 6.4.2.Final changes <a href="https://hibernate.atlassian.net/issues/?jql=project%20%3D%20HHH%20AND%20fixVersion%20%3D%206.4.2">here</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="conclusion"><a class="anchor" href="#conclusion" />Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.4/">release page</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/introduction/html_single/Hibernate_Introduction.html">Hibernate 6 Introduction</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>See also the following resources related to supported APIs:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://hibernate.org/community/compatibility-policy/">compatibility policy</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/incubating/incubating.txt">incubating API report</a> (<code>@Incubating</code>)</p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/deprecated/deprecated.txt">deprecated API report</a> (<code>@Deprecated</code> + <code>@Remove</code>)</p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/internals/internal.txt">internal API report</a> (internal packages, <code>@Internal</code>)</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the usual channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://stackoverflow.com/questions/tagged/hibernate"><strong>hibernate</strong> tag on Stack Overflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-orm">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.zulipchat.com/#narrow/stream">Chat</a> (usage questions)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/jira/software/c/projects/HHH/issues">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2024/01/16/hibernate-reactive-2_2_1_Final/Hibernate Reactive 2.2.1.Final released2024-03-22T12:27:06+00:002024-01-16T00:00:00+00:00Davide D'Alto
Hibernate Reactive 2.2.1.Final is now available!
This release is compatible with Hibernate ORM 6.4.1.Final and Vert.x SQL driver 4.5.1.
This version also contains:
Support for the Order class introduced in Hibernate ORM 6.3
Support for Stateless#upsert on all databases
Fix out of the box support for arrays of basic types
The full list of changes is available on GitHub.
We have also released Hibernate Reactive 2.0.8.Final.
This version will still work with Vertx SQL client 4.5.1, but we decided to revert the upgrade because it was
preventing other applications to upgrade to the latest 2.0 version.
How can I get it?
All details are available on the
Hibernate Reactive website releases page.
If...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://hibernate.org/reactive/releases/2.2/#getting_started">Hibernate Reactive 2.2.1.Final</a> is now available!</p>
</div>
<div class="paragraph">
<p>This release is compatible with Hibernate ORM 6.4.1.Final and Vert.x SQL driver 4.5.1.</p>
</div>
<div class="paragraph">
<p>This version also contains:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Support for the <a href="https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/main/java/org/hibernate/query/Order.java">Order</a> class introduced in Hibernate ORM 6.3</p>
</li>
<li>
<p>Support for <code>Stateless#upsert</code> on all databases</p>
</li>
<li>
<p>Fix out of the box support for arrays of basic types</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><a href="https://github.com/hibernate/hibernate-reactive/releases/tag/2.2.1">The full list of changes</a> is available on GitHub.</p>
</div>
<div class="paragraph">
<p>We have also released <a href="https://hibernate.org/reactive/releases/2.0/#getting_started">Hibernate Reactive 2.0.8.Final</a>.
This version will still work with Vertx SQL client 4.5.1, but we decided to revert the upgrade because it was
preventing other applications to upgrade to the latest 2.0 version.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-can-i-get-it"><a class="anchor" href="#how-can-i-get-it" />How can I get it?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available on the
<a href="https://hibernate.org/reactive/releases/2.2/#get-it">Hibernate Reactive website releases page</a>.</p>
</div>
<div class="paragraph">
<p>If you are new to Hibernate Reactive, <a href="http://hibernate.org/reactive/documentation/2.2/reference/html_single/#getting-started">the official documentation</a> is a good place to start.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, you can use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-reactive"><strong>hibernate-reactive</strong> tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-reactive">User forum</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/132096-hibernate-user"><strong>hibernate-user</strong> stream on Zulip</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://github.com/hibernate/hibernate-reactive/issues">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/205413-hibernate-reactive-dev"><strong>hibernate-reactive-dev</strong> stream on Zulip</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/12/21/hibernate-search-6-2-3-Final/Hibernate Search 6.2.3.Final released2024-03-22T12:27:07+00:002023-12-21T00:00:00+00:00Yoann Rodière
We just published a maintenance release for Hibernate Search:
6.2.3.Final.
This release adds compatibility with OpenSearch 2.11,
upgrades -orm6 artifacts to Hibernate ORM 6.2.17.Final,
upgrades to Elasticsearch client 8.10.4,
and adjusts Jandex index reading for compatibility with Spring Boot 3.2.
What’s new
HSEARCH-4990/HSEARCH-4994:
Upgrade to Elasticsearch client 8.10.4 and test against Elasticsearch 8.10.4
HSEARCH-4993:
Add compatibility with OpenSearch 2.11.0
HSEARCH-4987/HSEARCH-5027/HSEARCH-5030/HSEARCH-5044/HSEARCH-5049:
Upgrade -orm6 artifacts to Hibernate ORM 6.2.17.Final
HSEARCH-5024:
Adjust Hibernate Search’s Jandex index reading and building
to work correctly with Spring Boot 3.2’s nested JARs.
For a full list of changes since the previous release,
see the release notes.
How to get this release
All details are available and up to date on the
dedicated page on hibernate.org.
Feedback, issues, ideas?
To...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We just published a maintenance release for Hibernate Search:
6.2.3.Final.</p>
</div>
<div class="paragraph">
<p>This release adds compatibility with OpenSearch 2.11,
upgrades <code>-orm6</code> artifacts to Hibernate ORM 6.2.17.Final,
upgrades to Elasticsearch client 8.10.4,
and adjusts Jandex index reading for compatibility with Spring Boot 3.2.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4990">HSEARCH-4990</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4994">HSEARCH-4994</a>:
Upgrade to Elasticsearch client 8.10.4 and test against Elasticsearch 8.10.4</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4993">HSEARCH-4993</a>:
Add compatibility with OpenSearch 2.11.0</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4987">HSEARCH-4987</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-5027">HSEARCH-5027</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-5030">HSEARCH-5030</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-5044">HSEARCH-5044</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-5049">HSEARCH-5049</a>:
Upgrade -orm6 artifacts to Hibernate ORM 6.2.17.Final</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5024">HSEARCH-5024</a>:
Adjust Hibernate Search’s Jandex index reading and building
to work correctly with Spring Boot 3.2’s nested JARs.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For a full list of changes since the previous release,
see the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32202">release notes</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/6.2/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/12/05/hibernate-search-7-0-0-Final/Hibernate Search 7.0.0.Final is out!2024-03-22T12:27:07+00:002023-12-05T00:00:00+00:00Yoann Rodière
We are pleased to announce the release of Hibernate Search 7.0.0.Final.
Compared to Hibernate Search 6.2,
this release upgrades its baseline to JDK 11 and Hibernate ORM 6.4,
brings compatibility with Elasticsearch 8.10/8.11 and OpenSearch 2.10/2.11,
and upgrades to Lucene 9.8.
Hibernate Search 7.0 also brings new features such as a brand-new Hibernate Search BOM,
experimental compatibility with Amazon OpenSearch Serverless,
compatibility with Hibernate ORM’s discriminator-based multi-tenancy,
and other bugfixes and improvements.
What’s new compared to Hibernate Search 6.2
Java
Hibernate Search is now using JDK 11 as a baseline and can work on JDK 11, 17 or 21.
Compatibility with JDK 8 was dropped.
Hibernate ORM
Hibernate Search now depends on Hibernate ORM...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We are pleased to announce the release of Hibernate Search 7.0.0.Final.</p>
</div>
<div class="paragraph">
<p>Compared to Hibernate Search 6.2,
this release upgrades its baseline to JDK 11 and Hibernate ORM 6.4,
brings compatibility with Elasticsearch 8.10/8.11 and OpenSearch 2.10/2.11,
and upgrades to Lucene 9.8.</p>
</div>
<div class="paragraph">
<p>Hibernate Search 7.0 also brings new features such as a brand-new Hibernate Search BOM,
experimental compatibility with Amazon OpenSearch Serverless,
compatibility with Hibernate ORM’s discriminator-based multi-tenancy,
and other bugfixes and improvements.</p>
</div>
<div class="paragraph">
<p><!-- more --></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new-compared-to-hibernate-search-6-2"><a class="anchor" href="#whats-new-compared-to-hibernate-search-6-2" />What’s new compared to Hibernate Search 6.2</h2>
<div class="sectionbody">
<div id="java-version" class="dlist">
<dl>
<dt class="hdlist1">Java</dt>
<dd>
<p>Hibernate Search is now using JDK 11 as a baseline and can work on JDK 11, 17 or 21.
Compatibility with JDK 8 was dropped.</p>
</dd>
</dl>
</div>
<div id="orm-version" class="dlist">
<dl>
<dt class="hdlist1">Hibernate ORM</dt>
<dd>
<p>Hibernate Search now depends on Hibernate ORM 6.4 as it fully switched to Jakarta EE.
There are no <code>-orm6</code>/<code>-jakarta</code> artifacts or Java EE compatibility anymore.</p>
</dd>
</dl>
</div>
<div id="lucene-version" class="dlist">
<dl>
<dt class="hdlist1">Lucene</dt>
<dd>
<p>The Lucene backend now uses Lucene 9.8.
Upgrading requires reindexing, see the migration guide for details.</p>
</dd>
</dl>
</div>
<div id="elasticsearch-version" class="dlist">
<dl>
<dt class="hdlist1">Elasticsearch</dt>
<dd>
<p>The Elasticsearch backend works with Elasticsearch 8.10/8.11 as well as other versions that were already compatible — except for the following versions whose compatibility was dropped, because they already reached their end of life:</p>
<div class="ulist">
<ul>
<li>
<p>5.x/6.x</p>
</li>
<li>
<p>7.0-7.9</p>
</li>
</ul>
</div>
</dd>
</dl>
</div>
<div id="opensearch-version" class="dlist">
<dl>
<dt class="hdlist1">OpenSearch</dt>
<dd>
<p>The Elasticsearch backend works with OpenSearch 2.10 and 2.11 as well as other versions that were already compatible — except for versions 1.0, 1.1 and 1.2 whose compatibility was dropped,
because they already reached their end of life.</p>
</dd>
</dl>
</div>
<div class="sect2">
<h3 id="hibernate-search-bom"><a class="anchor" href="#hibernate-search-bom" />Hibernate Search BOM</h3>
<div class="paragraph">
<p>Hibernate Search now offers a BOM providing dependency management for all of its published artifacts.
It can be imported as part of your dependency management to keep the versions of Hibernate Search artifacts aligned:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="XML"><span style="color:#070;font-weight:bold"><dependencyManagement></span>
<span style="color:#070;font-weight:bold"><dependencies></span>
<span style="color:#777"><!-- Import Hibernate Search BOM to get all of its artifact versions aligned: --></span>
<span style="color:#070;font-weight:bold"><dependency></span>
<span style="color:#070;font-weight:bold"><groupId></span>org.hibernate.search<span style="color:#070;font-weight:bold"></groupId></span>
<span style="color:#070;font-weight:bold"><artifactId></span>hibernate-search-bom<span style="color:#070;font-weight:bold"></artifactId></span>
<span style="color:#070;font-weight:bold"><version></span>7.0.0.Final<span style="color:#070;font-weight:bold"></version></span>
<span style="color:#070;font-weight:bold"><type></span>pom<span style="color:#070;font-weight:bold"></type></span>
<span style="color:#070;font-weight:bold"><scope></span>import<span style="color:#070;font-weight:bold"></scope></span>
<span style="color:#070;font-weight:bold"></dependency></span>
<span style="color:#777"><!-- Any other dependency management entries --></span>
<span style="color:#070;font-weight:bold"></dependencies></span>
<span style="color:#070;font-weight:bold"></dependencyManagement></span>
<span style="color:#777"><!-- ... --></span>
<span style="color:#070;font-weight:bold"><dependencies></span>
<span style="color:#777"><!-- Declare dependencies --></span>
<span style="color:#070;font-weight:bold"><dependency></span>
<span style="color:#070;font-weight:bold"><groupId></span>org.hibernate.search<span style="color:#070;font-weight:bold"></groupId></span>
<span style="color:#070;font-weight:bold"><artifactId></span>hibernate-search-mapper-orm<span style="color:#070;font-weight:bold"></artifactId></span>
<span style="color:#777"><!-- The version is managed by the BOM above --></span>
<span style="color:#070;font-weight:bold"></dependency></span>
<span style="color:#070;font-weight:bold"><dependency></span>
<span style="color:#070;font-weight:bold"><groupId></span>org.hibernate.search<span style="color:#070;font-weight:bold"></groupId></span>
<span style="color:#070;font-weight:bold"><artifactId></span>hibernate-search-backend-elasticsearch<span style="color:#070;font-weight:bold"></artifactId></span>
<span style="color:#777"><!-- The version is managed by the BOM above --></span>
<span style="color:#070;font-weight:bold"></dependency></span>
<span style="color:#777"><!-- Any other dependency entries --></span>
<span style="color:#070;font-weight:bold"></dependencies></span></code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="aws-opensearch-serverless"><a class="anchor" href="#aws-opensearch-serverless" />Amazon OpenSearch Serverless experimental compatibility</h3>
<div class="paragraph">
<p>Hibernate Search now has incubating compatibility with Amazon OpenSearch Serverless.</p>
</div>
<div class="paragraph">
<p>Amazon OpenSearch Serverless has certain limitations compared to a regular OpenSearch cluster
and <a href="https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-genref.html">may not support all operations</a> a regular cluster does.
Compatibility with Amazon OpenSearch Serverless must be enabled explicitly by setting the backend version property:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="properties">hibernate.search.backend.version=amazon-opensearch-serverless</code></pre>
</div>
</div>
<div class="paragraph">
<p>See <a href="https://docs.jboss.org/hibernate/search/7.0/reference/en-US/html_single/#backend-elasticsearch-compatibility-amazon-opensearch-serverless">this section of the reference documentation</a>
for more information, in particular about limitations.</p>
</div>
</div>
<div class="sect2">
<h3 id="orm-discriminator-multi-tenancy"><a class="anchor" href="#orm-discriminator-multi-tenancy" />Compatibility with Hibernate ORM’s discriminator-based multi-tenancy</h3>
<div class="paragraph">
<p>Hibernate Search can now index Hibernate ORM entities
that take advantage of
<a href="https://docs.jboss.org/hibernate/orm/6.3/userguide/html_single/Hibernate_User_Guide.html#multitenacy-hibernate-TenantId">discriminator-based multi-tenancy in the database (<code>@TenandId</code>)</a>.</p>
</div>
</div>
<div class="sect2">
<h3 id="renamings"><a class="anchor" href="#renamings" />Maven artifact renamings</h3>
<div class="paragraph">
<p>Some Hibernate Search Maven artifacts have been renamed:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Maven artifacts related to JSR-352 artifacts were renamed to reflect the move to the Jakarta EE specification:</p>
<div class="ulist">
<ul>
<li>
<p><code>hibernate-search-mapper-orm-batch-jsr352-core</code> was renamed to <code>hibernate-search-mapper-orm-jakarta-batch-core</code>.</p>
</li>
<li>
<p><code>hibernate-search-mapper-orm-batch-jsr352-jberet</code> was renamed to <code>hibernate-search-mapper-orm-jakarta-batch-jberet</code>.</p>
</li>
</ul>
</div>
</li>
<li>
<p>The artifact <code>hibernate-search-mapper-orm-coordination-outbox-polling</code>
was renamed to <code>hibernate-search-mapper-orm-outbox-polling</code>.</p>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new-compared-to-hibernate-search-7-0-0-cr2"><a class="anchor" href="#whats-new-compared-to-hibernate-search-7-0-0-cr2" />What’s new compared to Hibernate Search 7.0.0.CR2</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For a list of changes since 7.0.0.CR2 only,
refer to the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32215">release notes</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/7.0/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="getting-started-migrating"><a class="anchor" href="#getting-started-migrating" />Getting started, migrating</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For new applications,
refer to the getting started guide:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.0/reference/en-US/html_single/#mapper-orm-getting-started">here for the Hibernate ORM integration</a></p>
</li>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.0/reference/en-US/html_single/#mapper-pojo-standalone-getting-started">here for the Standalone POJO Mapper</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For existing applications,
assuming you were already using Hibernate Search 6.2 with <code>-orm6</code> artifacts,
upgrading to Hibernate Search 7.0 mainly requires
removing the <code>-orm6</code> suffix from your Hibernate Search dependencies
updating the version numbers (alternatively you can use the <a href="#hibernate-search-bom">BOM</a>),
and of course aligning your other dependencies (e.g. Hibernate ORM), if any.</p>
</div>
<div class="paragraph">
<p>Information about migration, deprecations and breaking changes
is included in the <a href="https://docs.jboss.org/hibernate/search/7.0/migration/html_single/">migration guide</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/11/30/hibernate-search-7-1-0-Alpha1/Hibernate Search 7.1.0.Alpha1 is out2024-03-22T12:27:07+00:002023-11-30T00:00:00+00:00Marko Bekhta
We just published Hibernate Search 7.1.0.Alpha1,
a first alpha release of the next major version of Hibernate Search.
This version opens up possibilities for searching over binary (image, audio or video) data using vector search.
Beyond that, it improves Hibernate Search compatibility with other frameworks.
What’s new
Hibernate Search 7.1 is still in its early stages of development:
some features are still incomplete or may change in a backward-incompatible way.
Vector search for the Lucene Backend
Hibernate Search now allows vector search in the Lucene backend as an incubating feature.
Vector search provides the tools to search over binary (images, audio or video) or text data:
external tools convert that...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We just published Hibernate Search 7.1.0.Alpha1,
a first alpha release of the next major version of Hibernate Search.</p>
</div>
<div class="paragraph">
<p>This version opens up possibilities for searching over binary (image, audio or video) data using vector search.</p>
</div>
<div class="paragraph">
<p>Beyond that, it improves Hibernate Search compatibility with other frameworks.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
<div class="paragraph">
<p>Hibernate Search 7.1 is still in its early stages of development:
some features are still incomplete or may change in a backward-incompatible way.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="vector-search"><a class="anchor" href="#vector-search" />Vector search for the Lucene Backend</h3>
<div class="paragraph">
<p>Hibernate Search now allows vector search in the Lucene backend as an incubating feature.
Vector search provides the tools to search over binary (images, audio or video) or text data:
external tools convert that data to vectors (arrays of bytes or floats, also called "embeddings"),
which are then used for indexing and queries in Hibernate Search.
Hibernate Search introduces a new field type — <code>@VectorField</code> and a new predicate <code>knn</code>, so that the vectors can be indexed
and then searched upon.</p>
</div>
<div class="paragraph">
<p>Vector fields can work with vector data represented as <code>byte</code> or <code>float</code> arrays in the documents.
Out of the box <code>byte[]</code> and <code>float[]</code> property types will work with the new field type. For any other entity property types,
a custom <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#binding-valuebridge">value bridge</a>
or <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#binding-valuebridge-valuebinder">value binder</a> should be implemented.
Keep in mind that indexed vectors <strong>must</strong> be of the same length
and that this length should be specified upfront for the schema to be created:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java"><span style="color:#007">@Entity</span>
<span style="color:#007">@Indexed</span>
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Book</span> {
<span style="color:#007">@Id</span>
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">Integer</span> id;
<span style="color:#007">@VectorField</span>(dimension = <span style="color:#00D">512</span>)
<span style="color:#088;font-weight:bold">private</span> <span style="color:#339;font-weight:bold">float</span><span style="color:#339;font-weight:bold">[]</span> coverImageEmbeddings;
<span style="color:#777">// Other properties ...</span>
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Searching for vector similarities is performed via a <code>knn</code> predicate:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="Java"><span style="color:#339;font-weight:bold">float</span><span style="color:#339;font-weight:bold">[]</span> coverImageEmbeddingsVector = <span style="color:#777">/*...*/</span>
<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f ->
<span style="color:#777">// provide the number of similar documents to look for:</span>
f.knn( <span style="color:#00D">5</span> )
<span style="color:#777">// the name of the vector field:</span>
.field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">coverImageEmbeddings</span><span style="color:#710">"</span></span> )
<span style="color:#777">// matched documents will be the ones whose indexed vector</span>
<span style="color:#777">// is "most similar" to this vector</span>
.matching( coverImageEmbeddingsVector )
<span style="color:#777">// additionally an optional filter can be supplied</span>
<span style="color:#777">// to provide a regular fulltext search predicate</span>
.filter( f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors.firstName</span><span style="color:#710">"</span></span> ).matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">arthur</span><span style="color:#710">"</span></span> ) )
).fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="paragraph">
<p>See this section of the reference documentation on <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#mapping-directfieldmapping-annotations-vectorfield">vector fields</a>
and the one on a new <a href="https://docs.jboss.org/hibernate/search/7.1/reference/en-US/html_single/#search-dsl-predicate-knn"><code>knn</code> predicate</a>
for more information.</p>
</div>
</div>
<div class="sect2">
<h3 id="other-changes"><a class="anchor" href="#other-changes" />Other improvements and bug fixes</h3>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5024">HSEARCH-5024</a>:
Hibernate Search will no longer fail to boot when reading nested JARs in Spring Boot 3.2+.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>And more. For a full list of changes since the previous releases,
please see the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32219">release notes</a>.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/7.1/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="getting-started-migrating"><a class="anchor" href="#getting-started-migrating" />Getting started, migrating</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For new applications,
refer to the getting started guide:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.1/getting-started/orm/en-US/html_single/">here for the Hibernate ORM integration</a></p>
</li>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.1/getting-started/standalone/en-US/html_single/">here for the Standalone POJO Mapper</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For existing applications, Hibernate Search 7.1 is a drop-in replacement for 7.0,
assuming you also upgrade the dependencies.
Information about deprecated configuration and API
is included in the <a href="https://docs.jboss.org/hibernate/search/7.1/migration/html_single/">migration guide</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/11/28/hibernate-reactive-2_2_Final/Hibernate Reactive 2.2.0.Final released2024-03-22T12:27:06+00:002023-11-28T00:00:00+00:00Davide D'Alto
Hibernate Reactive 2.2.0.Final is now available!
This release is compatible with Hibernate ORM 6.4.0.Final and Vert.x SQL driver 4.5.0
The full list of changes is available on GitHub.
We have also released:
Hibernate Reactive 2.1.0.Final, compatible with Hibernate ORM 6.3.2.Final
Hibernate Reactive 2.0.7.Final, compatible with Hibernate ORM 6.2.13.Final
How can I get it?
All details are available on the
Hibernate Reactive website releases page.
If you are new to Hibernate Reactive, the official documentation is a good place to start.
Feedback, issues, ideas?
To get in touch, you can use the following channels:
hibernate-reactive tag on Stackoverflow (usage questions)
User forum or the hibernate-user stream on Zulip (usage questions, general feedback)
Issue tracker (bug...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://hibernate.org/reactive/releases/2.2/#getting_started">Hibernate Reactive 2.2.0.Final</a> is now available!</p>
</div>
<div class="paragraph">
<p>This release is compatible with Hibernate ORM 6.4.0.Final and Vert.x SQL driver 4.5.0</p>
</div>
<div class="paragraph">
<p><a href="https://github.com/hibernate/hibernate-reactive/releases/tag/2.2.0">The full list of changes</a> is available on GitHub.</p>
</div>
<div class="paragraph">
<p>We have also released:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.org/reactive/releases/2.1/#getting_started">Hibernate Reactive 2.1.0.Final</a>, compatible with Hibernate ORM 6.3.2.Final</p>
</li>
<li>
<p><a href="https://hibernate.org/reactive/releases/2.0/#getting_started">Hibernate Reactive 2.0.7.Final</a>, compatible with Hibernate ORM 6.2.13.Final</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-can-i-get-it"><a class="anchor" href="#how-can-i-get-it" />How can I get it?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available on the
<a href="https://hibernate.org/reactive/releases/2.2/#get-it">Hibernate Reactive website releases page</a>.</p>
</div>
<div class="paragraph">
<p>If you are new to Hibernate Reactive, <a href="http://hibernate.org/reactive/documentation/2.2/reference/html_single/#getting-started">the official documentation</a> is a good place to start.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, you can use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-reactive"><strong>hibernate-reactive</strong> tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-reactive">User forum</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/132096-hibernate-user"><strong>hibernate-user</strong> stream on Zulip</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://github.com/hibernate/hibernate-reactive/issues">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/205413-hibernate-reactive-dev"><strong>hibernate-reactive-dev</strong> stream on Zulip</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/11/24/hibernate-search-7-0-0-CR2/Hibernate Search 7.0.0.CR2 released2024-03-22T12:27:07+00:002023-11-24T00:00:00+00:00Yoann Rodière
We just published a new candidate release for Hibernate Search: 7.0.0.CR2.
This release upgrades to the recently released Hibernate ORM 6.4;
as this upgrade implies dropping compatibility with Hibernate ORM 6.3,
it was deemed a big enough change to warrant a second candidate release.
7.0.0.CR2 also contains a few bugfixes and improvements;
see below for more information.
What’s new
For a summary of all new features and improvements since 6.2,
head to the dedicated page on hibernate.org.
Dependency upgrades
JDK 11 (reminder)
Hibernate Search now requires Java 11 as a baseline and is no longer compatible with Java 8.
Switch to Jakarta EE (reminder)
Hibernate Search completely switched to Jakarta EE and is...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We just published a new candidate release for Hibernate Search: 7.0.0.CR2.</p>
</div>
<div class="paragraph">
<p>This release upgrades to the recently released Hibernate ORM 6.4;
as this upgrade implies dropping compatibility with Hibernate ORM 6.3,
it was deemed a big enough change to warrant a second candidate release.
7.0.0.CR2 also contains a few bugfixes and improvements;
see below for more information.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
<div class="paragraph">
<p>For a summary of all new features and improvements since 6.2,
head to <a href="https://hibernate.org/search/releases/7.0/#whats-new">the dedicated page on hibernate.org</a>.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="dependency-upgrades"><a class="anchor" href="#dependency-upgrades" />Dependency upgrades</h3>
<div id="jdk-version" class="dlist">
<dl>
<dt class="hdlist1">JDK 11 (reminder)</dt>
<dd>
<p>Hibernate Search now requires Java 11 as a baseline and is no longer compatible with Java 8.</p>
</dd>
</dl>
</div>
<div id="jakarta-ee-version" class="dlist">
<dl>
<dt class="hdlist1">Switch to Jakarta EE (reminder)</dt>
<dd>
<p>Hibernate Search completely switched to Jakarta EE and is not compatible with Java EE anymore.
All of <code>-orm6</code> and <code>-jakarta</code> artifacts from the previous series that provided Hibernate ORM 6 and Jakarta EE compatibility
are now unavailable since this compatibility is now provided by the main artifacts.</p>
</dd>
</dl>
</div>
<div id="orm-version" class="dlist">
<dl>
<dt class="hdlist1">Hibernate ORM (<a href="https://hibernate.atlassian.net/browse/HSEARCH-5008">HSEARCH-5008</a>)</dt>
<dd>
<p>Hibernate Search now depends on Hibernate ORM 6.4.0.Final.</p>
</dd>
</dl>
</div>
<div id="lucene-version" class="dlist">
<dl>
<dt class="hdlist1">Lucene (reminder)</dt>
<dd>
<p>The Lucene backend now uses Lucene 9.8.</p>
</dd>
</dl>
</div>
<div id="elasticsearch-version" class="dlist">
<dl>
<dt class="hdlist1">Elasticsearch (<a href="https://hibernate.atlassian.net/browse/HSEARCH-5005">HSEARCH-5005</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-5012">HSEARCH-5012</a>)</dt>
<dd>
<p>The Elasticsearch backend works with Elasticsearch 8.11 as well as other versions that were already compatible — except for the following versions whose compatibility was dropped, because they already reached their end of life:</p>
<div class="ulist">
<ul>
<li>
<p>5.x/6.x (compatibility dropped in Hibernate Search 7.0.0.Beta1)</p>
</li>
<li>
<p>7.0-7.9 (compatibility dropped in Hibernate Search 7.0.0.CR1)</p>
</li>
</ul>
</div>
</dd>
</dl>
</div>
<div id="opensearch-version" class="dlist">
<dl>
<dt class="hdlist1">OpenSearch (reminder)</dt>
<dd>
<p>The Elasticsearch backend works with OpenSearch 2.10 and 2.11 as well as other versions that were already compatible — except for versions 1.0, 1.1 and 1.2 whose compatibility was dropped
in Hibernate Search 7.0.0.CR1,
because they already reached their end of life.</p>
</dd>
</dl>
</div>
<div id="others-version" class="dlist">
<dl>
<dt class="hdlist1">Others</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5005">HSEARCH-5005</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-5012">HSEARCH-5012</a>: Upgrade to Elasticsearch <strong>client</strong> 8.11.1</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4996">HSEARCH-4996</a> Upgrade to JBeret 2.1.3.Final</p>
</li>
</ul>
</div>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="other-changes"><a class="anchor" href="#other-changes" />Other improvements and bug fixes</h3>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4995">HSEARCH-4995</a>:
Hibernate Search will no longer log exceptions encountered during complex operations (boot, schema validation) at the <code>ERROR</code> level, but at the <code>TRACE</code> level.
To propagate these exceptions, Hibernate Search will add them as "suppressed" to the exception thrown at the end (of boot/schema validation).</p>
<div class="paragraph">
<p>This means in particular that explicit uses of <code>SchemaManager</code> (e.g. for schema validation)
that encounter exceptions (e.g. inconsistent Elasticsearch index aliases)
will no longer flood the logs,
but will instead result in an exception with all the necessary information,
in its own message (failure report with short description of all failures)
and in its suppressed exception (full stack trace of all relevant exceptions).</p>
</div>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4999">HSEARCH-4999</a>:
Elasticsearch spatial predicates will now use the <code>geo_shape</code> query instead of the deprecated <code>geo_polygon</code> query.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-5015">HSEARCH-5015</a>:
<code>OutboxEvent</code> is no longer a final class,
avoiding warnings in some situations where Hibernate ORM would try to generate proxy classes for <code>OutboxEvent</code>.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>And more. For a full list of changes since the previous releases,
please see the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32211">release notes</a>.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/7.0/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="getting-started-migrating"><a class="anchor" href="#getting-started-migrating" />Getting started, migrating</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For new applications,
refer to the getting started guide:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.0/reference/en-US/html_single/#mapper-orm-getting-started">here for the Hibernate ORM integration</a></p>
</li>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.0/reference/en-US/html_single/#mapper-pojo-standalone-getting-started">here for the Standalone POJO Mapper</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For existing applications,
assuming you were already using Hibernate Search 6.2 with <code>-orm6</code> artifacts,
upgrading to Hibernate Search 7.0 mainly requires
removing the <code>-orm6</code> suffix from your Hibernate Search dependencies
updating the version numbers (alternatively you can use the <a href="#hibernate-search-bom">BOM</a>),
and of course aligning your other dependencies (e.g. Hibernate ORM), if any.</p>
</div>
<div class="paragraph">
<p>Information about migration, deprecations and breaking changes
is included in the <a href="https://docs.jboss.org/hibernate/search/7.0/migration/html_single/">migration guide</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/11/23/orm-640-final/Hibernate 6.4.0.Final2024-03-22T12:27:06+00:002023-11-23T00:00:00+00:00Andrea Boriero
Hibernate ORM 6.4.0 has just been released. Simultaneously, 6.3.2 has also been released.
6.4 adds some cool new features, in addition to many improvements and fixes.
Soft Delete
6.4 adds support for soft deletes using the new @SoftDelete annotation.
@Entity
@SoftDelete
class Account {
...
}
Dealing with values as deleted/non-deleted versus active/inactive (reversed) is simple using an annotation attribute:
@Entity
@SoftDelete(strategy=ACTIVE)
class Account {
...
}
It even supports pluggable converters for dealing with what gets stored in the database.
See the User Guide for details.
HQL Vector Support
6.4 introduces a new module hibernate-vector that offers support for mathematical vector...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate ORM 6.4.0 has just been released. Simultaneously, 6.3.2 has also been released.</p>
</div>
<div class="paragraph">
<p>6.4 adds some cool new features, in addition to many improvements and fixes.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="soft-delete"><a class="anchor" href="#soft-delete" />Soft Delete</h2>
<div class="sectionbody">
<div class="paragraph">
<p>6.4 adds support for soft deletes using the new <code>@SoftDelete</code> annotation.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@Entity</span>
<span style="color:#007">@SoftDelete</span>
<span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Account</span> {
...
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Dealing with values as deleted/non-deleted versus active/inactive (reversed) is simple using an annotation attribute:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@Entity</span>
<span style="color:#007">@SoftDelete</span>(strategy=ACTIVE)
<span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Account</span> {
...
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>It even supports pluggable converters for dealing with what gets stored in the database.</p>
</div>
<div class="paragraph">
<p>See the <a href="https://docs.jboss.org/hibernate/orm/6.4/userguide/html_single/Hibernate_User_Guide.html#soft-delete">User Guide</a> for details.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="hql-vector-suppoet"><a class="anchor" href="#hql-vector-suppoet" />HQL Vector Support</h2>
<div class="sectionbody">
<div class="paragraph">
<p>6.4 introduces a new module <code>hibernate-vector</code> that offers support for mathematical vector types and functions that are useful for the AI/ML space to do vector similarity search.</p>
</div>
<div class="paragraph">
<p>The current implementation only supports running with PostgreSQL with the pgvector extension enabled and maps various functions to the underlying pgvector operators that enable efficient index access.</p>
</div>
<div class="paragraph">
<p>See the <a href="https://docs.jboss.org/hibernate/orm/6.4/userguide/html_single/Hibernate_User_Guide.html#vector-module">Query Guide</a> for details.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="sqm-array-functions"><a class="anchor" href="#sqm-array-functions" />HQL/Criteria Array Functions</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Following up on <a href="https://hibernate.atlassian.net/browse/HHH-16780">earlier work</a>, 6.4 adds the
<a href="https://github.com/hibernate/hibernate-orm/discussions/5562">remaining</a> functions for handling
arrays in HQL and Criteria queries.</p>
</div>
<div class="paragraph">
<p>See the <a href="https://docs.jboss.org/hibernate/orm/6.4/userguide/html_single/Hibernate_User_Guide.html#hql-functions-arrays">Query Guide</a> for excellent coverage of these functions.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
<div class="paragraph">
<p>These functions are still incubating and some things (names, etc.) may change before Final.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="jfr-events"><a class="anchor" href="#jfr-events" />Java Flight Recorder Events</h2>
<div class="sectionbody">
<div class="paragraph">
<p>6.4 adds support for producing Java Flight Recorder (JFR) events.
This works natively on many JDKs, but we recently discovered that not all of them implement the JFR spec, despite it being part of Open JDK.</p>
</div>
<div class="paragraph">
<p>For this reason we have created a separate module that will ensure compatibility, and applications will need to include the new <code>hibernate-jfr</code> artifact on the classpath in order to use Java Flight Recorder events integration.</p>
</div>
<div class="paragraph">
<p>See the <a href="https://docs.jboss.org/hibernate/orm/6.4/userguide/html_single/Hibernate_User_Guide.html#appendix-monitoring-with-JFR">User Guide</a> for details.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="non-strng-tenant-id"><a class="anchor" href="#non-strng-tenant-id" />Non-String Tenant Id</h2>
<div class="sectionbody">
<div class="paragraph">
<p>6.4 adds support for using tenant-id with types other than String.</p>
</div>
<div class="paragraph">
<p>See <a href="https://hibernate.atlassian.net/browse/HHH-14822">HHH-14822</a> for details.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="conclusion"><a class="anchor" href="#conclusion" />Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.4/">release page</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/introduction/html_single/Hibernate_Introduction.html">Hibernate 6 Introduction</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>See also the following resources related to supported APIs:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://hibernate.org/community/compatibility-policy/">compatibility policy</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/incubating/incubating.txt">incubating API report</a> (<code>@Incubating</code>)</p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/deprecated/deprecated.txt">deprecated API report</a> (<code>@Deprecated</code> + <code>@Remove</code>)</p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/internals/internal.txt">internal API report</a> (internal packages, <code>@Internal</code>)</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the usual channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://stackoverflow.com/questions/tagged/hibernate"><strong>hibernate</strong> tag on Stack Overflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-orm">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.zulipchat.com/#narrow/stream">Chat</a> (usage questions)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/jira/software/c/projects/HHH/issues">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/11/18/license/Investigating Move to Apache License2024-03-22T12:27:07+00:002023-11-18T00:00:00+00:00Steve Ebersole
We are considering a change of license for Hibernate projects to Apache License 2.0. In fact, more recent Hibernate projects have
started out using that license.
While we still believe that our long published interpretation of LGPL to be compatible with ASL and similar licenses, enough FUD has been spread about
it to be considered a lost cause in terms of inclusion in various projects. At this point, it just makes sense to change - it opens up wider acceptance amongst Apache/Jakarta projects and others.
In the coming weeks we will be sending emails to developers who have made significant, still-relevant contributions...
<div class="paragraph">
<p>We are considering a change of license for Hibernate projects to Apache License 2.0. In fact, more recent Hibernate projects have
started out using that license.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
<div class="paragraph">
<p>While we still believe that our long published interpretation of LGPL to be compatible with ASL and similar licenses, enough <a href="https://en.wikipedia.org/wiki/Fear,_uncertainty,_and_doubt">FUD</a> has been spread about
it to be considered a lost cause in terms of inclusion in various projects. At this point, it just makes sense to change - it opens up wider acceptance amongst Apache/Jakarta projects and others.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>In the coming weeks we will be sending emails to developers who have made significant, still-relevant contributions to the codebase over the years. We want to respect the wishes of all of us.</p>
</div>
<div class="paragraph">
<p>Questions about the change are best directed to one of the <a href="https://hibernate.org/community/">communication channels</a>.</p>
</div>
https://in.relation.to/2023/10/26/orm-64cr1/Hibernate 6.4.0.CR12024-03-22T12:27:07+00:002023-10-26T00:00:00+00:00Steve Ebersole
6.4 adds some cool new features, in addition to many improvements and fixes.
Soft Delete
6.4 adds support for soft deletes using the new @SoftDelete annotation.
@Entity
@SoftDelete
class Account {
...
}
Dealing with values as deleted/non-deleted versus active/inactive (reversed) is simple using an annotation attribute:
@Entity
@SoftDelete(strategy=ACTIVE)
class Account {
...
}
It even supports pluggable converters for dealing with what gets stored in the database.
See the User Guide for details.
HQL/Criteria Array Functions
Following up on earlier work, 6.4 adds the
remaining functions for handling
arrays in HQL and Criteria queries, including -
array()
Creates an array based on the passed...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>6.4 adds some cool new features, in addition to many improvements and fixes.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="soft-delete"><a class="anchor" href="#soft-delete" />Soft Delete</h2>
<div class="sectionbody">
<div class="paragraph">
<p>6.4 adds support for soft deletes using the new <code>@SoftDelete</code> annotation.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@Entity</span>
<span style="color:#007">@SoftDelete</span>
<span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Account</span> {
...
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Dealing with values as deleted/non-deleted versus active/inactive (reversed) is simple using an annotation attribute:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@Entity</span>
<span style="color:#007">@SoftDelete</span>(strategy=ACTIVE)
<span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Account</span> {
...
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>It even supports pluggable converters for dealing with what gets stored in the database.</p>
</div>
<div class="paragraph">
<p>See the <a href="https://docs.jboss.org/hibernate/orm/6.4/userguide/html_single/Hibernate_User_Guide.html#soft-delete">User Guide</a> for details.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="sqm-array-functions"><a class="anchor" href="#sqm-array-functions" />HQL/Criteria Array Functions</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Following up on <a href="https://hibernate.atlassian.net/browse/HHH-16780">earlier work</a>, 6.4 adds the
<a href="https://github.com/hibernate/hibernate-orm/discussions/5562">remaining</a> functions for handling
arrays in HQL and Criteria queries, including -</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>array()</code></dt>
<dd>
<p>Creates an array based on the passed arguments - e.g. <code>array(1,2,3)</code></p>
</dd>
<dt class="hdlist1"><code>array_position()</code></dt>
<dd>
<p>Determines the position of an element in an array - e.g. <code>where array_position(an.array,'x') = 1</code></p>
</dd>
<dt class="hdlist1"><code>array_length()</code></dt>
<dd>
<p>Determines the length of an array - e.g. <code>where array_length(an.array) > 50</code></p>
</dd>
<dt class="hdlist1"><code>array_get()</code></dt>
<dd>
<p>Accesses the element of an array by index - e.g. <code>where array_get(an.array, 1) <> 13</code></p>
</dd>
<dt class="hdlist1"><code>array_slice()</code></dt>
<dd>
<p>Creates a sub-array of the given array based on lower and upper index - e.g. <code>array_slice(an.array,3,6)</code></p>
</dd>
<dt class="hdlist1"><code>array_contains()</code></dt>
<dd>
<p>Whether an array contains an element - e.g. <code>array_contains(an.array, 1)</code></p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>And others… See the <a href="https://docs.jboss.org/hibernate/orm/6.4/userguide/html_single/Hibernate_User_Guide.html#hql-functions-arrays">Query Guide</a> for excellent coverage of these functions.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
<div class="paragraph">
<p>These functions are still incubating and some things (names, etc) may change before Final.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="jfr-events"><a class="anchor" href="#jfr-events" />Java Flight Recorder Events</h2>
<div class="sectionbody">
<div class="paragraph">
<p>CR1 contains support for producing a small number of Java Flight Recorder (JFR) events as a proof of concept.
This works on many JDKs, but we recently discovered that not all JDKs support the JFR package despite being part of Open JDK.</p>
</div>
<div class="paragraph">
<p>Long story short,</p>
</div>
<div class="ulist">
<ul>
<li>
<p>If your JDK does support JFR, CR1 produces some Hibernate-specific events</p>
</li>
<li>
<p>If your JDK does not support JFR, CR1 will not work for you.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>We will <a href="https://hibernate.atlassian.net/browse/HHH-17347">decide</a> how to proceed, before 6.4 Final.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="non-strng-tenant-id"><a class="anchor" href="#non-strng-tenant-id" />Non-String Tenant Id</h2>
<div class="sectionbody">
<div class="paragraph">
<p>6.4 adds support for using tenant-id with types other than String.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="p-s"><a class="anchor" href="#p-s" />P.S.</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.0/">release page</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/introduction/html_single/Hibernate_Introduction.html">Hibernate 6 Introduction</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>See also the following resources related to supported APIs:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://hibernate.org/community/compatibility-policy/">compatibility policy</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/incubating/incubating.txt">incubating API report</a> (<code>@Incubating</code>)</p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/deprecated/deprecated.txt">deprecated API report</a> (<code>@Deprecated</code> + <code>@Remove</code>)</p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.4/internals/internal.txt">internal API report</a> (internal packages, <code>@Internal</code>)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Visit the <a href="https://hibernate.org/community/">website</a> for details on getting in touch with us.</p>
</div>
</div>
</div>
https://in.relation.to/2023/10/23/hibernate-search-7-0-0-CR1/Hibernate Search 7.0.0.CR1 released2024-03-22T12:27:07+00:002023-10-23T00:00:00+00:00Yoann Rodière
We just published a new candidate release for Hibernate Search: 7.0.0.CR1.
This release brings in particular compatibility with Hibernate ORM’s discriminator-based multi-tenancy,
compatibility with Elasticsearch 8.10 and OpenSearch 2.10/2.11,
an upgrade to Hibernate ORM 6.3.1.Final,
an upgrade to Lucene 9.8,
some Maven artifact renamings,
and other bugfixes and improvements.
What’s new
For a summary of all new features and improvements since 6.2,
head to the dedicated page on hibernate.org.
Dependency upgrades
JDK 11 (reminder)
Hibernate Search now requires Java 11 as a baseline and is no longer compatible with Java 8.
Switch to Jakarta EE (reminder)
Hibernate Search completely switched to Jakarta EE and is not compatible with Java EE anymore.
All of -orm6 and...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We just published a new candidate release for Hibernate Search: 7.0.0.CR1.</p>
</div>
<div class="paragraph">
<p>This release brings in particular compatibility with Hibernate ORM’s discriminator-based multi-tenancy,
compatibility with Elasticsearch 8.10 and OpenSearch 2.10/2.11,
an upgrade to Hibernate ORM 6.3.1.Final,
an upgrade to Lucene 9.8,
some Maven artifact renamings,
and other bugfixes and improvements.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
<div class="paragraph">
<p>For a summary of all new features and improvements since 6.2,
head to <a href="https://hibernate.org/search/releases/7.0/#whats-new">the dedicated page on hibernate.org</a>.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="dependency-upgrades"><a class="anchor" href="#dependency-upgrades" />Dependency upgrades</h3>
<div id="jdk-version" class="dlist">
<dl>
<dt class="hdlist1">JDK 11 (reminder)</dt>
<dd>
<p>Hibernate Search now requires Java 11 as a baseline and is no longer compatible with Java 8.</p>
</dd>
</dl>
</div>
<div id="jakarta-ee-version" class="dlist">
<dl>
<dt class="hdlist1">Switch to Jakarta EE (reminder)</dt>
<dd>
<p>Hibernate Search completely switched to Jakarta EE and is not compatible with Java EE anymore.
All of <code>-orm6</code> and <code>-jakarta</code> artifacts from the previous series that provided Hibernate ORM 6 and Jakarta EE compatibility
are now unavailable since this compatibility is now provided by the main artifacts.</p>
</dd>
</dl>
</div>
<div id="orm-version" class="dlist">
<dl>
<dt class="hdlist1">Hibernate ORM (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4959">HSEARCH-4959</a>)</dt>
<dd>
<p>Hibernate Search now depends on Hibernate ORM 6.3.1.Final.</p>
</dd>
</dl>
</div>
<div id="lucene-version" class="dlist">
<dl>
<dt class="hdlist1">Lucene (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4393">HSEARCH-4982</a>)</dt>
<dd>
<p>The Lucene backend now uses Lucene 9.8.</p>
</dd>
</dl>
</div>
<div id="elasticsearch-version" class="dlist">
<dl>
<dt class="hdlist1">Elasticsearch (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4946">HSEARCH-4946</a>)</dt>
<dd>
<p>The Elasticsearch backend works with Elasticsearch 8.10 as well as other versions that were already compatible — except for the following versions whose compatibility was dropped, because they already reached their end of life:</p>
<div class="ulist">
<ul>
<li>
<p>5.x/6.x (compatibility already dropped in Hibernate Search 7.0.0.Beta1)</p>
</li>
<li>
<p>7.0-7.9 (newly dropped in <a href="https://hibernate.atlassian.net/browse/HSEARCH-4934">HSEARCH-4934</a>)</p>
</li>
</ul>
</div>
</dd>
</dl>
</div>
<div id="opensearch-version" class="dlist">
<dl>
<dt class="hdlist1">OpenSearch (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4978">HSEARCH-4978</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4993">HSEARCH-4993</a>)</dt>
<dd>
<p>The Elasticsearch backend works with OpenSearch 2.10 and 2.11 as well as other versions that were already compatible — except for versions 1.0, 1.1 and 1.2 whose compatibility was dropped
in <a href="https://hibernate.atlassian.net/browse/HSEARCH-4934">HSEARCH-4934</a>,
because they already reached their end of life.</p>
</dd>
</dl>
</div>
<div id="others-version" class="dlist">
<dl>
<dt class="hdlist1">Others</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4941">HSEARCH-4941</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4946">HSEARCH-4946</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4958">HSEARCH-4958</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4967">HSEARCH-4967</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4990">HSEARCH-4990</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4994">HSEARCH-4994</a>: Upgrade to Elasticsearch <strong>client</strong> 8.10.4</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4957">HSEARCH-4957</a> Upgrade to Jackson 2.15.2</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4984">HSEARCH-4984</a> Upgrade to Avro 1.11.3</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4992">HSEARCH-4992</a> Upgrade to AWS SDK 2.21.1</p>
</li>
</ul>
</div>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="orm-discriminator-multi-tenancy"><a class="anchor" href="#orm-discriminator-multi-tenancy" />Compatibility with Hibernate ORM’s discriminator-based multi-tenancy</h3>
<div class="paragraph">
<p>With <a href="https://hibernate.atlassian.net/browse/HSEARCH-4403">HSEARCH-4403</a>,
Hibernate Search can now index Hibernate ORM entities
that take advantage of
<a href="https://docs.jboss.org/hibernate/orm/6.3/userguide/html_single/Hibernate_User_Guide.html#multitenacy-hibernate-TenantId">discriminator-based multi-tenancy in the database (<code>@TenandId</code>)</a>.</p>
</div>
</div>
<div class="sect2">
<h3 id="renamings"><a class="anchor" href="#renamings" />Maven artifact renamings</h3>
<div class="paragraph">
<p>Some Hibernate Search Maven artifacts have been renamed:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4940">HSEARCH-4940</a>
Maven artifacts related to JSR-352 artifacts were renamed to reflect the move to the Jakarta EE specification:</p>
<div class="ulist">
<ul>
<li>
<p><code>hibernate-search-mapper-orm-batch-jsr352-core</code> was renamed to <code>hibernate-search-mapper-orm-jakarta-batch-core</code>.</p>
</li>
<li>
<p><code>hibernate-search-mapper-orm-batch-jsr352-jberet</code> was renamed to <code>hibernate-search-mapper-orm-jakarta-batch-jberet</code>.</p>
</li>
</ul>
</div>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4928">HSEARCH-4928</a>
The artifact <code>hibernate-search-mapper-orm-coordination-outbox-polling</code>
was renamed to <code>hibernate-search-mapper-orm-outbox-polling</code>.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="other-changes"><a class="anchor" href="#other-changes" />Other improvements and bug fixes</h3>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4938">HSEARCH-4938</a>:
The complement operator (<code>~</code>) in regexp predicates is no longer supported.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4947">HSEARCH-4947</a>:
Hibernate Search will no longer fail to boot on Windows in some setups.</p>
<div class="paragraph">
<p>Thanks to <a href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ac6d12782-872a-44d5-a5e0-c44e1541b816">Gábor Lipták</a>
for reporting this and helping test the fix!</p>
</div>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4487">HSEARCH-4487</a>:
The Jakarta Batch Mass Indexing job has been redesigned to mirror more closely the behavior of the <code>MassIndexer</code>.
As a result, it will no longer fail when indexing entities containing a <code>@IndexedEmbedded</code>
and using MySQL with an <code>idFetchSize</code> set to <code>Integer.MIN_VALUE</code>.</p>
<div class="paragraph">
<p>Thanks to <a href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3A8bd20b29-e551-467d-a964-39012a9b1f80">Ivan Kotev</a>
for reporting this and helping identify the cause!</p>
</div>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4980">HSEARCH-4980</a>:
Hibernate Search will no longer fail when trying to index entities with composite identifiers
in the Jakarta Batch Mass Indexing job.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4969">HSEARCH-4969</a>:
Fixed a bug caused by a mistake in the Lucene 9 upgrade,
where <code>TextMultiValues</code> would trigger an <code>IndexOutOfBoundsException</code>.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4983">HSEARCH-4983</a>:
Fixed a potential concurrency issue in the Lucene backend
that could lead to "`LockObtainFailedException`: Lock held by this virtual machine".</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4986">HSEARCH-4986</a>:
The Jakarta Batch Mass Indexing job will no longer fail in the partition mapping stage
for some JDBC drivers (DB2, MSSQL, …).</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4988">HSEARCH-4988</a>:
Hibernate Search will no longer fail on startup with a <code>StackOverflowError</code>
when mapping types that are containers of their own type,
such as <code>java.nio.Path</code> which implements <code>Iterable<Path></code>.</p>
<div class="paragraph">
<p>Attempting to use default container extraction on such types will fail with a clear explanation,
and <a href="https://docs.jboss.org/hibernate/search/7.0/reference/en-US/html_single/#mapping-containerextractor-disabling">disabling container extraction</a>
or otherwise resolving the infinite recursion will work as expected.</p>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>And more. For a full list of changes since the previous releases,
please see the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32189">release notes</a>.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/7.0/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="getting-started-migrating"><a class="anchor" href="#getting-started-migrating" />Getting started, migrating</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For new applications,
refer to the getting started guide:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.0/reference/en-US/html_single/#mapper-orm-getting-started">here for the Hibernate ORM integration</a></p>
</li>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.0/reference/en-US/html_single/#mapper-pojo-standalone-getting-started">here for the Standalone POJO Mapper</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For existing applications,
assuming you were already using Hibernate Search 6.2 with <code>-orm6</code> artifacts,
upgrading to Hibernate Search 7.0 mainly requires
removing the <code>-orm6</code> suffix from your Hibernate Search dependencies
updating the version numbers (alternatively you can use the <a href="#hibernate-search-bom">BOM</a>),
and of course aligning your other dependencies (e.g. Hibernate ORM), if any.</p>
</div>
<div class="paragraph">
<p>Information about migration, deprecations and breaking changes
is included in the <a href="https://docs.jboss.org/hibernate/search/7.0/migration/html_single/">migration guide</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/10/03/hibernate-search-6-2-2-Final/Hibernate Search 6.2.2.Final released2024-03-22T12:27:07+00:002023-10-03T00:00:00+00:00Yoann Rodière
We just published a maintenance release for Hibernate Search:
6.2.2.Final.
This release mainly adds compatibility with Elasticsearch 8.10 and OpenSearch 2.10,
upgrades to Hibernate ORM 6.2.9.Final for -orm6 artifacts,
upgrades to Elasticsearch client 8.10.2, Jackson 2.15.2 and Avro 1.11.3,
deprecates the ~ operator in regexp predicates,
and fixes several bugs.
What’s new
HSEARCH-4921/HSEARCH-4941/HSEARCH-4946/HSEARCH-4958/HSEARCH-4967:
Add compatibility with Elasticsearch 8.10 and upgrade to Elasticsearch client 8.10.2
HSEARCH-4978:
Add compatibility with OpenSearch 2.10
HSEARCH-4933/HSEARCH-4960:
Upgrade -orm6 artifacts to Hibernate ORM 6.2.9.Final
HSEARCH-4957:
Upgrade to Jackson 2.15.2
HSEARCH-4984:
Upgrade to Avro 1.11.3
HSEARCH-4937:
The complement operator (~) in regexp predicates is now deprecated.
This operator is going to be removed in Hibernate Search 7.
HSEARCH-4947:
Hibernate Search will no longer fail to boot on Windows in...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We just published a maintenance release for Hibernate Search:
6.2.2.Final.</p>
</div>
<div class="paragraph">
<p>This release mainly adds compatibility with Elasticsearch 8.10 and OpenSearch 2.10,
upgrades to Hibernate ORM 6.2.9.Final for <code>-orm6</code> artifacts,
upgrades to Elasticsearch client 8.10.2, Jackson 2.15.2 and Avro 1.11.3,
deprecates the <code>~</code> operator in regexp predicates,
and fixes several bugs.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4921">HSEARCH-4921</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4941">HSEARCH-4941</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4946">HSEARCH-4946</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4958">HSEARCH-4958</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4967">HSEARCH-4967</a>:
Add compatibility with Elasticsearch 8.10 and upgrade to Elasticsearch client 8.10.2</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4978">HSEARCH-4978</a>:
Add compatibility with OpenSearch 2.10</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4933">HSEARCH-4933</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4960">HSEARCH-4960</a>:
Upgrade <code>-orm6</code> artifacts to Hibernate ORM 6.2.9.Final</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4957">HSEARCH-4957</a>:
Upgrade to Jackson 2.15.2</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4984">HSEARCH-4984</a>:
Upgrade to Avro 1.11.3</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4937">HSEARCH-4937</a>:
The complement operator (<code>~</code>) in regexp predicates is now deprecated.</p>
<div class="paragraph">
<p>This operator is going to be removed in Hibernate Search 7.</p>
</div>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4947">HSEARCH-4947</a>:
Hibernate Search will no longer fail to boot on Windows in some setups.</p>
<div class="paragraph">
<p>Thanks to <a href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ac6d12782-872a-44d5-a5e0-c44e1541b816">Gábor Lipták</a>
for reporting this and helping test the fix!</p>
</div>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4980">HSEARCH-4980</a>:
Hibernate Search will no longer fail when trying to index entities with composite identifiers in the JSR-352
(Java Batch) mass indexing job.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For a full list of changes since the previous release,
see the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32186">release notes</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/6.2/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/09/19/hibernate-orm-631-final/Hibernate ORM 6.3.1.Final and 6.2.9.Final released2024-03-22T12:27:06+00:002023-09-19T00:00:00+00:00Andrea Boriero
Today, we published a new maintenance release of Hibernate ORM 6.3: 6.3.1.Final and ORM 6.2: 6.2.9.Final.
What’s new
This release introduces a few minor improvements as well as bug fixes.
You can find the full list of 6.3.1.Final changes here,
and the full list of 6.2.9.Final changes here.
Conclusion
For additional details, see:
the Introduction Guide
the User Guide
the Migration Guide
the release page.
Feedback, issues, ideas?
To get in touch, use the usual channels:
hibernate tag on Stack Overflow (usage questions)
User forum (usage questions, general feedback)
Issue tracker (bug reports, feature requests)
Mailing list (development-related discussions)...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Today, we published a new maintenance release of Hibernate ORM 6.3: 6.3.1.Final and ORM 6.2: 6.2.9.Final.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This release introduces a few minor improvements as well as bug fixes.</p>
</div>
<div class="paragraph">
<p>You can find the full list of 6.3.1.Final changes <a href="https://hibernate.atlassian.net/issues/?jql=project%20%3D%20HHH%20AND%20fixVersion%20%3D%2032188">here</a>,
and the full list of 6.2.9.Final changes <a href="https://hibernate.atlassian.net/issues/?jql=project%20%3D%20HHH%20AND%20fixVersion%20%3D%2032192">here</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="conclusion"><a class="anchor" href="#conclusion" />Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.3/introduction/html_single/Hibernate_Introduction.html">Introduction</a> Guide</p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.3/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.3/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.3/">release page</a>.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the usual channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://stackoverflow.com/questions/tagged/hibernate"><strong>hibernate</strong> tag on Stack Overflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-orm">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HHH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/09/05/hibernate-search-7-0-0-Beta1/Hibernate Search 7.0.0.Beta1 is out2024-03-22T12:27:07+00:002023-09-05T00:00:00+00:00Marko Bekhta
We just published Hibernate Search 7.0.0.Beta1,
a first beta release of the next major version of Hibernate Search.
The main theme of this new major version is upgrades:
JDK 11 as a baseline,
switch to Jakarta EE and to the latest Hibernate ORM,
upgrade of the Lucene backend to the next major version (Lucene 9).
Beyond that, 7.0.0.Beta1 also
includes experimental compatibility with Amazon OpenSearch Serverless,
publishes a Hibernate Search BOM containing all of its public artifacts,
and more.
What’s new
Hibernate Search 7.0 is still in development:
some features are still incomplete or may change in a backward-incompatible way.
Dependency upgrades
JDK 11 (HSEARCH-4556)
Hibernate Search now requires Java 11 as a baseline and...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We just published Hibernate Search 7.0.0.Beta1,
a first beta release of the next major version of Hibernate Search.</p>
</div>
<div class="paragraph">
<p>The main theme of this new major version is upgrades:
JDK 11 as a baseline,
switch to Jakarta EE and to the latest Hibernate ORM,
upgrade of the Lucene backend to the next major version (Lucene 9).</p>
</div>
<div class="paragraph">
<p>Beyond that, 7.0.0.Beta1 also
includes experimental compatibility with Amazon OpenSearch Serverless,
publishes a Hibernate Search BOM containing all of its public artifacts,
and more.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
<div class="paragraph">
<p>Hibernate Search 7.0 is still in development:
some features are still incomplete or may change in a backward-incompatible way.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="dependency-upgrades"><a class="anchor" href="#dependency-upgrades" />Dependency upgrades</h3>
<div id="jdk-version" class="dlist">
<dl>
<dt class="hdlist1">JDK 11 (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4556">HSEARCH-4556</a>)</dt>
<dd>
<p>Hibernate Search now requires Java 11 as a baseline and is no longer compatible with Java 8.</p>
</dd>
</dl>
</div>
<div id="jakarta-ee-version" class="dlist">
<dl>
<dt class="hdlist1">Switch to Jakarta EE (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4394">HSEARCH-4394</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4395">HSEARCH-4395</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4602">HSEARCH-4602</a>)</dt>
<dd>
<p>Hibernate Search completely switched to Jakarta EE and is not compatible with Java EE anymore.
All of <code>-orm6</code> and <code>-jakarta</code> artifacts from the previous series that provided Hibernate ORM 6 and Jakarta EE compatibility
are now unavailable since this compatibility is now provided by the main artifacts.</p>
</dd>
</dl>
</div>
<div id="orm-version" class="dlist">
<dl>
<dt class="hdlist1">Hibernate ORM (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4931">HSEARCH-4931</a>)</dt>
<dd>
<p>Hibernate Search now depends on Hibernate ORM 6.3.0.Final.</p>
</dd>
</dl>
</div>
<div id="lucene-version" class="dlist">
<dl>
<dt class="hdlist1">Lucene (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4393">HSEARCH-4393</a>)</dt>
<dd>
<p>The Lucene backend now uses Lucene 9.7.0.</p>
</dd>
</dl>
</div>
<div id="elasticsearch-version" class="dlist">
<dl>
<dt class="hdlist1">Elasticsearch (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4921">HSEARCH-4921</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4868">HSEARCH-4868</a>)</dt>
<dd>
<p>The Elasticsearch backend works with Elasticsearch 8.9 as well as other versions that were already compatible,
except the 5.x/6.x series. Compatibility with Elasticsearch 5.x/6.x is removed since these versions already reached their EOL.</p>
</dd>
</dl>
</div>
<div id="opensearch-version" class="dlist">
<dl>
<dt class="hdlist1">OpenSearch (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4905">HSEARCH-4905</a>)</dt>
<dd>
<p>The Elasticsearch backend works with OpenSearch 2.9 as well as other versions that were already compatible.</p>
</dd>
</dl>
</div>
<div id="others-version" class="dlist">
<dl>
<dt class="hdlist1">Others</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4921">HSEARCH-4921</a>: Upgrade to Elasticsearch <strong>client</strong> 8.9.1</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4602">HSEARCH-4602</a>: Upgrade to CDI 4.0.1</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4688">HSEARCH-4688</a>: Upgrade to Jandex 3.0</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4891">HSEARCH-4891</a>: Upgrade to JBeret 2.1.2.Final</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4896">HSEARCH-4896</a>: Upgrade to Jackson 2.15.0</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4555">HSEARCH-4555</a>: Upgrade to JBoss logging 3.5.3.Final</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4892">HSEARCH-4892</a>: Upgrade to Avro 1.11.2</p>
</li>
</ul>
</div>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="hibernate-search-bom"><a class="anchor" href="#hibernate-search-bom" />Hibernate Search BOM</h3>
<div class="paragraph">
<p>Hibernate Search now offers a BOM providing dependency management for all of its published artifacts.
It can be imported as part of your dependency management to keep the versions of Hibernate Search artifacts aligned:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="XML"><span style="color:#070;font-weight:bold"><dependencyManagement></span>
<span style="color:#070;font-weight:bold"><dependencies></span>
<span style="color:#777"><!-- Import Hibernate Search BOM to get all of its artifact versions aligned: --></span>
<span style="color:#070;font-weight:bold"><dependency></span>
<span style="color:#070;font-weight:bold"><groupId></span>org.hibernate.search<span style="color:#070;font-weight:bold"></groupId></span>
<span style="color:#070;font-weight:bold"><artifactId></span>hibernate-search-bom<span style="color:#070;font-weight:bold"></artifactId></span>
<span style="color:#070;font-weight:bold"><version></span>{hibernateSearchVersion}<span style="color:#070;font-weight:bold"></version></span>
<span style="color:#070;font-weight:bold"><type></span>pom<span style="color:#070;font-weight:bold"></type></span>
<span style="color:#070;font-weight:bold"><scope></span>import<span style="color:#070;font-weight:bold"></scope></span>
<span style="color:#070;font-weight:bold"></dependency></span>
<span style="color:#777"><!-- Any other dependency management entries --></span>
<span style="color:#070;font-weight:bold"></dependencies></span>
<span style="color:#070;font-weight:bold"></dependencyManagement></span>
<span style="color:#777"><!-- ... --></span>
<span style="color:#070;font-weight:bold"><dependencies></span>
<span style="color:#777"><!-- Declare dependencies --></span>
<span style="color:#070;font-weight:bold"><dependency></span>
<span style="color:#070;font-weight:bold"><groupId></span>org.hibernate.search<span style="color:#070;font-weight:bold"></groupId></span>
<span style="color:#070;font-weight:bold"><artifactId></span>hibernate-search-mapper-orm<span style="color:#070;font-weight:bold"></artifactId></span>
<span style="color:#777"><!-- The version is managed by the BOM above --></span>
<span style="color:#070;font-weight:bold"></dependency></span>
<span style="color:#070;font-weight:bold"><dependency></span>
<span style="color:#070;font-weight:bold"><groupId></span>org.hibernate.search<span style="color:#070;font-weight:bold"></groupId></span>
<span style="color:#070;font-weight:bold"><artifactId></span>hibernate-search-backend-elasticsearch<span style="color:#070;font-weight:bold"></artifactId></span>
<span style="color:#777"><!-- The version is managed by the BOM above --></span>
<span style="color:#070;font-weight:bold"></dependency></span>
<span style="color:#777"><!-- Any other dependency entries --></span>
<span style="color:#070;font-weight:bold"></dependencies></span></code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="aws-opensearch-serverless"><a class="anchor" href="#aws-opensearch-serverless" />Amazon OpenSearch Serverless experimental compatibility</h3>
<div class="paragraph">
<p>Hibernate Search now has incubating compatibility with Amazon OpenSearch Serverless.</p>
</div>
<div class="paragraph">
<p>Amazon OpenSearch Serverless has certain limitations compared to a regular OpenSearch cluster
and <a href="https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-genref.html">may not support all operations</a> a regular cluster does.
Compatibility with Amazon OpenSearch Serverless must be enabled explicitly by setting the backend version property:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="properties">hibernate.search.backend.version=amazon-opensearch-serverless</code></pre>
</div>
</div>
<div class="paragraph">
<p>See <a href="https://docs.jboss.org/hibernate/search/7.0/reference/en-US/html_single/#backend-elasticsearch-compatibility-amazon-opensearch-serverless">this section of the reference documentation</a>
for more information, in particular about limitations.</p>
</div>
</div>
<div class="sect2">
<h3 id="other-changes"><a class="anchor" href="#other-changes" />Other improvements and bug fixes</h3>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4532">HSEARCH-4532</a>:
Switch to Hibernate ORM 6’s LONG32VARBINARY type for payloads of outbox-polling entities.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4742">HSEARCH-4742</a>:
Allow the Standalone Pojo Mapper to read configuration properties from a file.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>And more. For a full list of changes since the previous releases,
please see the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32169">release notes</a>.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/7.0/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="getting-started-migrating"><a class="anchor" href="#getting-started-migrating" />Getting started, migrating</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For new applications,
refer to the getting started guide:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.0/reference/en-US/html_single/#mapper-orm-getting-started">here for the Hibernate ORM integration</a></p>
</li>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/7.0/reference/en-US/html_single/#mapper-pojo-standalone-getting-started">here for the Standalone POJO Mapper</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For existing applications,
assuming you were already using Hibernate Search 6.2 with <code>-orm6</code> artifacts,
upgrading to Hibernate Search 7.0 just requires
removing the <code>-orm6</code> suffix from your Hibernate Search dependencies
and updating the version numbers (alternatively you can use the <a href="#hibernate-search-bom">BOM</a>),
and of course aligning your other dependencies (e.g. Hibernate ORM), if any.</p>
</div>
<div class="paragraph">
<p>Information about migration, deprecations and breaking changes
is included in the <a href="https://docs.jboss.org/hibernate/search/7.0/migration/html_single/">migration guide</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/09/01/hibernate-reactive-2_0_5_Final/Hibernate Reactive 2.0.5.Final released2024-03-22T12:27:06+00:002023-09-01T00:00:00+00:00Davide D'Alto
Hibernate Reactive 2.0.4.Final is now available!
This release is compatible with Hibernate ORM 6.2.8.Final and Vert.x SQL driver 4.4.5.
The full list of changes is available on GitHub.
How can I get it?
All details are available on the
Hibernate Reactive website releases page.
If you are new to Hibernate Reactive, the official documentation is a good place to start.
Feedback, issues, ideas?
To get in touch, you can use the following channels:
hibernate-reactive tag on Stackoverflow (usage questions)
User forum or the hibernate-user stream on Zulip (usage questions, general feedback)
Issue tracker (bug reports, feature requests)
Mailing list or the hibernate-reactive-dev stream on Zulip (development-related discussions)...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://hibernate.org/reactive/releases/2.0/#getting_started">Hibernate Reactive 2.0.4.Final</a> is now available!</p>
</div>
<div class="paragraph">
<p>This release is compatible with Hibernate ORM 6.2.8.Final and Vert.x SQL driver 4.4.5.</p>
</div>
<div class="paragraph">
<p><a href="https://github.com/hibernate/hibernate-reactive/releases/tag/2.0.5">The full list of changes</a> is available on GitHub.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-can-i-get-it"><a class="anchor" href="#how-can-i-get-it" />How can I get it?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available on the
<a href="https://hibernate.org/reactive/releases/2.0/#get-it">Hibernate Reactive website releases page</a>.</p>
</div>
<div class="paragraph">
<p>If you are new to Hibernate Reactive, <a href="http://hibernate.org/reactive/documentation/2.0/reference/html_single/#getting-started">the official documentation</a> is a good place to start.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, you can use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-reactive"><strong>hibernate-reactive</strong> tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-reactive">User forum</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/132096-hibernate-user"><strong>hibernate-user</strong> stream on Zulip</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://github.com/hibernate/hibernate-reactive/issues">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/205413-hibernate-reactive-dev"><strong>hibernate-reactive-dev</strong> stream on Zulip</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/08/31/orm-630/Hibernate 6.3.0 (and 6.2.8)2024-03-22T12:27:07+00:002023-08-31T00:00:00+00:00Steve Ebersole
Hibernate ORM 6.3.0 has just been released. Simultaneously, 6.2.8
has also been released.
NOTE
With the release of 6.3.0, 6.2 now moves into limited maintenance.
Jakarta Persistence 3.2
Jakarta Persistence 3.2 is still under
development, but we’ve already begun incorporating some of the changes into Hibernate.
One specific change to be aware of in 6.3 is the clarification with regard to types of numeric literals in HQL/JPQL queries. You can
check out the details, but the gist is -
Integer - 123
Long - 123l, 123L
BigInteger - 123bi, 123BI
Double - 123.4
Float literal - 123.4f, 123.4F
BigDecimal literal - 123.4bd, 123.4BD
Notice that Hibernate’s BigInteger and BigDecimal suffix synatx has been...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate ORM 6.3.0 has just been <a href="https://hibernate.atlassian.net/projects/HHH/versions/32177">released</a>. Simultaneously, 6.2.8
has also been <a href="https://hibernate.atlassian.net/projects/HHH/versions/32178">released</a>.</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1">NOTE</dt>
<dd>
<p>With the release of 6.3.0, 6.2 now moves into limited maintenance.</p>
</dd>
</dl>
</div>
</div>
</div>
<div class="sect1">
<h2 id="jpa32"><a class="anchor" href="#jpa32" />Jakarta Persistence 3.2</h2>
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://twitter.com/jlukas/status/1697254255995023834">Jakarta Persistence 3.2</a> is still under
development, but we’ve already begun incorporating some of the changes into Hibernate.</p>
</div>
<div class="paragraph">
<p>One specific change to be aware of in 6.3 is the clarification with regard to types of numeric literals in HQL/JPQL queries. You can
check out the <a href="https://hibernate.atlassian.net/browse/HHH-17076">details</a>, but the gist is -</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Integer - 123</p>
</li>
<li>
<p>Long - 123l, 123L</p>
</li>
<li>
<p>BigInteger - 123bi, 123BI</p>
</li>
<li>
<p>Double - 123.4</p>
</li>
<li>
<p>Float literal - 123.4f, 123.4F</p>
</li>
<li>
<p>BigDecimal literal - 123.4bd, 123.4BD</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Notice that Hibernate’s <code>BigInteger</code> and <code>BigDecimal</code> suffix synatx has been standardized also.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="docs"><a class="anchor" href="#docs" />New documentation artifacts</h2>
<div class="sectionbody">
<div class="paragraph">
<p>2 new documentation guides have been added -</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>An introductory <a href="https://docs.jboss.org/hibernate/orm/6.3/introduction/html_single/Hibernate_Introduction.html">Hibernate 6 Guide</a></p>
</li>
<li>
<p>The Hibernate Query Language <a href="https://docs.jboss.org/hibernate/orm/6.3/introduction/html_single/Hibernate_Query_Language.html">synatx and feature guide</a></p>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="query-methods"><a class="anchor" href="#query-methods" />Query methods</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate can now generate DAO-style methods for named queries as part of its JPA static metamodel generator.</p>
</div>
<div class="paragraph">
<p>Take the following entity as an example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@NamedQuery</span>(name = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">#findByTitleAndType</span><span style="color:#710">"</span></span>,
query = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">select book from Book book where book.title like :titlePattern and book.type = :type</span><span style="color:#710">"</span></span>)
<span style="color:#007">@Entity</span>
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Book</span> { ... }</code></pre>
</div>
</div>
<div class="paragraph">
<p>When processed by the metamodel generator, Hibernate adds the following into the static metamodel:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Book_</span> {
<span style="color:#777">// as normal</span>
...
public <span style="color:#088;font-weight:bold">static</span> <span style="color:#088;font-weight:bold">final</span> <span style="color:#0a8;font-weight:bold">String</span> QUERY_FIND_BY_TITLE_AND_TYPE = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">#findByTitleAndType</span><span style="color:#710">"</span></span>;
<span style="color:#088;font-weight:bold">public</span> <span style="color:#088;font-weight:bold">static</span> <span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> findByTitleAndType(<span style="color:#007">@Nonnull</span> EntityManager entityManager, <span style="color:#0a8;font-weight:bold">String</span> titlePattern, <span style="color:#0a8;font-weight:bold">Type</span> type) {
<span style="color:#080;font-weight:bold">return</span> entityManager.createNamedQuery(QUERY_FIND_BY_TITLE_AND_TYPE)
.setParameter(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">titlePattern</span><span style="color:#710">"</span></span>, titlePattern)
.setParameter(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">type</span><span style="color:#710">"</span></span>, type)
.getResultList();
}
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>And the application can then use:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> books =
Book_.findByTitleAndType(entityManager, titlePattern, <span style="color:#0a8;font-weight:bold">Type</span>.BOOK);</code></pre>
</div>
</div>
<div class="paragraph">
<p>There are a lot of capabilities to these query methods; see the <a href="https://docs.jboss.org/hibernate/orm/6.3/introduction/html_single/Hibernate_Introduction.html#generator">Hibernate 6 Guide</a> for a full discussion.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="finder-methods"><a class="anchor" href="#finder-methods" />Finder methods</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Using the new <code>@Find</code> annotation, arbitrary methods can now be processed by the generator to create finder methods similar to query methods.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#339;font-weight:bold">interface</span> <span style="color:#B06;font-weight:bold">Dao</span> {
<span style="color:#007">@Find</span>
<span style="color:#0a8;font-weight:bold">Book</span> findBookByIsbn(<span style="color:#0a8;font-weight:bold">String</span> isbn);
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>The generator will generate:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Dao_</span> {
<span style="color:#088;font-weight:bold">public</span> <span style="color:#088;font-weight:bold">static</span> <span style="color:#0a8;font-weight:bold">Book</span> findBookByIsbn(<span style="color:#007">@Nonnull</span> EntityManager entityManager, <span style="color:#0a8;font-weight:bold">String</span> isbn) {
<span style="color:#080;font-weight:bold">return</span> entityManager.unwrap(Session.class)
.byNaturalId(<span style="color:#0a8;font-weight:bold">Book</span>.class)
.using(Book_.isbn, isbn)
.load();
}
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Again, there are a lot of capabilities to these finder methods; see the <a href="https://docs.jboss.org/hibernate/orm/6.3/introduction/html_single/Hibernate_Introduction.html#generator">Hibernate 6 Guide</a> for a full discussion.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="fetch-profile"><a class="anchor" href="#fetch-profile" />Dynamic SUBSELECT fetch support</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate’s <a href="https://docs.jboss.org/hibernate/orm/6.3/userguide/html_single/Hibernate_User_Guide.html#fetching-fetchmode-subselect">SUBSELECT</a>
fetching style can now be applied dynamically using <a href="https://docs.jboss.org/hibernate/orm/6.3/introduction/html_single/Hibernate_Introduction.html#fetch-profiles">fetch profiles</a>. E.g.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@FetchProfile</span>(name = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">EagerBook</span><span style="color:#710">"</span></span>)
<span style="color:#007">@FetchProfile</span>(name = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">EagerBookWithSubselect</span><span style="color:#710">"</span></span>)
<span style="color:#007">@Entity</span>
<span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Book</span> {
...
<span style="color:#007">@ManyToMany</span>
<span style="color:#007">@FetchProfileOverride</span>(profile = Book_.PROFILE_EAGER_BOOK, mode = JOIN)
<span style="color:#007">@FetchProfileOverride</span>(profile = Book_.PROFILE_EAGER_BOOK_WITH_SUBSELECT, mode = SUBSELECT)
<span style="color:#0a8;font-weight:bold">Set</span><Author> authors;
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Then, at runtime we can pick between these profiles to control how the associations
are loaded -</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java">Session session = ...;
session.enableFetchProfile( Book_.PROFILE_EAGER_BOOK );
<span style="color:#777">// or</span>
session.enableFetchProfile( Book_.PROFILE_EAGER_BOOK_WITH_SUBSELECT );</code></pre>
</div>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1">NOTE</dt>
<dd>
<p>What’s up with those <code>Book_.PROFILE_EAGER_BOOK</code> references? See the <a href="https://docs.jboss.org/hibernate/orm/6.3/introduction/html_single/Hibernate_Introduction.html#generator">Hibernate 6 Guide</a></p>
</dd>
</dl>
</div>
</div>
</div>
<div class="sect1">
<h2 id="hql-criteria"><a class="anchor" href="#hql-criteria" />Create Criteria from HQL</h2>
<div class="sectionbody">
<div class="paragraph">
<p>6.3 adds the abillity to create a <code>Criteria</code> reference from HQL -</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#339;font-weight:bold">var</span> builder = session.getFactory().getCriteriaBuilder();
<span style="color:#339;font-weight:bold">var</span> hqlCriteria = session.getFactory()
.getCriteriaBuilder()
.createQuery( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">select id, text from Message order by received</span><span style="color:#710">"</span></span>, <span style="color:#0a8;font-weight:bold">Object</span><span style="color:#339;font-weight:bold">[]</span>.class );</code></pre>
</div>
</div>
<div class="paragraph">
<p>which can be mutated just like any <code>Criteria</code>…</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#339;font-weight:bold">var</span> root = hqlCriteria.getRootList().get(<span style="color:#00D">0</span>)
root.where(
builder.equal(
root.get(Message_.deleted),
<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">Y</span><span style="color:#710">'</span></span>
)
);</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="criteria-definition"><a class="anchor" href="#criteria-definition" />CriteriaDefinition utility</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The new <code>CriteriaDefinition</code> class is a utility for making it easier to work with Jakarta
Persistence Criterias in many case. E.g.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#339;font-weight:bold">var</span> query = <span style="color:#080;font-weight:bold">new</span> CriteriaDefinition<>(factory, Message.class) {{
<span style="color:#339;font-weight:bold">var</span> message = from(Message.class);
where(like(message.get(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">text</span><span style="color:#710">"</span></span>), <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">hell%</span><span style="color:#710">"</span></span>), message.get(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">id</span><span style="color:#710">"</span></span>).equalTo(<span style="color:#00D">1</span>));
orderBy(asc(message.get(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">id</span><span style="color:#710">"</span></span>)));
}};
Session session = ...;
<span style="color:#339;font-weight:bold">var</span> message = session.createSelectionQuery(query).getSingleResult();</code></pre>
</div>
</div>
<div class="paragraph">
<p>We can even use this to clean up the example from <a href="#hql-criteria">Create Criteria from HQL</a> -</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#339;font-weight:bold">var</span> query = <span style="color:#080;font-weight:bold">new</span> CriteriaDefinition<>(factory, <span style="color:#0a8;font-weight:bold">Object</span><span style="color:#339;font-weight:bold">[]</span>.class, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">select id, text from Message order by received</span><span style="color:#710">"</span></span>) {{
<span style="color:#339;font-weight:bold">var</span> root = getRootList().get(<span style="color:#00D">0</span>);
where( equal( root.get(Message_.deleted), <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">Y</span><span style="color:#710">'</span></span> );
}};</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="ss-upsert"><a class="anchor" href="#ss-upsert" />StatelessSession.upsert()</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The new <code>StatelessSession.upsert()</code> method allows performing SQL-style UPSERT/MERGE
operations from the Hibernate <code>StatelessSession</code>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#777">// insert it</span>
ss.upsert(<span style="color:#080;font-weight:bold">new</span> Widget(<span style="color:#00D">1</span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">the nema</span><span style="color:#710">"</span></span>));
<span style="color:#777">// update it</span>
ss.upsert(<span style="color:#080;font-weight:bold">new</span> Widget(<span style="color:#00D">1</span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">the name</span><span style="color:#710">"</span></span>));</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="community"><a class="anchor" href="#community" />Community</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.3/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.3/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.3/introduction/html_single/Hibernate_Introduction.html">Introduction</a> Guide</p>
</li>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.3/">release page</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.3/incubating/incubating.txt">incubating report</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.3/deprecated/deprecated.txt">deprecation report</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.3/internals/internal.txt">internals report</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/community/compatibility-policy/">compatibility policy</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>See the <a href="https://hibernate.org/community/">website</a> for getting in touch with us.</p>
</div>
</div>
</div>
https://in.relation.to/2023/08/17/hibernate-search-6-2-1-Final/Hibernate Search 6.2.1.Final released2024-03-22T12:27:07+00:002023-08-17T00:00:00+00:00Yoann Rodière
We just published a maintenance release for Hibernate Search:
6.2.1.Final.
This release mainly upgrades to Hibernate ORM 6.2.7.Final for -orm6 artifacts,
upgrades to Elasticsearch client 8.9.0,
adds compatibility with Elasticsearch 8.9 and OpenSearch 2.9,
and fixes several bugs.
What’s new
HSEARCH-4744:
Hibernate Search is now able to read Jandex indexes of repackaged Spring applications (uberjars),
providing the application runs on Java 13+.
HSEARCH-4915:
Search queries with partial failures (some successful shards, some failing)
can now trigger an exception if you set the configuration property
hibernate.search.backend.query.shard_failure.ignore
to false.
This will be the default behavior in Hibernate Search 7.
HSEARCH-4903:
Upgrade -orm6 artifacts to Hibernate ORM 6.2.7.Final
HSEARCH-4904:
Upgrade to Elasticsearch client 8.9.0 and add compatibility with Elasticsearch 8.9.0
HSEARCH-4905:
Add compatibility with...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We just published a maintenance release for Hibernate Search:
6.2.1.Final.</p>
</div>
<div class="paragraph">
<p>This release mainly upgrades to Hibernate ORM 6.2.7.Final for <code>-orm6</code> artifacts,
upgrades to Elasticsearch client 8.9.0,
adds compatibility with Elasticsearch 8.9 and OpenSearch 2.9,
and fixes several bugs.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4744">HSEARCH-4744</a>:
Hibernate Search is now able to read Jandex indexes of repackaged Spring applications (uberjars),
providing the application runs on Java 13+.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4915">HSEARCH-4915</a>:
Search queries with partial failures (some successful shards, some failing)
can now trigger an exception if you set the configuration property
<a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#backend-elasticsearch-search-ignore-partial-shard-failure"><code>hibernate.search.backend.query.shard_failure.ignore</code></a>
to <code>false</code>.</p>
<div class="paragraph">
<p>This will be the default behavior in Hibernate Search 7.</p>
</div>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4903">HSEARCH-4903</a>:
Upgrade <code>-orm6</code> artifacts to Hibernate ORM 6.2.7.Final</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4904">HSEARCH-4904</a>:
Upgrade to Elasticsearch client 8.9.0 and add compatibility with Elasticsearch 8.9.0</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4905">HSEARCH-4905</a>:
Add compatibility with OpenSearch 2.9.0</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For a full list of changes since the previous release,
see the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32172">release notes</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/6.2/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/08/03/jira-automations/Jira Automations2024-03-22T12:27:07+00:002023-08-03T00:00:00+00:00Steve Ebersole
I recently enabled a number of Jira Automations which focus on closing issues which are considered stale.
An issue is considered stale when
A test case was requested more than 30 days ago, but one was not provided. This rule considers both Pull Requests and attachments, though not "test cases" defined in description or comments.
Additional information for an incomplete report was requested more than 30 days ago, but no reponse was provided.
As with any attempt at automation, there will be cases which do not fit nicely into the automation rules - both false positives and false negatives.
If you feel one of...
<div class="paragraph">
<p>I recently enabled a number of Jira Automations which focus on closing issues which are considered stale.
An issue is considered stale when</p>
</div>
<div class="ulist">
<ul>
<li>
<p>A test case was requested more than 30 days ago, but one was not provided. This rule considers both Pull Requests and attachments, though not "test cases" defined in description or comments.</p>
</li>
<li>
<p>Additional information for an incomplete report was requested more than 30 days ago, but no reponse was provided.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>As with any attempt at automation, there will be cases which do not fit nicely into the automation rules - both false positives and false negatives.
If you feel one of these issues was incorrectly closed, re-open it. Which assumes that there is a test or response of course :)</p>
</div>
https://in.relation.to/2023/07/25/hibernate-reactive-2_0_4_Final/Hibernate Reactive 2.0.4.Final released2024-03-22T12:27:06+00:002023-07-25T00:00:00+00:00Davide D'Alto
Hibernate Reactive 2.0.4.Final is now available!
This release is compatible with Hibernate ORM 6.2.7.Final.
The full list of changes is available on GitHub.
How can I get it?
All details are available on the
Hibernate Reactive website releases page.
If you are new to Hibernate Reactive, the official documentation is a good place to start.
Feedback, issues, ideas?
To get in touch, you can use the following channels:
hibernate-reactive tag on Stackoverflow (usage questions)
User forum or the hibernate-user stream on Zulip (usage questions, general feedback)
Issue tracker (bug reports, feature requests)
Mailing list or the hibernate-reactive-dev stream on Zulip (development-related discussions)...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://hibernate.org/reactive/releases/2.0/#getting_started">Hibernate Reactive 2.0.4.Final</a> is now available!</p>
</div>
<div class="paragraph">
<p>This release is compatible with Hibernate ORM 6.2.7.Final.</p>
</div>
<div class="paragraph">
<p><a href="https://github.com/hibernate/hibernate-reactive/releases/tag/2.0.4">The full list of changes</a> is available on GitHub.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-can-i-get-it"><a class="anchor" href="#how-can-i-get-it" />How can I get it?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available on the
<a href="https://hibernate.org/reactive/releases/2.0/#get-it">Hibernate Reactive website releases page</a>.</p>
</div>
<div class="paragraph">
<p>If you are new to Hibernate Reactive, <a href="http://hibernate.org/reactive/documentation/2.0/reference/html_single/#getting-started">the official documentation</a> is a good place to start.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, you can use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-reactive"><strong>hibernate-reactive</strong> tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-reactive">User forum</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/132096-hibernate-user"><strong>hibernate-user</strong> stream on Zulip</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://github.com/hibernate/hibernate-reactive/issues">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/205413-hibernate-reactive-dev"><strong>hibernate-reactive-dev</strong> stream on Zulip</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/07/20/orm-63cr1/Hibernate 6.3 CR1 (and 6.2.7)2024-03-22T12:27:07+00:002023-07-20T00:00:00+00:00Steve Ebersole
Hibernate ORM 6.3.0.CR1 has just been released. Simultaneously, 6.2.7
has also been released.
New documentation
6.3 provides 2 new documentation guides:
An introductory Hibernate 6 Guide
The Hibernate Query Language synatx and feature guide
Query methods
Hibernate can now generate DAO-style methods for named queries as part of its JPA static metamodel generator.
Take the following entity as an example:
@NamedQuery(name = "#findByTitleAndType",
query = "select book from Book book where book.title like :titlen and book.type = :type")
@Entity
public class Book { ... }
When processed by the metamodel generator, we will now have the following generated into the static metamodel:
class Book_ {
...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate ORM 6.3.0.CR1 has just been <a href="https://hibernate.atlassian.net/projects/HHH/versions/32084">released</a>. Simultaneously, 6.2.7
has also been <a href="https://hibernate.atlassian.net/projects/HHH/versions/32170">released</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="docs"><a class="anchor" href="#docs" />New documentation</h2>
<div class="sectionbody">
<div class="paragraph">
<p>6.3 provides 2 new documentation guides:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>An introductory <a href="https://docs.jboss.org/hibernate/orm/6.3/introduction/html_single/Hibernate_Introduction.html">Hibernate 6 Guide</a></p>
</li>
<li>
<p>The Hibernate Query Language <a href="https://docs.jboss.org/hibernate/orm/6.3/introduction/html_single/Hibernate_Query_Language.html">synatx and feature guide</a></p>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="query-methods"><a class="anchor" href="#query-methods" />Query methods</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate can now generate DAO-style methods for named queries as part of its JPA static metamodel generator.</p>
</div>
<div class="paragraph">
<p>Take the following entity as an example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@NamedQuery</span>(name = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">#findByTitleAndType</span><span style="color:#710">"</span></span>,
query = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">select book from Book book where book.title like :titlen and book.type = :type</span><span style="color:#710">"</span></span>)
<span style="color:#007">@Entity</span>
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Book</span> { ... }</code></pre>
</div>
</div>
<div class="paragraph">
<p>When processed by the metamodel generator, we will now have the following generated into the static metamodel:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Book_</span> {
<span style="color:#777">// as normal</span>
...
public <span style="color:#088;font-weight:bold">static</span> <span style="color:#088;font-weight:bold">final</span> <span style="color:#0a8;font-weight:bold">String</span> QUERY_FIND_BY_TITLE_AND_TYPE = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">#findByTitleAndType</span><span style="color:#710">"</span></span>;
<span style="color:#088;font-weight:bold">public</span> <span style="color:#088;font-weight:bold">static</span> <span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> findByTitleAndType(<span style="color:#007">@Nonnull</span> EntityManager entityManager, <span style="color:#0a8;font-weight:bold">String</span> title, <span style="color:#0a8;font-weight:bold">Type</span> type) {
<span style="color:#080;font-weight:bold">return</span> entityManager.createNamedQuery(QUERY_FIND_BY_TITLE_AND_TYPE)
.setParameter(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">titlePattern</span><span style="color:#710">"</span></span>, title)
.setParameter(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">type</span><span style="color:#710">"</span></span>, type)
.getResultList();
}
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>And the application can then use:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> books =
Book_.findByTitleAndType(entityManager, titlePattern, <span style="color:#0a8;font-weight:bold">Type</span>.BOOK);</code></pre>
</div>
</div>
<div class="paragraph">
<p>There are a lot of capabilities to these query methods; see the <a href="https://docs.jboss.org/hibernate/orm/6.3/introduction/html_single/Hibernate_Introduction.html#generator">Hibernate 6 Guide</a> for a full discussion.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="finder-methods"><a class="anchor" href="#finder-methods" />Finder methods</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Using the new <code>@Find</code> annotation, arbitrary methods can now be processed by the generator to create finder methods similar to query methods.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#339;font-weight:bold">interface</span> <span style="color:#B06;font-weight:bold">Dao</span> {
<span style="color:#007">@Find</span>
<span style="color:#0a8;font-weight:bold">Book</span> findBookByIsbn(<span style="color:#0a8;font-weight:bold">String</span> isbn);
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>The generator will generate:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Dao_</span> {
<span style="color:#088;font-weight:bold">public</span> <span style="color:#088;font-weight:bold">static</span> <span style="color:#0a8;font-weight:bold">Book</span> findBookByIsbn(<span style="color:#007">@Nonnull</span> EntityManager entityManager, <span style="color:#0a8;font-weight:bold">String</span> isbn) {
<span style="color:#080;font-weight:bold">return</span> entityManager.unwrap(Session.class)
.byNaturalId(<span style="color:#0a8;font-weight:bold">Book</span>.class)
.using(Book_.isbn, isbn)
.load();
}
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Again, there are a lot of capabilities to these finder methods; see the <a href="https://docs.jboss.org/hibernate/orm/6.3/introduction/html_single/Hibernate_Introduction.html#generator">Hibernate 6 Guide</a> for a full discussion.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="community"><a class="anchor" href="#community" />Community</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.3/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.3/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.3/">release page</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.3/incubating/incubating.txt">incubating report</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.3/deprecated/deprecated.txt">deprecation report</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.3/internals/internal.txt">internals report</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/community/compatibility-policy/">compatibility policy</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>See the <a href="https://hibernate.org/community/">website</a> for getting in touch with us.</p>
</div>
</div>
</div>
https://in.relation.to/2023/07/13/hibernate-reactive-2_0_3_Final/Hibernate Reactive 2.0.3.Final released2024-03-22T12:27:06+00:002023-07-13T00:00:00+00:00Davide D'Alto
Hibernate Reactive 2.0.3.Final is now available!
This release add a new getFactory() method to the sessions API and fix a bug
when merging a referenced entity.
The full list of changes is available on GitHub.
How can I get it?
All details are available on the
Hibernate Reactive website releases page.
If you are new to Hibernate Reactive, the official documentation is a good place to start.
Feedback, issues, ideas?
To get in touch, you can use the following channels:
hibernate-reactive tag on Stackoverflow (usage questions)
User forum or the hibernate-user stream on Zulip (usage questions, general feedback)
Issue tracker (bug reports, feature requests)
Mailing list or the hibernate-reactive-dev stream on Zulip (development-related...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://hibernate.org/reactive/releases/2.0/#getting_started">Hibernate Reactive 2.0.3.Final</a> is now available!</p>
</div>
<div class="paragraph">
<p>This release add a new <code>getFactory()</code> method to the sessions API and fix a bug
<a href="https://github.com/hibernate/hibernate-reactive/issues/1504">when merging a referenced entity</a>.</p>
</div>
<div class="paragraph">
<p><a href="https://github.com/hibernate/hibernate-reactive/releases/tag/2.0.3">The full list of changes</a> is available on GitHub.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-can-i-get-it"><a class="anchor" href="#how-can-i-get-it" />How can I get it?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available on the
<a href="https://hibernate.org/reactive/releases/2.0/#get-it">Hibernate Reactive website releases page</a>.</p>
</div>
<div class="paragraph">
<p>If you are new to Hibernate Reactive, <a href="http://hibernate.org/reactive/documentation/2.0/reference/html_single/#getting-started">the official documentation</a> is a good place to start.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, you can use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-reactive"><strong>hibernate-reactive</strong> tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-reactive">User forum</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/132096-hibernate-user"><strong>hibernate-user</strong> stream on Zulip</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://github.com/hibernate/hibernate-reactive/issues">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/205413-hibernate-reactive-dev"><strong>hibernate-reactive-dev</strong> stream on Zulip</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/07/07/hibernate-search-6-2-0-Final/Hibernate Search 6.2.0.Final is out!2024-03-22T12:27:07+00:002023-07-07T00:00:00+00:00Yoann Rodière
We are pleased to announce the release of Hibernate Search 6.2.0.Final.
This release brings in particular a new standalone POJO Mapper,
mapping of classes/records to projections using @ProjectionConstructor,
highlighting,
Elasticsearch schema export,
and more bugfixes and improvements.
6.2.0.Final also includes compatibility with Elasticsearch 8.8 and OpenSearch 2.8,
as well as an upgrade of -orm6 artifacts to Hibernate ORM 6.2.
What’s new compared to Hibernate Search 6.1
Dependency upgrades
Hibernate ORM
Hibernate Search still depends on Hibernate ORM 5.6 by default.
-orm6 artifacts depend on Hibernate ORM 6.2.
Lucene
The Lucene backend still uses Lucene 8.11.
Elasticsearch
The Elasticsearch backend now works with Elasticsearch 8.8 and 7.17
as well as other versions that were already compatible.
OpenSearch
The Elasticsearch backend...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We are pleased to announce the release of Hibernate Search 6.2.0.Final.</p>
</div>
<div class="paragraph">
<p>This release brings in particular a new standalone POJO Mapper,
mapping of classes/records to projections using <code>@ProjectionConstructor</code>,
highlighting,
Elasticsearch schema export,
and more bugfixes and improvements.</p>
</div>
<div class="paragraph">
<p>6.2.0.Final also includes compatibility with Elasticsearch 8.8 and OpenSearch 2.8,
as well as an upgrade of <code>-orm6</code> artifacts to Hibernate ORM 6.2.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new-compared-to-hibernate-search-6-1"><a class="anchor" href="#whats-new-compared-to-hibernate-search-6-1" />What’s new compared to Hibernate Search 6.1</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="dependency-upgrades"><a class="anchor" href="#dependency-upgrades" />Dependency upgrades</h3>
<div id="orm-version" class="dlist">
<dl>
<dt class="hdlist1">Hibernate ORM</dt>
<dd>
<p>Hibernate Search still depends on Hibernate ORM 5.6 by default.
<code>-orm6</code> artifacts depend on Hibernate ORM 6.2.</p>
</dd>
</dl>
</div>
<div id="lucene-version" class="dlist">
<dl>
<dt class="hdlist1">Lucene</dt>
<dd>
<p>The Lucene backend still uses Lucene 8.11.</p>
</dd>
</dl>
</div>
<div id="elasticsearch-version" class="dlist">
<dl>
<dt class="hdlist1">Elasticsearch</dt>
<dd>
<p>The Elasticsearch backend now works with Elasticsearch 8.8 and 7.17
as well as other versions that were already compatible.</p>
</dd>
</dl>
</div>
<div id="opensearch-version" class="dlist">
<dl>
<dt class="hdlist1">OpenSearch</dt>
<dd>
<p>The Elasticsearch backend now works with OpenSearch 1.3 and 2.8
as well as other versions that were already compatible.</p>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="mapper-pojo-standalone"><a class="anchor" href="#mapper-pojo-standalone" />Standalone POJO Mapper</h3>
<div class="paragraph">
<p>The Standalone POJO Mapper enables mapping arbitrary POJOs to indexes.</p>
</div>
<div class="paragraph">
<p>Its key feature compared to the Hibernate ORM integration is its ability to run without Hibernate ORM or a relational database.
It can be used to index entities coming from an arbitrary datastore or even
(though that’s not recommended in general) to use Lucene or Elasticsearch as a primary datastore.</p>
</div>
<div class="paragraph">
<p>For more information about the Standalone POJO Mapper,
see <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#mapper-pojo-standalone">this section of the reference documentation</a>.</p>
</div>
<div class="paragraph">
<p>To get started with the Standalone POJO Mapper,
see <a href="https://docs.jboss.org/hibernate/search/6.2/getting-started/standalone/en-US/html_single/">this getting started guide</a>.</p>
</div>
</div>
<div class="sect2">
<h3 id="mapping-projection"><a class="anchor" href="#mapping-projection" />Mapping index content to custom types (projection constructors)</h3>
<div class="paragraph">
<p>Hibernate Search now offers the ability to define projections through the mapping of custom types (typically records),
by applying the <code>@ProjectionConstructor</code> annotation to those types or their constructor:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#007">@ProjectionConstructor</span>
<span style="color:#088;font-weight:bold">public</span> record MyBookProjection(<span style="color:#0a8;font-weight:bold">String</span> title, <span style="color:#0a8;font-weight:bold">List</span><Author> authors) {
<span style="color:#007">@ProjectionConstructor</span>
<span style="color:#088;font-weight:bold">public</span> record Author(<span style="color:#0a8;font-weight:bold">String</span> firstName, <span style="color:#0a8;font-weight:bold">String</span> lastName) {
}
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Executing such a projection then becomes as easy as referencing the custom type:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#0a8;font-weight:bold">List</span><MyBookProjection> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.select( MyBookProjection.class )
.where( f -> f.matchAll() )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="paragraph">
<p>More advanced projections can be configured through explicit annotations,
for example a projection to the entity identifier:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#007">@ProjectionConstructor</span>
<span style="color:#088;font-weight:bold">public</span> record MyBookIdAndTitleProjection(
<span style="color:#007">@IdProjection</span> <i class="conum" data-value="1" /><b>(1)</b>
<span style="color:#0a8;font-weight:bold">Integer</span> id,
<span style="color:#0a8;font-weight:bold">String</span> title <i class="conum" data-value="2" /><b>(2)</b>
) {
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1" /><b>1</b></td>
<td>Projects to the entity identifier (explicit projection through an explicit annotation)</td>
</tr>
<tr>
<td><i class="conum" data-value="2" /><b>2</b></td>
<td>Projects to field <code>title</code> (implicit projection)</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Explicit annotations also allow configuring field projections more precisely,
for example setting the path of a field projection to something else
than just the name of the constructor parameter:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#007">@ProjectionConstructor</span>
<span style="color:#088;font-weight:bold">public</span> record MyBookTitleAndAuthorNamesProjection(
<span style="color:#007">@FieldProjection</span> <i class="conum" data-value="1" /><b>(1)</b>
<span style="color:#0a8;font-weight:bold">String</span> title,
<span style="color:#007">@FieldProjection</span>(path = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors.lastName</span><span style="color:#710">"</span></span>) <i class="conum" data-value="2" /><b>(2)</b>
<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">String</span>> authorLastNames
) {
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1" /><b>1</b></td>
<td>Projects to field <code>title</code> (path derived from the name of the constructor parameter)</td>
</tr>
<tr>
<td><i class="conum" data-value="2" /><b>2</b></td>
<td>Projects to field <code>authors.lastName</code> (explicit path)</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#mapping-projection">this section of the reference documentation</a>
for more information.</p>
</div>
</div>
<div class="sect2">
<h3 id="search-highlighting"><a class="anchor" href="#search-highlighting" />Highlighting</h3>
<div class="paragraph">
<p>Hibernate Search now offers a new feature in the Search DSL: highlighting.</p>
</div>
<div class="paragraph">
<p>Highlighting is a projection that returns fragments from full-text fields of matched documents that caused a query match.
Specific terms that caused the match are "highlighted" with a pair of opening and closing tags.
It can help a user to quickly identify the information they were searching for on a results page.</p>
</div>
<div class="paragraph">
<p>For example, one can enable highlighting on a full-text field like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#007">@Entity</span>
<span style="color:#007">@Indexed</span>
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Book</span> {
<span style="color:#007">@Id</span>
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">Integer</span> id;
<span style="color:#007">@FullTextField</span>(analyzer = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">english</span><span style="color:#710">"</span></span>)
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">String</span> title;
<span style="color:#007">@FullTextField</span>(analyzer = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">english</span><span style="color:#710">"</span></span>, projectable = Projectable.YES)
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">String</span> description;
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>And then retrieve highlights like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA">SearchSession searchSession = <span style="color:#777">/* ... */</span>
<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">String</span>>> result = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.select( f -> f.highlight( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">description</span><span style="color:#710">"</span></span> ) )
.where( f -> f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">description</span><span style="color:#710">"</span></span> ).matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">robot</span><span style="color:#710">"</span></span> ) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="paragraph">
<p>Which can for example return the following highlights:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code># Hit #0
["A <em>robot</em> becomes self-aware."]
# Hit #1
["A <em>robot</em> helps investigate a murder on an extrasolar colony.",
"On this planet, <em>robots</em> are used extensively."]
# etc.</code></pre>
</div>
</div>
<div class="paragraph">
<p>This is a simple example, but highligting can be configured extensively.
See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-highlighting">this section of the reference documentation</a>
for more information.</p>
</div>
</div>
<div class="sect2">
<h3 id="indexing-plan-filter"><a class="anchor" href="#indexing-plan-filter" />Indexing plan filters</h3>
<div class="paragraph">
<p>Hibernate Search now allows enabling/disabling indexing in indexing plans
(which includes in particular listener-triggered indexing),
both fully (for all types) or on a per-type basis.</p>
</div>
<div class="paragraph">
<p>For example, the following will disable automatic indexing
for future changes on all instances of the class <code>Company</code>,
except for instances of its subclass <code>Customer</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA">SearchMapping searchMapping = <span style="color:#777">/* ... */</span>
searchMapping.indexingPlanFilter(
ctx -> ctx.exclude( Company.class )
.include( Customer.class )
);</code></pre>
</div>
</div>
<div class="paragraph">
<p>Indexing plan filters can also be configured per-session
(though limitations apply when using the <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#coordination-outbox-polling"><code>outbox-polling</code> coordination strategy</a>):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA">SearchSession searchSession = <span style="color:#777">/* ... */</span>
searchSession.indexingPlanFilter(
ctx -> ctx.exclude( Company.class )
.include( Customer.class )
);</code></pre>
</div>
</div>
<div class="paragraph">
<p>See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#indexing-plan-filter">this section of the reference documentation</a>
for more information.</p>
</div>
</div>
<div class="sect2">
<h3 id="mapping-improvements"><a class="anchor" href="#mapping-improvements" />Mapping improvements</h3>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>@IndexedEmbedded(excludePaths = …)</code></dt>
<dd>
<p>The <code>@IndexedEmbedded</code> annotation now exposes an <code>excludePaths</code> attribute,
allowing the inclusion of all paths with only a few selectively excluded,
as opposed to the pre-existing approach of selectively including paths with <code>includePaths</code>.</p>
<div class="paragraph">
<p>See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#mapping-indexedembedded-filtering">this section of the reference documentation</a>
for more information.</p>
</div>
</dd>
<dt class="hdlist1">Projectable fields</dt>
<dd>
<p>All fields are now projectable by default with the Elasticsearch backend.</p>
<div class="paragraph">
<p>This change was made because making a field projectable doesn’t incur any performance penalty with the Elasticsearch backend.</p>
</div>
<div class="paragraph">
<p>Since making a field projectable <strong>does</strong> have an impact on performance with the Lucene backend,
the defaults with the Lucene backend didn’t change:
Lucene fields still need to be made projectable explicitly.</p>
</div>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="search-dsl-improvements"><a class="anchor" href="#search-dsl-improvements" />Search DSL improvements</h3>
<div id="predicate-and-or-not" class="dlist">
<dl>
<dt class="hdlist1">Simpler boolean operators with the <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-and"><code>and</code></a>/<a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-or"><code>or</code></a>/<a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-not"><code>not</code></a> predicates</dt>
<dd>
<p>For simpler use cases, you can now avoid the rather complex <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-boolean"><code>bool</code> predicate</a>
and use the new <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-and"><code>and</code></a>/<a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-or"><code>or</code></a>/<a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-not"><code>not</code></a>
predicates instead:</p>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f -> f.and(
f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">title</span><span style="color:#710">"</span></span> )
.matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">robot</span><span style="color:#710">"</span></span> ),
f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">description</span><span style="color:#710">"</span></span> )
.matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">crime</span><span style="color:#710">"</span></span> )
) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f -> f.or(
f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">title</span><span style="color:#710">"</span></span> )
.matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">robot</span><span style="color:#710">"</span></span> ),
f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">description</span><span style="color:#710">"</span></span> )
.matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">investigation</span><span style="color:#710">"</span></span> )
) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f -> f.not(
f.match()
.field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">genre</span><span style="color:#710">"</span></span> )
.matching( Genre.SCIENCE_FICTION )
) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
</dd>
</dl>
</div>
<div id="predicate-bool-new-syntax-root" class="dlist">
<dl>
<dt class="hdlist1">Shorter syntax for <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-boolean-lambda">complex, root boolean predicates</a></dt>
<dd>
<p>Instead of <code>.where( f → f.bool( b → … ) )</code>, you can now use <code>.where( (f, b) → … )</code>:</p>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA">MySearchParameters searchParameters = getSearchParameters();
<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( (f, root) -> {
root.add( f.matchAll() );
<span style="color:#080;font-weight:bold">if</span> ( searchParameters.getGenreFilter() != <span style="color:#069">null</span> ) {
root.add( f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">genre</span><span style="color:#710">"</span></span> )
.matching( searchParameters.getGenreFilter() ) );
}
<span style="color:#080;font-weight:bold">if</span> ( searchParameters.getFullTextFilter() != <span style="color:#069">null</span> ) {
root.add( f.match().fields( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">title</span><span style="color:#710">"</span></span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">description</span><span style="color:#710">"</span></span> )
.matching( searchParameters.getFullTextFilter() ) );
}
<span style="color:#080;font-weight:bold">if</span> ( searchParameters.getPageCountMaxFilter() != <span style="color:#069">null</span> ) {
root.add( f.range().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">pageCount</span><span style="color:#710">"</span></span> )
.atMost( searchParameters.getPageCountMaxFilter() ) );
}
} )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="paragraph">
<p>The older syntax has been deprecated in favor of the new one.</p>
</div>
</dd>
</dl>
</div>
<div id="predicate-bool-new-syntax-non-root" class="dlist">
<dl>
<dt class="hdlist1">Clearer syntax for <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-boolean-lambda">complex, non-root boolean predicates</a></dt>
<dd>
<p>Instead of <code>f.bool( b → … )</code>, you can now use <code>f.bool().with( b → … )</code>:</p>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA">MySearchParameters searchParameters = getSearchParameters();
<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( (f, b) -> {
b.must( f.matchAll() );
<span style="color:#080;font-weight:bold">if</span> ( searchParameters.getGenreFilter() != <span style="color:#069">null</span> ) {
b.must( f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">genre</span><span style="color:#710">"</span></span> )
.matching( searchParameters.getGenreFilter() ) );
}
<span style="color:#080;font-weight:bold">if</span> ( !searchParameters.getAuthorFilters().isEmpty() ) {
b.must( f.bool().with( b2 -> {
<span style="color:#080;font-weight:bold">for</span> ( <span style="color:#0a8;font-weight:bold">String</span> authorFilter : searchParameters.getAuthorFilters() ) {
b2.should( f.match().fields( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors.firstName</span><span style="color:#710">"</span></span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors.lastName</span><span style="color:#710">"</span></span> )
.matching( authorFilter ) );
}
} ) );
}
} )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="paragraph">
<p>The older syntax has been deprecated in favor of the new one.</p>
</div>
</dd>
</dl>
</div>
<div id="predicate-nested-new-syntax" class="dlist">
<dl>
<dt class="hdlist1">Clearer syntax for the <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-nested"><code>nested</code> predicate</a></dt>
<dd>
<p>Instead of <code>f.nested().objectField( … ).nest( f.bool().must( … ) )</code>, you can now use <code>f.nested( … ).add( … )</code>:</p>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f -> f.nested( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors</span><span style="color:#710">"</span></span> )
.add( f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors.firstName</span><span style="color:#710">"</span></span> )
.matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">isaac</span><span style="color:#710">"</span></span> ) )
.add( f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors.lastName</span><span style="color:#710">"</span></span> )
.matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">asimov</span><span style="color:#710">"</span></span> ) ) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="paragraph">
<p>The older syntax has been deprecated in favor of the new one.</p>
</div>
</dd>
</dl>
</div>
<div id="predicate-matchnone" class="dlist">
<dl>
<dt class="hdlist1">New <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-match-none"><code>matchNone</code> predicate</a></dt>
<dd>
<p>The <code>matchNone</code> predicate matches no documents.</p>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f -> f.matchNone() )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
</dd>
</dl>
</div>
<div id="projection-composite-syntax" class="dlist">
<dl>
<dt class="hdlist1">New syntax for <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-projection-composite">composite projections</a></dt>
<dd>
<p>The definition of composite projections is now possible with a fluent syntax:</p>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#0a8;font-weight:bold">List</span><MyPair<<span style="color:#0a8;font-weight:bold">String</span>, Genre>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.select( f -> f.composite()
.from( f.field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">title</span><span style="color:#710">"</span></span>, <span style="color:#0a8;font-weight:bold">String</span>.class ),
f.field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">genre</span><span style="color:#710">"</span></span>, Genre.class ) )
.as( MyPair::<span style="color:#080;font-weight:bold">new</span> ) )
.where( f -> f.matchAll() )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="paragraph">
<p>Most older syntaxes have been deprecated in favor of the new one.</p>
</div>
</dd>
</dl>
</div>
<div id="projection-object" class="dlist">
<dl>
<dt class="hdlist1">New <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-projection-object"><code>object</code> projection</a></dt>
<dd>
<p>The <code>object</code> projection yields one projected value for each object in a given object field.</p>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">List</span><MyAuthorName>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.select( f -> f.object( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors</span><span style="color:#710">"</span></span> )
.from( f.field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors.firstName</span><span style="color:#710">"</span></span>, <span style="color:#0a8;font-weight:bold">String</span>.class ),
f.field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors.lastName</span><span style="color:#710">"</span></span>, <span style="color:#0a8;font-weight:bold">String</span>.class ) )
.as( MyAuthorName::<span style="color:#080;font-weight:bold">new</span> )
.multi() )
.where( f -> f.matchAll() )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
</dd>
</dl>
</div>
<div id="projection-constant" class="dlist">
<dl>
<dt class="hdlist1">New <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-projection-constant"><code>constant</code> projection</a></dt>
<dd>
<p>The <code>constant</code> projection returns the same value for every single document, the value being provided when defining the projection.</p>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA">Instant searchRequestTimestamp = Instant.now();
<span style="color:#0a8;font-weight:bold">List</span><MyPair<<span style="color:#0a8;font-weight:bold">Integer</span>, Instant>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.select( f -> f.composite()
.from( f.id( <span style="color:#0a8;font-weight:bold">Integer</span>.class ), f.constant( searchRequestTimestamp ) )
.as( MyPair::<span style="color:#080;font-weight:bold">new</span> ) )
.where( f -> f.matchAll() )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
</dd>
</dl>
</div>
<div id="missing-lowest-highest" class="dlist">
<dl>
<dt class="hdlist1"><a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-sort-common-missing"><code>.missing().lowest()</code>/<code>.missing().highest()</code> options</a> in sorts</dt>
<dd>
<p>When sorting on a field that may not have a value for some documents,
it was already possible to use <code>.missing().first()</code>/<code>.missing().last()</code>
to tell Hibernate Search to put such documents in first/last position (respectively),
regardless of sorting order (ascending/descending).</p>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>It is now possible, as an alternative, to use <code>.missing().lowest()</code>/<code>.missing().highest()</code>
to tell Hibernate Search to consider such documents as having the lowest/highest value (respectively),
taking into account sorting order (ascending/descending):</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>.missing().lowest()</code> puts documents with no value in the first position when using ascending order
or in the last position when using descending order.</p>
</li>
<li>
<p><code>.missing().highest()</code> puts documents with no value in the last position when using ascending order
or in the first position when using descending order.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>This is mostly useful when the position of missing values is hardcoded,
but the sort order is given by the user:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA">SortOrder orderFromUser = <span style="color:#777">/* ... */</span>;
<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f -> f.matchAll() )
.sort( f -> f.field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">pageCount</span><span style="color:#710">"</span></span> ).missing().lowest().order( orderFromuser ) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
</div>
</div>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="mass-indexing-improvements"><a class="anchor" href="#mass-indexing-improvements" />Mass indexing improvements</h3>
<div class="dlist">
<dl>
<dt class="hdlist1">Mass indexing multiple tenants</dt>
<dd>
<p>In multi-tenant applications, mass indexing can now handle multiple tenants at once,
provided you don’t pass any tenant identifier when creating the mass indexer,
and you provided a list of tenants in the Hibernate Search configuration.
See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#indexing-massindexer-multitenancy">this section of the reference documentation</a>
for more information.</p>
</dd>
<dt class="hdlist1">Setting up thread locals during mass indexing</dt>
<dd>
<p>The mass indexer now has a concept of "mass indexing environment",
allowing for instance to set up custom thread locals in mass indexing threads.
See the <code>environment</code> parameter in <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#indexing-massindexer-parameters">this section of the reference documentation</a>
for more information.</p>
</dd>
<dt class="hdlist1">Better exception handling</dt>
<dd>
<p>Exceptions thrown by Hibernate ORM during mass indexing
are now passed to the failure handler as every other exception, instead of aborting the whole mass indexing.</p>
</dd>
<dt class="hdlist1">Smarter defaults for parameters</dt>
<dd>
<p><code>purgeAllOnStart</code> is now disabled by default in the mass indexer when <code>dropAndCreateSchemaOnStart</code> is enabled.</p>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="outbox-polling-improvements"><a class="anchor" href="#outbox-polling-improvements" /><code>outbox-polling</code> coordination improvements</h3>
<div class="dlist">
<dl>
<dt class="hdlist1">Outbox events and agents now use UUIDs for their identifiers</dt>
<dd>
<p>The primary key of the relevant tables are now using UUIDs instead of longs,
to avoid reliance on sequences that were slowing down event processing on some databases.
The migration guide includes migration scripts for the necessary database schema changes.</p>
</dd>
<dt class="hdlist1">Customizable database schema</dt>
<dd>
<p>Simple, straightforward configuration properties now allow customizing the database schema involved in Hibernate Search’s <code>outbox-polling</code> coordination strategy:
table names, schema and catalog, type of UUID columns as well as UUID generation strategy (random vs. time).
See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#_custom_schematable_nameetc">this section of the reference documentation</a>
for more information.</p>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="elasticsearch-schema-export"><a class="anchor" href="#elasticsearch-schema-export" />Elasticsearch schema export</h3>
<div class="paragraph">
<p>It is now possible to export the Elasticsearch schema that Hibernate Search expects to JSON files on the filesystem:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA">SearchSchemaManager schemaManager = searchSession.schemaManager();
schemaManager.exportExpectedSchema( Path.of( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">mydirectory</span><span style="color:#710">"</span></span> ) );</code></pre>
</div>
</div>
<div class="paragraph">
<p>The code above will result in a directory tree similar to this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code># For the default backend: backend/indexes/<index-name>/<file>
mydirectory/backend/indexes/customer/create-index.json
mydirectory/backend/indexes/customer/create-index-query-params.json
mydirectory/backend/indexes/order/create-index.json
mydirectory/backend/indexes/order/create-index-query-params.json
# For additional named backends: backend/<backend-name>/indexes/<index-name>/<file>
mydirectory/backends/auth/indexes/user/create-index.json
mydirectory/backends/auth/indexes/user/create-index-query-params.json
mydirectory/backends/auth/indexes/usergroup/create-index.json
mydirectory/backends/auth/indexes/usergroup/create-index-query-params.json</code></pre>
</div>
</div>
<div class="paragraph">
<p>See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#schema-management-export">this section of the reference documentation</a>
for more information.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new-compared-to-hibernate-search-6-2-0-cr1"><a class="anchor" href="#whats-new-compared-to-hibernate-search-6-2-0-cr1" />What’s new compared to Hibernate Search 6.2.0.CR1</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For a list of changes since 6.2.0.CR1 only,
refer to the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32168">release notes</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/6.2/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="getting-started-migrating"><a class="anchor" href="#getting-started-migrating" />Getting started, migrating</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For new applications,
refer to the getting started guide:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/6.2/getting-started/orm/en-US/html_single/">here for the Hibernate ORM integration</a></p>
</li>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/6.2/getting-started/standalone/en-US/html_single/">here for the Standalone POJO Mapper</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For existing applications, Hibernate Search 6.2 is a drop-in replacement for 6.1,
assuming you also upgrade the dependencies.
Information about deprecated configuration and API
is included in the <a href="https://docs.jboss.org/hibernate/search/6.2/migration/html_single/">migration guide</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/07/03/hibernate-reactive-2_0_2_Final/Hibernate Reactive 2.0.2.Final released2024-03-22T12:27:06+00:002023-07-03T00:00:00+00:00Davide D'Alto
Hibernate Reactive 2.0.2.Final is now available!
This release contains an important bug fix that solves a race codition issue when running muliple updates.
How can I get it?
All details are available on the
Hibernate Reactive website releases page.
If you are new to Hibernate Reactive, the official documentation is a good place to start.
Feedback, issues, ideas?
To get in touch, you can use the following channels:
hibernate-reactive tag on Stackoverflow (usage questions)
User forum or the hibernate-user stream on Zulip (usage questions, general feedback)
Issue tracker (bug reports, feature requests)
Mailing list or the hibernate-reactive-dev stream on Zulip (development-related discussions)...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://hibernate.org/reactive/releases/2.0/#getting_started">Hibernate Reactive 2.0.2.Final</a> is now available!</p>
</div>
<div class="paragraph">
<p>This release contains an important bug fix that <a href="https://github.com/hibernate/hibernate-reactive/issues/1687">solves a race codition issue</a> when running muliple updates.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-can-i-get-it"><a class="anchor" href="#how-can-i-get-it" />How can I get it?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available on the
<a href="https://hibernate.org/reactive/releases/2.0/#get-it">Hibernate Reactive website releases page</a>.</p>
</div>
<div class="paragraph">
<p>If you are new to Hibernate Reactive, <a href="http://hibernate.org/reactive/documentation/2.0/reference/html_single/#getting-started">the official documentation</a> is a good place to start.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, you can use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-reactive"><strong>hibernate-reactive</strong> tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-reactive">User forum</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/132096-hibernate-user"><strong>hibernate-user</strong> stream on Zulip</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://github.com/hibernate/hibernate-reactive/issues">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/205413-hibernate-reactive-dev"><strong>hibernate-reactive-dev</strong> stream on Zulip</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/06/30/hibernate-orm-626-final/Hibernate ORM 6.2.6.Final released2024-03-22T12:27:07+00:002023-06-30T00:00:00+00:00Marco Belladelli
Today, we published a new maintenance release of Hibernate ORM 6.2: 6.2.6.Final.
What’s new
This update includes several bugfixes and further stabilization as we approach the release of the next minor Hibernate version.
Bugfixes
Embeddable keys and property sorting
We have fixed a bug that caused the properties of composite keys to be in an unexpected order, causing possible problems with constraints (see HHH-16514)
Bytecode enhancement
We keep improving Hibernate’s bytecode enhancement support, this time we tackled several bugs:
Reading entities that extended a @MappedSuperclass declared in a different package did not work correctly (see HHH-16711)
Bytecode enhancement caused a lazy @ManyToOne association targeting an Entity annotated with @Proxy(lazy...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Today, we published a new maintenance release of Hibernate ORM 6.2: 6.2.6.Final.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This update includes several bugfixes and further stabilization as we approach the release of the next minor Hibernate version.</p>
</div>
<div class="sect2">
<h3 id="bugfixes"><a class="anchor" href="#bugfixes" />Bugfixes</h3>
<div class="sect3">
<h4 id="embeddable-keys-and-property-sorting"><a class="anchor" href="#embeddable-keys-and-property-sorting" />Embeddable keys and property sorting</h4>
<div class="paragraph">
<p>We have fixed a bug that caused the properties of composite keys to be in an unexpected order, causing possible problems with constraints (see <a href="https://hibernate.atlassian.net/browse/HHH-16514">HHH-16514</a>)</p>
</div>
</div>
<div class="sect3">
<h4 id="bytecode-enhancement"><a class="anchor" href="#bytecode-enhancement" />Bytecode enhancement</h4>
<div class="paragraph">
<p>We keep improving Hibernate’s bytecode enhancement support, this time we tackled several bugs:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Reading entities that extended a <code>@MappedSuperclass</code> declared in a different package did not work correctly (see <a href="https://hibernate.atlassian.net/browse/HHH-16711">HHH-16711</a>)</p>
</li>
<li>
<p>Bytecode enhancement caused a lazy <code>@ManyToOne</code> association targeting an Entity annotated with <code>@Proxy(lazy = false)</code> to be eagerly loaded (see <a href="https://hibernate.atlassian.net/browse/HHH-16794">HHH-16794</a>)</p>
</li>
<li>
<p>Hibernate failed to update a one-to-one lazy association with <code>OptimisticLockType.DIRTY</code> and enabled bytecode enhancement (see <a href="https://hibernate.atlassian.net/browse/HHH-16839">HHH-16839</a>)</p>
</li>
<li>
<p>Bytecode enhancement led to a broken constructor for an embedded field declared as a generic in a <code>@MappedSuperclass</code> (see <a href="https://hibernate.atlassian.net/browse/HHH-16832">HHH-16832</a>)</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="subqueries-and-joins"><a class="anchor" href="#subqueries-and-joins" />Subqueries and joins</h4>
<div class="paragraph">
<p>We addressed a couple issues that affected Hibernate generated subqeries when using joins:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>When reusing a join in a subquery the table would be referenced again instead of reusing the join (see <a href="https://hibernate.atlassian.net/browse/HHH-16537">HHH-16537</a>)</p>
</li>
<li>
<p>An HQL query with a subquery that used an entity path at least two levels deep produced SQL with a missing join predicate (see <a href="https://hibernate.atlassian.net/browse/HHH-16721">HHH-16721</a>)</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="polymorphic-queries"><a class="anchor" href="#polymorphic-queries" />Polymorphic queries</h4>
<div class="paragraph">
<p>We have fixed some bugs related to polymorphic queries:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>When using a polymorphic entity-valued path as an argument for a function a <em>SqmRoot not yet resolved to TableGroup</em> error was triggered (see <a href="https://hibernate.atlassian.net/browse/HHH-16733">HHH-16733</a>)</p>
</li>
<li>
<p>An exception was thrown when processing a polymorphic entity’s nested join in a subquery (see <a href="https://hibernate.atlassian.net/browse/HHH-16582">HHH-16582</a>)</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
Hibernate now uses the existing <code>SQM</code> copy logic to process entity polymorphism, keeping the behavior consistent with what was already in place for criteria queries.
</td>
</tr>
</table>
</div>
</div>
<div class="sect3">
<h4 id="batch-loading"><a class="anchor" href="#batch-loading" />Batch loading</h4>
<div class="paragraph">
<p>In previous 6.2 versions the batch loading feature was improved several times. With this release we keep stabilizing it by fixing a couple issues:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>In-clause parameter padding did not consider the Dialect’s in-expression count limit which could cause errors on the DMBS side (see <a href="https://hibernate.atlassian.net/browse/HHH-16589">HHH-16589</a>)</p>
</li>
<li>
<p>When batching was enabled the <code>LockModeType</code> requested through the <code>session.find()</code> method was ignored (see <a href="https://hibernate.atlassian.net/browse/HHH-16820">HHH-16820</a>)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>There are more improvements and bugfixes included in this version. You can find the full list of changes <a href="https://hibernate.atlassian.net/issues/?jql=project%20%3D%20HHH%20AND%20fixVersion%20%3D%2032164">here</a>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="conclusion"><a class="anchor" href="#conclusion" />Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.2/">release page</a>.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the usual channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://stackoverflow.com/questions/tagged/hibernate"><strong>hibernate</strong> tag on Stack Overflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-orm">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HHH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/06/26/hibernate-search-6-2-0-CR1/Hibernate Search 6.2.0.CR1 released2024-03-22T12:27:07+00:002023-06-26T00:00:00+00:00Yoann Rodière
We just published Hibernate Search 6.2.0.CR1,
a candidate release of the next minor version of Hibernate Search.
This release brings in particular a new excludePaths filter for @IndexedEmbedded,
and includePaths/includeDepth/excludePaths filters for @ObjectProjection.
6.2.0.CR1 also includes compatibility with OpenSearch 2.8,
an upgrade to Hibernate ORM 5.6.15.Final,
an upgrade of -orm6 artifacts to Hibernate ORM 6.2.5.Final,
and other bugfixes and improvements.
What’s new
For a summary of all new features and improvements since 6.1,
head to the dedicated page on hibernate.org.
Dependency upgrades
Hibernate ORM (HSEARCH-4880/HSEARCH-4875/HSEARCH-4869)
Hibernate Search now depends on Hibernate ORM 5.6.15.Final for its main artifacts,
and 6.2.5.Final for -orm6 artifacts.
Hibernate ORM 6.0 and 6.1 are no longer considered compatible.
Elasticsearch (HSEARCH-4857)
The Elasticsearch...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We just published Hibernate Search 6.2.0.CR1,
a candidate release of the next minor version of Hibernate Search.</p>
</div>
<div class="paragraph">
<p>This release brings in particular a new <code>excludePaths</code> filter for <code>@IndexedEmbedded</code>,
and <code>includePaths</code>/<code>includeDepth</code>/<code>excludePaths</code> filters for <code>@ObjectProjection</code>.</p>
</div>
<div class="paragraph">
<p>6.2.0.CR1 also includes compatibility with OpenSearch 2.8,
an upgrade to Hibernate ORM 5.6.15.Final,
an upgrade of <code>-orm6</code> artifacts to Hibernate ORM 6.2.5.Final,
and other bugfixes and improvements.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
<div class="paragraph">
<p>For a summary of all new features and improvements since 6.1,
head to <a href="https://hibernate.org/search/releases/6.2/#whats-new">the dedicated page on hibernate.org</a>.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="dependency-upgrades"><a class="anchor" href="#dependency-upgrades" />Dependency upgrades</h3>
<div id="orm-version" class="dlist">
<dl>
<dt class="hdlist1">Hibernate ORM (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4880">HSEARCH-4880</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4875">HSEARCH-4875</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4869">HSEARCH-4869</a>)</dt>
<dd>
<p>Hibernate Search now depends on Hibernate ORM 5.6.15.Final for its main artifacts,
and 6.2.5.Final for <code>-orm6</code> artifacts.
Hibernate ORM 6.0 and 6.1 are no longer considered compatible.</p>
</dd>
</dl>
</div>
<div id="elasticsearch-version" class="dlist">
<dl>
<dt class="hdlist1">Elasticsearch (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4857">HSEARCH-4857</a>)</dt>
<dd>
<p>The Elasticsearch backend now works with Elasticsearch 8.8
as well as other versions that were already compatible.</p>
</dd>
</dl>
</div>
<div id="opensearch-version" class="dlist">
<dl>
<dt class="hdlist1">OpenSearch (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4870">HSEARCH-4870</a>)</dt>
<dd>
<p>The Elasticsearch backend now works with OpenSearch 2.8
as well as other versions that were already compatible.</p>
</dd>
</dl>
</div>
<div id="others-version" class="dlist">
<dl>
<dt class="hdlist1">Others</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4871">HSEARCH-4871</a>: Upgrade to Elasticsearch <strong>client</strong> 8.8.1</p>
</li>
</ul>
</div>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="indexedembedded-excludepaths"><a class="anchor" href="#indexedembedded-excludepaths" /><code>@IndexedEmbedded(excludePaths = …)</code></h3>
<div class="paragraph">
<p>With <a href="https://hibernate.atlassian.net/browse/HSEARCH-1182">HSEARCH-1182</a>,
the <code>@IndexedEmbedded</code> annotation now exposes an <code>excludePaths</code> attribute,
allowing the inclusion of all paths with only a few selectively excluded,
as opposed to the previous approach of selectively including paths with <code>includePaths</code>.</p>
</div>
<div class="paragraph">
<p>See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#mapping-indexedembedded-filtering">this section of the reference documentation</a>
for more information.</p>
</div>
</div>
<div class="sect2">
<h3 id="objectprojection-filters"><a class="anchor" href="#objectprojection-filters" /><code>@ObjectProjection(includeDepth = …)</code>/<code>@ObjectProjection(includePaths = …)</code>/<code>@ObjectProjection(excludePaths = …)</code></h3>
<div class="paragraph">
<p>With <a href="https://hibernate.atlassian.net/browse/HSEARCH-4725">HSEARCH-4725</a>,
the <code>@ObjectProjection</code> annotation now exposes an <code>includeDepth</code>/<code>includePaths</code>/<code>excludePaths</code> attributes,
which allows in particular breaking cycles of nested object projections.</p>
</div>
<div class="paragraph">
<p>See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-projection-object-mapping-filters">this section of the reference documentation</a>
for more information.</p>
</div>
</div>
<div class="sect2">
<h3 id="other-changes"><a class="anchor" href="#other-changes" />Other improvements and bug fixes</h3>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4616">HSEARCH-4616</a>:
For clarity, "automatic indexing" was renamed to something more explicit throughout Hibernate Search and its documentation.
As a result:</p>
<div class="ulist">
<ul>
<li>
<p><code>hibernate.search.automatic_indexing.enabled</code> is now deprecated in favor of <code>hibernate.search.indexing.listeners.enabled</code></p>
</li>
<li>
<p><code>hibernate.search.automatic_indexing.synchronization.strategy</code> is now deprecated in favor of <code>hibernate.search.indexing.plan.synchronization.strategy</code></p>
</li>
</ul>
</div>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4866">HSEARCH-4866</a>:
<code>hibernate.search.automatic_indexing.enable_dirty_check</code> is now deprecated with no alternative to replace it.
In future versions, a dirty check will always be performed when considering whether to trigger reindexing.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4877">HSEARCH-4877</a>:
(Infinispan) Provided identifier bridges are now applied in the Search DSL and <code>id</code> projections.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>And more. For a full list of changes since the previous releases,
please see the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32160">release notes</a>.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/6.2/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="getting-started-migrating"><a class="anchor" href="#getting-started-migrating" />Getting started, migrating</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For new applications,
refer to the getting started guide:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/6.2/getting-started/orm/en-US/html_single/">here for the Hibernate ORM integration</a></p>
</li>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/6.2/getting-started/standalone/en-US/html_single/">here for the Standalone POJO Mapper</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For existing applications, Hibernate Search 6.2 is a drop-in replacement for 6.1,
assuming you also upgrade the dependencies.
Information about deprecated configuration and API
is included in the <a href="https://docs.jboss.org/hibernate/search/6.2/migration/html_single/">migration guide</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/06/16/hibernate-reactive-2_0_1_Final/Hibernate Reactive 2.0.1.Final released2024-03-22T12:27:06+00:002023-06-16T00:00:00+00:00Davide D'Alto
Hibernate Reactive 2.0.1.Final is now available!
This version is compatible with Hibernate ORM 6.2.5.Final)
and adds support for the @Lob annotation for MySQL, MariaDB, Oracle, and MS Sql Server.
How can I get it?
All details are available on the
Hibernate Reactive website releases page.
If you are new to Hibernate Reactive, the official documentation is a good place to start.
Feedback, issues, ideas?
To get in touch, you can use the following channels:
hibernate-reactive tag on Stackoverflow (usage questions)
User forum or the hibernate-user stream on Zulip (usage questions, general feedback)
Issue tracker (bug reports, feature requests)
Mailing list or the hibernate-reactive-dev stream on Zulip (development-related discussions)...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://hibernate.org/reactive/releases/2.0/#getting_started">Hibernate Reactive 2.0.1.Final</a> is now available!</p>
</div>
<div class="paragraph">
<p>This version is compatible with <a href="https://in.relation.to/2023/06/15/hibernate-orm-625-final/">Hibernate ORM 6.2.5.Final</a>)
and adds support for the <code>@Lob</code> annotation for MySQL, MariaDB, Oracle, and MS Sql Server.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-can-i-get-it"><a class="anchor" href="#how-can-i-get-it" />How can I get it?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available on the
<a href="https://hibernate.org/reactive/releases/2.0/#get-it">Hibernate Reactive website releases page</a>.</p>
</div>
<div class="paragraph">
<p>If you are new to Hibernate Reactive, <a href="http://hibernate.org/reactive/documentation/2.0/reference/html_single/#getting-started">the official documentation</a> is a good place to start.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, you can use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-reactive"><strong>hibernate-reactive</strong> tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-reactive">User forum</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/132096-hibernate-user"><strong>hibernate-user</strong> stream on Zulip</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://github.com/hibernate/hibernate-reactive/issues">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/205413-hibernate-reactive-dev"><strong>hibernate-reactive-dev</strong> stream on Zulip</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/06/15/hibernate-orm-625-final/Hibernate ORM 6.2.5.Final released2024-03-22T12:27:07+00:002023-06-15T00:00:00+00:00Marco Belladelli
Today, we published a new maintenance release of Hibernate ORM 6.2: 6.2.5.Final.
What’s new
This maintenance release keeps improving stability with several bugfixes.
Bugfixes
Second level cache fixes
We have fixed several bugs related to Hibernate’s second level cache functionalities:
Caching was not working properly for entities with inheritance when hibernate.cache.use_structured_entries was enabled (see HHH-16714).
Hibernate failed to access a lazy fetched @ManyToOne association which was part of a composite @IdClass identifier when stored in L2 cache (see HHH-16673).
A TransientObjectException was encountered when loading a versioned entity from the second level cache with a @OneToOne lazy mapping (see HHH-16745).
Treated and generic association joins
We addressed a couple issues...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Today, we published a new maintenance release of Hibernate ORM 6.2: 6.2.5.Final.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This maintenance release keeps improving stability with several bugfixes.</p>
</div>
<div class="sect2">
<h3 id="bugfixes"><a class="anchor" href="#bugfixes" />Bugfixes</h3>
<div class="sect3">
<h4 id="second-level-cache-fixes"><a class="anchor" href="#second-level-cache-fixes" />Second level cache fixes</h4>
<div class="paragraph">
<p>We have fixed several bugs related to Hibernate’s second level cache functionalities:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Caching was not working properly for entities with inheritance when <code>hibernate.cache.use_structured_entries</code> was enabled (see <a href="https://hibernate.atlassian.net/browse/HHH-16714">HHH-16714</a>).</p>
</li>
<li>
<p>Hibernate failed to access a lazy fetched <code>@ManyToOne</code> association which was part of a composite <code>@IdClass</code> identifier when stored in L2 cache (see <a href="https://hibernate.atlassian.net/browse/HHH-16673">HHH-16673</a>).</p>
</li>
<li>
<p>A <code>TransientObjectException</code> was encountered when loading a versioned entity from the second level cache with a <code>@OneToOne</code> lazy mapping (see <a href="https://hibernate.atlassian.net/browse/HHH-16745">HHH-16745</a>).</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="treated-and-generic-association-joins"><a class="anchor" href="#treated-and-generic-association-joins" />Treated and generic association joins</h4>
<div class="paragraph">
<p>We addressed a couple issues that occurred when joining on generic or treated association paths:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>When joining on a treated association we failed to retrieve the attribute from the correct treat target type (see <a href="https://hibernate.atlassian.net/browse/HHH-16574">HHH-16574</a>).</p>
</li>
<li>
<p>When joining on a <code>MappedSuperclass</code> generic association there was a problem recognizing the association attribute from the concrete (see <a href="https://hibernate.atlassian.net/browse/HHH-16693">HHH-16693</a>).</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="mapping-the-same-column-to-different-properties"><a class="anchor" href="#mapping-the-same-column-to-different-properties" />Mapping the same column to different properties</h4>
<div class="ulist">
<ul>
<li>
<p>We have fixed several issues that were reported for different use cases which had problems when mapping the same underlying database column to different model properties (see <a href="https://hibernate.atlassian.net/browse/HHH-15929">HHH-15929</a>).</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="batching-and-composite-identifiers"><a class="anchor" href="#batching-and-composite-identifiers" />Batching and composite identifiers</h4>
<div class="paragraph">
<p>We have fixed a couple bugs related to composite identifiers when batching was enabled:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Fetching an element collection on an entity with a composite <code>@EmbeddedId</code> identifier failed with batch enabled (see <a href="https://hibernate.atlassian.net/browse/HHH-16740">HHH-16740</a>).</p>
</li>
<li>
<p>A <code>ClassCastException</code> was triggered when an entity with an <code>@ElementCollection</code> had an <code>@EmbeddedId</code> with just one field and batching was enabled (see <a href="https://hibernate.atlassian.net/browse/HHH-16750">HHH-16750</a>).</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>There are more improvements and bugfixes included in this version. You can find the full list of changes <a href="https://hibernate.atlassian.net/issues/?jql=project%20%3D%20HHH%20AND%20fixVersion%20%3D%2032158">here</a>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="conclusion"><a class="anchor" href="#conclusion" />Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.2/">release page</a>.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the usual channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://stackoverflow.com/questions/tagged/hibernate"><strong>hibernate</strong> tag on Stack Overflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-orm">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HHH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/06/02/hibernate-search-6-2-0-Beta1/Hibernate Search 6.2.0.Beta1 is out2024-03-22T12:27:07+00:002023-06-02T00:00:00+00:00Yoann Rodière
We just published Hibernate Search 6.2.0.Beta1,
a beta release of the next minor version of Hibernate Search.
This version brings highlighting in the Search DSL,
indexing plan filters to suspend automatic indexing,
an Elasticsearch schema export tool,
mapping annotations for constructor parameters when using @ProjectionConstructor,
and .missing().lowest()/.missing().highest() options in sorts.
6.2.0.Beta1 also includes many bugfixes and improvements,
compatibility with Elasticsearch 8.8 and OpenSearch 2.7,
an upgrade of -orm6 artifacts to Hibernate ORM 6.2.4.Final,
and more.
What’s new
Hibernate Search 6.2 is still in development:
some features are still incomplete or may change in a backward-incompatible way.
Dependency upgrades
Hibernate ORM (HSEARCH-4860)
Hibernate Search now depends on Hibernate ORM 6.2.4.Final for -orm6 artifacts.
Elasticsearch (HSEARCH-4857)
The Elasticsearch backend now...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We just published Hibernate Search 6.2.0.Beta1,
a beta release of the next minor version of Hibernate Search.</p>
</div>
<div class="paragraph">
<p>This version brings highlighting in the Search DSL,
indexing plan filters to suspend automatic indexing,
an Elasticsearch schema export tool,
mapping annotations for constructor parameters when using <code>@ProjectionConstructor</code>,
and <code>.missing().lowest()</code>/<code>.missing().highest()</code> options in sorts.</p>
</div>
<div class="paragraph">
<p>6.2.0.Beta1 also includes many bugfixes and improvements,
compatibility with Elasticsearch 8.8 and OpenSearch 2.7,
an upgrade of <code>-orm6</code> artifacts to Hibernate ORM 6.2.4.Final,
and more.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
<div class="paragraph">
<p>Hibernate Search 6.2 is still in development:
some features are still incomplete or may change in a backward-incompatible way.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="dependency-upgrades"><a class="anchor" href="#dependency-upgrades" />Dependency upgrades</h3>
<div id="orm-version" class="dlist">
<dl>
<dt class="hdlist1">Hibernate ORM (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4860">HSEARCH-4860</a>)</dt>
<dd>
<p>Hibernate Search now depends on Hibernate ORM 6.2.4.Final for -orm6 artifacts.</p>
</dd>
</dl>
</div>
<div id="elasticsearch-version" class="dlist">
<dl>
<dt class="hdlist1">Elasticsearch (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4857">HSEARCH-4857</a>)</dt>
<dd>
<p>The Elasticsearch backend now works with Elasticsearch 8.8
as well as other versions that were already compatible.</p>
</dd>
</dl>
</div>
<div id="opensearch-version" class="dlist">
<dl>
<dt class="hdlist1">OpenSearch (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4850">HSEARCH-4850</a>)</dt>
<dd>
<p>The Elasticsearch backend now works with OpenSearch 2.7
as well as other versions that were already compatible.</p>
</dd>
</dl>
</div>
<div id="others-version" class="dlist">
<dl>
<dt class="hdlist1">Others</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4857">HSEARCH-4857</a>: Upgrade to Elasticsearch <strong>client</strong> 8.8.0</p>
</li>
</ul>
</div>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="search-highlighting"><a class="anchor" href="#search-highlighting" />Highlighting</h3>
<div class="paragraph">
<p>With <a href="https://hibernate.atlassian.net/browse/HSEARCH-2192">HSEARCH-2192</a>, Hibernate Search now offers a new feature in the Search DSL: highlighting.</p>
</div>
<div class="paragraph">
<p>Highlighting is a projection that returns fragments from full-text fields of matched documents that caused a query match.
Specific terms that caused the match are "highlighted" with a pair of opening and closing tags.
It can help a user to quickly identify the information they were searching for on a results page.</p>
</div>
<div class="paragraph">
<p>For example, one can enable highlighting on a full-text field like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#007">@Entity</span>
<span style="color:#007">@Indexed</span>
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Book</span> {
<span style="color:#007">@Id</span>
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">Integer</span> id;
<span style="color:#007">@FullTextField</span>(analyzer = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">english</span><span style="color:#710">"</span></span>)
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">String</span> title;
<span style="color:#007">@FullTextField</span>(analyzer = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">english</span><span style="color:#710">"</span></span>, highlightable = Highlightable.ANY)
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">String</span> description;
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>And then retrieve highlights like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA">SearchSession searchSession = <span style="color:#777">/* ... */</span>
<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">String</span>>> result = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.select( f -> f.highlight( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">description</span><span style="color:#710">"</span></span> ) )
.where( f -> f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">description</span><span style="color:#710">"</span></span> ).matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">robot</span><span style="color:#710">"</span></span> ) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="paragraph">
<p>Which can for example return the following highlights:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code># Hit #0
["A <em>robot</em> becomes self-aware."]
# Hit #1
["A <em>robot</em> helps investigate a murder on an extrasolar colony.",
"On this planet, <em>robots</em> are used extensively."]
# etc.</code></pre>
</div>
</div>
<div class="paragraph">
<p>This is a simple example, but highligting can be configured extensively.
See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-highlighting">this section of the reference documentation</a>
for more information.</p>
</div>
</div>
<div class="sect2">
<h3 id="indexing-plan-filter"><a class="anchor" href="#indexing-plan-filter" />Indexing plan filters</h3>
<div class="paragraph">
<p>With <a href="https://hibernate.atlassian.net/browse/HSEARCH-168">HSEARCH-168</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-1383">HSEARCH-1383</a>,
Hibernate Search now allow enabling/disabling indexing in indexing plans (which include in particular automatic indexing),
both fully (for all types) or on a per-type basis.</p>
</div>
<div class="paragraph">
<p>For example, the following will disable automatic indexing
for future changes on all instances of the class <code>Company</code>,
except for instances of its subclass <code>Customer</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA">SearchMapping searchMapping = <span style="color:#777">/* ... */</span>
searchMapping.indexingPlanFilter(
ctx -> ctx.exclude( Company.class )
.include( Customer.class )
);</code></pre>
</div>
</div>
<div class="paragraph">
<p>Indexing plan filters can also be configured per-session
(though limitations apply when using the <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#coordination-outbox-polling"><code>outbox-polling</code> coordination strategy</a>):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA">SearchSession searchSession = <span style="color:#777">/* ... */</span>
searchSession.indexingPlanFilter(
ctx -> ctx.exclude( Company.class )
.include( Customer.class )
);</code></pre>
</div>
</div>
<div class="paragraph">
<p>See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#indexing-plan-filter">this section of the reference documentation</a>
for more information.</p>
</div>
</div>
<div class="sect2">
<h3 id="mapping-projection"><a class="anchor" href="#mapping-projection" />Mapping annotations for constructor parameters when using <code>@ProjectionConstructor</code></h3>
<div class="paragraph">
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4574">HSEARCH-4574</a> adds mapping annotations for constructor parameters when using <code>@ProjectionConstructor</code>.</p>
</div>
<div class="paragraph">
<p>This means in particular you can now project to other things than just fields when using <code>@ProjectionConstructor</code>,
for example the entity identifier:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#007">@ProjectionConstructor</span>
<span style="color:#088;font-weight:bold">public</span> record MyBookIdAndTitleProjection(
<span style="color:#007">@IdProjection</span> <i class="conum" data-value="1" /><b>(1)</b>
<span style="color:#0a8;font-weight:bold">Integer</span> id,
<span style="color:#0a8;font-weight:bold">String</span> title <i class="conum" data-value="2" /><b>(2)</b>
) {
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1" /><b>1</b></td>
<td>Projects to the entity identifier (explicit projection through an explicit annotation)</td>
</tr>
<tr>
<td><i class="conum" data-value="2" /><b>2</b></td>
<td>Projects to field <code>title</code> (implicit projection)</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>But this also allows configuring field projections more precisely,
for example setting the path of a field projection to something else
than just the name of the constructor parameter:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#007">@ProjectionConstructor</span>
<span style="color:#088;font-weight:bold">public</span> record MyBookTitleAndAuthorNamesProjection(
<span style="color:#007">@FieldProjection</span> <i class="conum" data-value="1" /><b>(1)</b>
<span style="color:#0a8;font-weight:bold">String</span> title,
<span style="color:#007">@FieldProjection</span>(path = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors.lastName</span><span style="color:#710">"</span></span>) <i class="conum" data-value="2" /><b>(2)</b>
<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">String</span>> authorLastNames
) {
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1" /><b>1</b></td>
<td>Projects to field <code>title</code> (path derived from the name of the constructor parameter)</td>
</tr>
<tr>
<td><i class="conum" data-value="2" /><b>2</b></td>
<td>Projects to field <code>authors.lastName</code> (explicit path)</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#mapping-projection-inner-explicit">this section of the reference documentation</a>
for more information about this feature in general,
and <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-projection">the documentation of each projection</a>
for more information about each available annotation.</p>
</div>
</div>
<div class="sect2">
<h3 id="search-dsl-improvements"><a class="anchor" href="#search-dsl-improvements" />Search DSL improvements</h3>
<div id="missing-lowest-highest" class="dlist">
<dl>
<dt class="hdlist1"><a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-sort-common-missing"><code>.missing().lowest()</code>/<code>.missing().highest()</code> options</a> in sorts (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4149">HSEARCH-4149</a>)</dt>
<dd>
<p>When sorting on a field that may not have a value for some documents,
it was already possible to use <code>.missing().first()</code>/<code>.missing().last()</code>
to tell Hibernate Search to put such documents in first/last position (respectively),
regardless of sorting order (ascending/descending).</p>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>It is now possible, as an alternative, to use <code>.missing().lowest()</code>/<code>.missing().highest()</code>
to tell Hibernate Search to consider such documents as having the lowest/highest value (respectively),
taking into account sorting order (ascending/descending):</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>.missing().lowest()</code> puts documents with no value in the first position when using ascending order
or in the last position when using descending order.</p>
</li>
<li>
<p><code>.missing().highest()</code> puts documents with no value in the last position when using ascending order
or in the first position when using descending order.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>This is mostly useful when the position of missing values is hardcoded,
but the sort order is given by the user:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA">SortOrder orderFromUser = <span style="color:#777">/* ... */</span>;
<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f -> f.matchAll() )
.sort( f -> f.field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">pageCount</span><span style="color:#710">"</span></span> ).missing().lowest().order( orderFromuser ) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
</div>
</div>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="elasticsearch-schema-export"><a class="anchor" href="#elasticsearch-schema-export" />Elasticsearch schema export</h3>
<div class="paragraph">
<p>It is now possible to export the Elasticsearch schema that Hibernate Search expects to JSON files on the filesystem:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA">SearchSchemaManager schemaManager = searchSession.schemaManager();
schemaManager.exportExpectedSchema( Path.of( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">mydirectory</span><span style="color:#710">"</span></span> ) );</code></pre>
</div>
</div>
<div class="paragraph">
<p>The code above will result in a directory tree similar to this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code># For the default backend: backend/indexes/<index-name>/<file>
mydirectory/backend/indexes/customer/create-index.json
mydirectory/backend/indexes/customer/create-index-query-params.json
mydirectory/backend/indexes/order/create-index.json
mydirectory/backend/indexes/order/create-index-query-params.json
# For additional named backends: backend/<backend-name>/indexes/<index-name>/<file>
mydirectory/backends/auth/indexes/user/create-index.json
mydirectory/backends/auth/indexes/user/create-index-query-params.json
mydirectory/backends/auth/indexes/usergroup/create-index.json
mydirectory/backends/auth/indexes/usergroup/create-index-query-params.json</code></pre>
</div>
</div>
<div class="paragraph">
<p>See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#schema-management-export">this section of the reference documentation</a>
for more information.</p>
</div>
</div>
<div class="sect2">
<h3 id="other-changes"><a class="anchor" href="#other-changes" />Other improvements and bug fixes</h3>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4808">HSEARCH-4808</a>:
Added a new configuration option for the Elasticsearch client’s connection keep-alive:
<a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#backend-elasticsearch-configuration-connection-tuning"><code>hibernate.search.backend.max_keep_alive</code></a>.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4772">HSEARCH-4772</a>:
Reporting of non-fatal failures during mass indexing is now limited to a certain number of failures,
which will prevent those failures from flooding the logs.
The limit can be customized with <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#indexing-massindexer-parameters"><code>MassIndexer#failureFloodingThreshold(long)</code></a>.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4843">HSEARCH-4843</a>:
The various module-specific <code>EntityReference</code> interfaces are now deprecated;
use the common <code>org.hibernate.search.engine.common.EntityReference</code> instead.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4827">HSEARCH-4827</a>:
The <code>object</code> projection will no longer allow inner projections that are not affected by nesting
(e.g. <code>id</code>, <code>score</code>, …).</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4803">HSEARCH-4803</a>:
Hibernate Search will now properly ignore internal <code>ServiceConfigurationError</code>s when appropriate.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4825">HSEARCH-4825</a>:
Hibernate Search-generated Elasticsearch dynamic templates
will now be merged with those defined by <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#backend-elasticsearch-mapping-custom">custom mappings</a>,
instead of being erased as soon as a custom mapping are defined (even if those didn’t mention any dynamic templates).</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4853">HSEARCH-4853</a>:
Hibernate Search will now properly handle canonical record constructors used as projection constructors on JDK 21-ea+21 and above.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>And more. For a full list of changes since the previous releases,
please see the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32141">release notes</a>.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/6.2/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="getting-started-migrating"><a class="anchor" href="#getting-started-migrating" />Getting started, migrating</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For new applications,
refer to the getting started guide:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#mapper-orm-getting-started">here for the Hibernate ORM integration</a></p>
</li>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#mapper-pojo-standalone-getting-started">here for the Standalone POJO Mapper</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For existing applications, Hibernate Search 6.2 is a drop-in replacement for 6.1,
assuming you also upgrade the dependencies.
Information about deprecated configuration and API
is included in the <a href="https://docs.jboss.org/hibernate/search/6.2/migration/html_single/">migration guide</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/06/02/hibernate-reactive-2_0_0_Final/Hibernate Reactive 2.0.0.Final released2024-03-22T12:27:06+00:002023-06-02T00:00:00+00:00Davide D'Alto
Hibernate Reactive 2.0.0.Final is now available!
This version is compatible with Hibernate ORM 6.2.4.Final
and Vert.x SQL client 4.4.
Hibernate ORM 6 contains a lot of improvements and changes related to the way entities are handled.
The Hibernate ORM 6.2 migration guide is the best place to keep up with everything that’s changed.
How can I get it?
All details are available on the
Hibernate Reactive website releases page.
If you are new to Hibernate Reactive, the official documentation is a good place to start.
Feedback, issues, ideas?
To get in touch, you can use the following channels:
hibernate-reactive tag on Stackoverflow (usage questions)
User forum or the hibernate-user stream on Zulip...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://hibernate.org/reactive/releases/2.0/#getting_started">Hibernate Reactive 2.0.0.Final</a> is now available!</p>
</div>
<div class="paragraph">
<p>This version is compatible with <a href="https://in.relation.to/2023/06/01/hibernate-orm-624-final/">Hibernate ORM 6.2.4.Final</a>
and <a href="https://vertx.io/docs/#databases">Vert.x SQL client 4.4</a>.</p>
</div>
<div class="paragraph">
<p>Hibernate ORM 6 contains a lot of improvements and changes related to the way entities are handled.
<a href="https://docs.jboss.org/hibernate/orm/6.2/migration-guide/migration-guide.html">The Hibernate ORM 6.2 migration guide</a> is the best place to keep up with everything that’s changed.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-can-i-get-it"><a class="anchor" href="#how-can-i-get-it" />How can I get it?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available on the
<a href="https://hibernate.org/reactive/releases/2.0/#get-it">Hibernate Reactive website releases page</a>.</p>
</div>
<div class="paragraph">
<p>If you are new to Hibernate Reactive, <a href="http://hibernate.org/reactive/documentation/2.0/reference/html_single/#getting-started">the official documentation</a> is a good place to start.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, you can use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-reactive"><strong>hibernate-reactive</strong> tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-reactive">User forum</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/132096-hibernate-user"><strong>hibernate-user</strong> stream on Zulip</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://github.com/hibernate/hibernate-reactive/issues">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/205413-hibernate-reactive-dev"><strong>hibernate-reactive-dev</strong> stream on Zulip</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/06/01/hibernate-orm-624-final/Hibernate ORM 6.2.4.Final released2024-03-22T12:27:07+00:002023-06-01T00:00:00+00:00Marco Belladelli
Today, we published a new maintenance release of Hibernate ORM 6.2: 6.2.4.Final.
What’s new
This release includes several bug fixes and small performance improvements.
Type pollution improvements
We keep gradually improving Hibernate’s performance, with special regard to the type pollution issue currently affecting the JDK (see HHH-16629).
Hibernate Gradle plugin
Dropped support for JPA static metamodel generation
Support for JPA static metamodel generation in the Hibernate Gradle plugin was dropped. You can find more details here.
Bugfixes
Entity associations and joins
We have fixed some issues related to the handling of entity associations and joins:
We now avoid joining tables in more scenarios and should only introduce joins when really needed...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Today, we published a new maintenance release of Hibernate ORM 6.2: 6.2.4.Final.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This release includes several bug fixes and small performance improvements.</p>
</div>
<div class="sect2">
<h3 id="type-pollution"><a class="anchor" href="#type-pollution" />Type pollution improvements</h3>
<div class="paragraph">
<p>We keep gradually improving Hibernate’s performance, with special regard to the <a href="https://bugs.openjdk.org/browse/JDK-8180450">type pollution issue</a> currently affecting the JDK (see <a href="https://hibernate.atlassian.net/browse/HHH-16629">HHH-16629</a>).</p>
</div>
</div>
<div class="sect2">
<h3 id="plugin-static-metamodel"><a class="anchor" href="#plugin-static-metamodel" />Hibernate Gradle plugin</h3>
<div class="sect3">
<h4 id="dropped-support-for-jpa-static-metamodel-generation"><a class="anchor" href="#dropped-support-for-jpa-static-metamodel-generation" />Dropped support for JPA static metamodel generation</h4>
<div class="paragraph">
<p>Support for JPA static metamodel generation in the Hibernate Gradle plugin was dropped. You can find more details <a href="https://hibernate.atlassian.net/browse/HHH-16677">here</a>.</p>
</div>
</div>
</div>
<div class="sect2">
<h3 id="bugfixes"><a class="anchor" href="#bugfixes" />Bugfixes</h3>
<div class="sect3">
<h4 id="entity-associations-and-joins"><a class="anchor" href="#entity-associations-and-joins" />Entity associations and joins</h4>
<div class="paragraph">
<p>We have fixed some issues related to the handling of entity associations and <code>joins</code>:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>We now avoid joining tables in more scenarios and should only introduce <code>joins</code> when really needed (see <a href="https://hibernate.atlassian.net/browse/HHH-16691">HHH-16691</a>).</p>
</li>
<li>
<p>An error was causing a result multiplication when both <code>FetchMode.JOIN</code> and batching were used for retrieving <code>@OneToMany</code> associated items (see <a href="https://hibernate.atlassian.net/browse/HHH-16570">HHH-16570</a>).</p>
</li>
<li>
<p>We now throw an appropriate error when an entity join that is not a <code>cross join</code> doesn’t define an on clause (see <a href="https://hibernate.atlassian.net/browse/HHH-16495">HHH-16495</a>).</p>
</li>
<li>
<p>A lazy association in a <code>@Cacheable</code> entity was already retrieved as initialized (see <a href="https://hibernate.atlassian.net/browse/HHH-16613">HHH-16613</a>).</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="query-caching"><a class="anchor" href="#query-caching" />Query caching</h4>
<div class="paragraph">
<p>We have fixed several bugs related to query caches, specifically regarding the key used for the cache:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The query cache key was not correctly serializable when working with an enabled <code>@Filter</code> or <code>@TenantId</code> (see <a href="https://hibernate.atlassian.net/browse/HHH-16385">HHH-16385</a>).</p>
</li>
<li>
<p><code>@Filter</code> parameters were not included in the query cache key causing some inconsistent results when using different values (see <a href="https://hibernate.atlassian.net/browse/HHH-16617">HHH-16617</a>).</p>
</li>
<li>
<p>Query parameters were not always processed in the same order when generating the query cache key, causing sporadic cache misses expecially with a high number of parameters and criteria queries (see <a href="https://hibernate.atlassian.net/browse/HHH-16594">HHH-16594</a>).</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="map-type-associations"><a class="anchor" href="#map-type-associations" />Map type associations</h4>
<div class="paragraph">
<p>We have a couple bugs related to <code>Map</code> type associations:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Using the <code>@MapKey</code> annotation led to wrongly generated SQL for inserts in some cases (see <a href="https://hibernate.atlassian.net/browse/HHH-16370">HHH-16370</a>).</p>
</li>
<li>
<p>An error was encountered when using an <code>Embeddable</code> typed element collection in a map association (see <a href="https://hibernate.atlassian.net/browse/HHH-16540">HHH-16540</a>).</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="null-pointer-exceptions"><a class="anchor" href="#null-pointer-exceptions" />Null Pointer Exceptions</h4>
<div class="paragraph">
<p>The latest Hibernate updates introduced a couple cases triggering a <code>NullPointerException</code> that were fixed:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>An NPE was encountered when generating the mapping metamodel if inheritance was used for an <code>@IdClass</code> (see <a href="https://hibernate.atlassian.net/browse/HHH-16664">HHH-16664</a>).</p>
</li>
<li>
<p>An entity with an <code>@Any</code> annotated attribute caused a null pointer when merging (see <a href="https://hibernate.atlassian.net/browse/HHH-16532">HHH-16532</a>).</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>There are many more improvements and bugfixes included in this version. You can find the full list of changes <a href="https://hibernate.atlassian.net/issues/?jql=project%20%3D%20HHH%20AND%20fixVersion%20%3D%2032156">here</a>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="conclusion"><a class="anchor" href="#conclusion" />Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.2/">release page</a>.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the usual channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://stackoverflow.com/questions/tagged/hibernate"><strong>hibernate</strong> tag on Stack Overflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-orm">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HHH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/05/18/hibernate-orm-623-final/Hibernate ORM 6.2.3.Final released2024-03-22T12:27:07+00:002023-05-18T00:00:00+00:00Marco Belladelli
Today, we published a new maintenance release of Hibernate ORM 6.2: 6.2.3.Final.
What’s new
This release includes several bug fixes and small performance improvements.
Hibernate Spatial
PostGIS distance operators
We have added HQL support for the native PostGIS distance operators. For details, see HHH-15160.
Bugfixes
Refresh operations
We have fixed a couple of issues related to the refresh operation:
An error was triggered when calling refresh on an entity with both lazy and eager associations (see HHH-16423).
The lazy loading of associated collections failed after calling refresh on an entity (see HHH-16447).
Associated collection loading
We have fixed several bugs related to loading an entity’s associated collections:
Loading an Entity with two eager...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Today, we published a new maintenance release of Hibernate ORM 6.2: 6.2.3.Final.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This release includes several bug fixes and small performance improvements.</p>
</div>
<div class="sect2">
<h3 id="hibernate-spatial"><a class="anchor" href="#hibernate-spatial" />Hibernate Spatial</h3>
<div class="sect3">
<h4 id="postgis-distance-operators"><a class="anchor" href="#postgis-distance-operators" />PostGIS distance operators</h4>
<div class="paragraph">
<p>We have added HQL support for the native PostGIS distance operators. For details, see <a href="https://hibernate.atlassian.net/browse/HHH-15160">HHH-15160</a>.</p>
</div>
</div>
</div>
<div class="sect2">
<h3 id="bugfixes"><a class="anchor" href="#bugfixes" />Bugfixes</h3>
<div class="sect3">
<h4 id="refresh-operations"><a class="anchor" href="#refresh-operations" />Refresh operations</h4>
<div class="paragraph">
<p>We have fixed a couple of issues related to the <code>refresh</code> operation:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>An error was triggered when calling <code>refresh</code> on an entity with both lazy and eager associations (see <a href="https://hibernate.atlassian.net/browse/HHH-16423">HHH-16423</a>).</p>
</li>
<li>
<p>The lazy loading of associated collections failed after calling <code>refresh</code> on an entity (see <a href="https://hibernate.atlassian.net/browse/HHH-16447">HHH-16447</a>).</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="associated-collection-loading"><a class="anchor" href="#associated-collection-loading" />Associated collection loading</h4>
<div class="paragraph">
<p>We have fixed several bugs related to loading an entity’s associated collections:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Loading an Entity with two eager collections produced duplicates if one of the collection is a bag (see <a href="https://hibernate.atlassian.net/browse/HHH-16453">HHH-16453</a>).</p>
</li>
<li>
<p>Multiple identical <code>SELECT</code> statements were issues to load an optional one-to-one association (see <a href="https://hibernate.atlassian.net/browse/HHH-16469">HHH-16469</a>).</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="treated-paths-and-entity-types"><a class="anchor" href="#treated-paths-and-entity-types" />Treated paths and entity types</h4>
<div class="paragraph">
<p>We have improved Hibernate’s handling of treated entity types. Previously, in some cases, we were creating too restrictive queries for certain inheritance structures and treated paths. With this new logic we should always guarantee correct results while also gaining improved query optimization and performance (see <a href="https://hibernate.atlassian.net/browse/HHH-15726">HHH-15726</a>).</p>
</div>
</div>
<div class="sect3">
<h4 id="generics"><a class="anchor" href="#generics" />Generics</h4>
<div class="paragraph">
<p>We continue to improve support for Java Generics: we added handling for generic component properties (i.e. <code>@Embedded</code> and <code>@EmbeddedId</code>) that will allow the use of Generics while being consistent with the JPA specification and providing correct results (see <a href="https://hibernate.atlassian.net/browse/HHH-16491">HHH-16491</a>).</p>
</div>
<div class="paragraph">
<p>There are more improvements and bugfixes included in this version. You can find the full list of changes <a href="https://hibernate.atlassian.net/issues/?jql=project%20%3D%20HHH%20AND%20fixVersion%20%3D%2032152">here</a>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="conclusion"><a class="anchor" href="#conclusion" />Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.2/">release page</a>.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the usual channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://stackoverflow.com/questions/tagged/hibernate"><strong>hibernate</strong> tag on Stack Overflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-orm">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HHH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/04/28/hibernate-orm-622-final/Hibernate ORM 6.2.2.Final released2024-03-22T12:27:07+00:002023-04-28T00:00:00+00:00Marco Belladelli
Today, we published a new maintenance release of Hibernate ORM 6.2: 6.2.2.Final.
What’s new
This release includes several bug fixes and small performance improvements.
Batch fetch performance
The performance of batch fetch loading (@BatchSize) has been improved by better caching of
SQL AST and other references where possible. See HHH-16441 for details.
SQL ARRAY for multi-key loads
When loading entities or collections by multiple keys, Hibernate can now utilize a SQL ARRAY valued
parameter to pass all ids at once. This is implemented for all multi-key loads:
Batch fecthing
Session#byMultipleIds
Session#byMultipleNaturalId
This is limited to single-column keys and databases which support ARRAY types. In cases where
an ARRAY parameter cannot be used, Hibernate...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Today, we published a new maintenance release of Hibernate ORM 6.2: 6.2.2.Final.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This release includes several bug fixes and small performance improvements.</p>
</div>
<div class="sect2">
<h3 id="batch-fetch"><a class="anchor" href="#batch-fetch" />Batch fetch performance</h3>
<div class="paragraph">
<p>The performance of batch fetch loading (<code>@BatchSize</code>) has been improved by better caching of
SQL AST and other references where possible. See <a href="https://hibernate.atlassian.net/browse/HHH-16441">HHH-16441</a> for details.</p>
</div>
</div>
<div class="sect2">
<h3 id="multi-key-array"><a class="anchor" href="#multi-key-array" />SQL ARRAY for multi-key loads</h3>
<div class="paragraph">
<p>When loading entities or collections by multiple keys, Hibernate can now utilize a SQL ARRAY valued
parameter to pass all ids at once. This is implemented for all multi-key loads:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="#batch-fetch">Batch fecthing</a></p>
</li>
<li>
<p><code>Session#byMultipleIds</code></p>
</li>
<li>
<p><code>Session#byMultipleNaturalId</code></p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
This is limited to single-column keys and databases which support ARRAY types. In cases where
an ARRAY parameter cannot be used, Hibernate falls back to its padded strategy which uses a pre-built
SQL AST with a fix-sized IN parameter list.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>See <a href="https://hibernate.atlassian.net/browse/HHH-16466">HHH-16466</a> for details.</p>
</div>
</div>
<div class="sect2">
<h3 id="bugfixes"><a class="anchor" href="#bugfixes" />Bugfixes</h3>
<div class="sect3">
<h4 id="table-resolution-and-self-referencing-associations"><a class="anchor" href="#table-resolution-and-self-referencing-associations" />Table resolution and self referencing associations</h4>
<div class="paragraph">
<p>We have fixed how Hibernate internally resolves the table references to use in a query, with special care put towards self referencing associations and possible optimizations using foreign key columns (see <a href="https://hibernate.atlassian.net/browse/HHH-16382">HHH-16382</a> and related issues).</p>
</div>
</div>
<div class="sect3">
<h4 id="bytecode-enhancement"><a class="anchor" href="#bytecode-enhancement" />Bytecode Enhancement</h4>
<div class="paragraph">
<p>We have fixed a couple issues related to bytecode enhancement:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Faulty code was generated when bidirectional association management was enabled, preventing Hibernate from correctly handling both sides of the association (see <a href="https://hibernate.atlassian.net/browse/HHH-15602">HHH-15602</a>).</p>
</li>
<li>
<p>When both a lazy <code>@ManyToOne</code> association and an eager one were used on the same entity, in some cases Hibernate would not eagerly initialize the latter (see <a href="https://hibernate.atlassian.net/browse/HHH-16477">HHH-16477</a>).</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="group-by-and-order-by-clauses"><a class="anchor" href="#group-by-and-order-by-clauses" />GROUP BY and ORDER BY clauses</h4>
<div class="paragraph">
<p>We have fixed several bugs related to GROUP BY and ORDER BY clauses:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>When grouping by an entity valued property (like a to-one association), we now always expand the rendered GROUP BY clause to use all columns of the entity type to guarantee that the underlying DBMS can correctly group the selections (see <a href="https://hibernate.atlassian.net/browse/HHH-16409">HHH-16409</a>).</p>
</li>
<li>
<p>When using window or ordered-set aggregate functions, we now explicitly disallow using aliased or positional expressions in the ORDER BY clause to prevent problematic query interpretation. We also fixed a bug that was preventing users from ordering by multiple column expression in <code>OVER</code> and <code>WITHIN GROUP</code> clauses (see <a href="https://hibernate.atlassian.net/browse/HHH-16347">HHH-16347</a>).</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="where-clause"><a class="anchor" href="#where-clause" />@Where clause</h4>
<div class="paragraph">
<p>We fixed a bug causing the <code>@Where</code> clause to be mis-rendered when used in a delete mutation query, specifically for the subquery to clean up association tables (see <a href="https://hibernate.atlassian.net/browse/HHH-16392">HHH-16392</a>).</p>
</div>
</div>
<div class="sect3">
<h4 id="sybase-and-jconnect-jdbc-driver"><a class="anchor" href="#sybase-and-jconnect-jdbc-driver" />Sybase and jConnect JDBC driver</h4>
<div class="paragraph">
<p>We have fixed several issues encountered when using Sybase with the jConnect JDBC driver, for a detailed view of the fixes please see the full list of changes link at the bottom of the page.</p>
</div>
</div>
<div class="sect3">
<h4 id="java-records"><a class="anchor" href="#java-records" />Java Records</h4>
<div class="paragraph">
<p>Support for Java Records annotated with <code>@Embeddable</code> was introduced with Hibernate 6.2, but there were still a couple issues:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Java Record embeddables were not included in the JPA metamodel generation (see <a href="https://hibernate.atlassian.net/browse/HHH-16261">HHH-16261</a>).</p>
</li>
<li>
<p>Java Record embeddables properties were not correctly ordered in <code>ValueAccess#getValues()</code> (see <a href="https://hibernate.atlassian.net/browse/HHH-16457">HHH-16457</a>).</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="generics"><a class="anchor" href="#generics" />Generics</h4>
<div class="paragraph">
<p>We continue to improve support for using Java Generics in entity classes, this time we solved an issue regarding a generic enum property annotated with <code>@Enumerated</code> (see <a href="https://hibernate.atlassian.net/browse/HHH-16479">HHH-16479</a>).</p>
</div>
<div class="paragraph">
<p>You can find the full list of changes in this version <a href="https://hibernate.atlassian.net/issues?jql=project=10031+AND+fixVersion=32149">here</a>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="conclusion"><a class="anchor" href="#conclusion" />Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.2/">release page</a>.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the usual channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://stackoverflow.com/questions/tagged/hibernate"><strong>hibernate</strong> tag on Stack Overflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-orm">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HHH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/04/25/hibernate-reactive-2_0_0_CR1/Hibernate Reactive 2.0.0.CR1 released2024-03-22T12:27:06+00:002023-04-25T00:00:00+00:00Davide D'Alto
Hibernate Reactive 2.0.0.CR1 is now available!
Hibernate Reactive is finally compatible with Hibernate ORM 6.2 and Vert.x 4.4.
We will follow up with some more details, but if you want to check it, this is a good place to start.
Migrating from Hibernate ORM 5 to 6 was not an easy task, and would have not be possible without
everybody’s help.
Thanks a lot!
How can I get it?
All details are available on the
Hibernate Reactive website releases page.
If you are new to Hibernate Reactive, the official documentation is a good place to start.
Feedback, issues, ideas?
To get in touch, use the following channels:
hibernate-reactive tag on Stackoverflow (usage...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://hibernate.org/reactive/releases/2.0/#getting_started">Hibernate Reactive 2.0.0.CR1</a> is now available!</p>
</div>
<div class="paragraph">
<p>Hibernate Reactive is finally compatible with Hibernate ORM 6.2 and Vert.x 4.4.</p>
</div>
<div class="paragraph">
<p>We will follow up with some more details, but if you want to check it, this is a good place to start.</p>
</div>
<div class="paragraph">
<p>Migrating from Hibernate ORM 5 to 6 was not an easy task, and would have not be possible without
everybody’s help.</p>
</div>
<div class="paragraph">
<p>Thanks a lot!</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-can-i-get-it"><a class="anchor" href="#how-can-i-get-it" />How can I get it?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available on the
<a href="https://hibernate.org/reactive/releases/1.1/#get-it">Hibernate Reactive website releases page</a>.</p>
</div>
<div class="paragraph">
<p>If you are new to Hibernate Reactive, <a href="http://hibernate.org/reactive/documentation/2.0/reference/html_single/#getting-started">the official documentation</a> is a good place to start.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-reactive"><strong>hibernate-reactive</strong> tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-reactive">User forum</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/132096-hibernate-user"><strong>hibernate-user</strong> stream on Zulip</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://github.com/hibernate/hibernate-reactive/issues">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> or the <a href="https://hibernate.zulipchat.com/#narrow/stream/205413-hibernate-reactive-dev"><strong>hibernate-reactive-dev</strong> stream on Zulip</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/04/14/hibernate-orm-621-final/Hibernate ORM 6.2.1.Final released2024-03-22T12:27:07+00:002023-04-14T00:00:00+00:00Marco Belladelli
Today, we published a new maintenance release of Hibernate ORM 6.2: 6.2.1.Final.
What’s new
This release includes several bug fixes and small performance improvements.
Bugfixes
Sub-queries using aliases and left joins
We have improved the resolution of tables in sub-queries, especially in cases where the same alias was also used in the parent query. This change also fixed a bug that caused left-joins in sub-queries to be wrongly translated (see HHH-16414).
Batching
We have fixed a few issues related to batching:
a parameter binding error was thrown when using DynamicUpdate or DynamicInserts with batching enabled (see HHH-16352).
an OptimisticLockException was thrown when an entity having a Version attribute and...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Today, we published a new maintenance release of Hibernate ORM 6.2: 6.2.1.Final.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This release includes several bug fixes and small performance improvements.</p>
</div>
<div class="sect2">
<h3 id="bugfixes"><a class="anchor" href="#bugfixes" />Bugfixes</h3>
<div class="sect3">
<h4 id="sub-queries-using-aliases-and-left-joins"><a class="anchor" href="#sub-queries-using-aliases-and-left-joins" />Sub-queries using aliases and left joins</h4>
<div class="paragraph">
<p>We have improved the resolution of tables in sub-queries, especially in cases where the same alias was also used in the parent query. This change also fixed a bug that caused left-joins in sub-queries to be wrongly translated (see <a href="https://hibernate.atlassian.net/browse/HHH-16414">HHH-16414</a>).</p>
</div>
</div>
<div class="sect3">
<h4 id="batching"><a class="anchor" href="#batching" />Batching</h4>
<div class="paragraph">
<p>We have fixed a few issues related to batching:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>a parameter binding error was thrown when using <code>DynamicUpdate</code> or <code>DynamicInserts</code> with batching enabled (see <a href="https://hibernate.atlassian.net/browse/HHH-16352">HHH-16352</a>).</p>
</li>
<li>
<p>an <code>OptimisticLockException</code> was thrown when an entity having a <code>Version</code> attribute and a dirty collection was updated with statement batching enabled (see <a href="https://hibernate.atlassian.net/browse/HHH-15778">HHH-15778</a>).</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>You can expect more improvements related to batching in the following Hibernate releases.</p>
</div>
</div>
<div class="sect3">
<h4 id="bytecode-enhancement-and-dirty-checking"><a class="anchor" href="#bytecode-enhancement-and-dirty-checking" />Bytecode enhancement and dirty checking</h4>
<div class="paragraph">
<p>We have fixed a bug causing generic associations to be ignored when dirty checking and bytecode enhancement were enabled (see <a href="https://hibernate.atlassian.net/browse/HHH-16459">HHH-16459</a>).</p>
</div>
</div>
<div class="sect3">
<h4 id="composite-primary-key-querying"><a class="anchor" href="#composite-primary-key-querying" />Composite primary key querying</h4>
<div class="paragraph">
<p>We have fixed a bug causing part of a composite <code>@IdClass</code> primary key not to be returned when querying (see <a href="https://hibernate.atlassian.net/browse/HHH-16387">HHH-16387</a>).</p>
</div>
</div>
<div class="sect3">
<h4 id="internal-nullness-marking-and-checking"><a class="anchor" href="#internal-nullness-marking-and-checking" />Internal nullness marking and checking</h4>
<div class="paragraph">
<p>We started the internal process of reviewing the code base and adding nullness annotations which will be automatically verified thanks to the <a href="https://checkerframework.org/">Checker Framework</a> (see <a href="https://hibernate.atlassian.net/browse/HHH-16389">HHH-16389</a>).</p>
</div>
<div class="paragraph">
<p>You can find the full list of changes in this version <a href="https://hibernate.atlassian.net/issues?jql=project=10031+AND+fixVersion=32147">here</a>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="conclusion"><a class="anchor" href="#conclusion" />Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.2/">release page</a>.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the usual channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://stackoverflow.com/questions/tagged/hibernate"><strong>hibernate</strong> tag on Stack Overflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-orm">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HHH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/03/30/orm-62-final/Hibernate 6.2 Final2024-03-22T12:27:07+00:002023-03-30T00:00:00+00:00Steve Ebersole
Hibernate ORM 6.2.0 Final has just been released.
In many ways, this release marks the final step for the major forcus of 6.x centered around changing how Hibernate generates SQL. Many improvements
in this release, as well as 6.0 and 6.1, have been implemented on top of this SQL AST work. As of 6.0 and 6.1, Hibernate used this SQL AST for loading
state from the database. With 6.2, Hibernate also uses SQL AST for writing to the database.
Support for Structured SQL Types
Hibernate now supports structured SQL types including struct, XML and JSON. Christian wrote a blog post
about this...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate ORM 6.2.0 Final has just been <a href="https://hibernate.atlassian.net/projects/HHH/versions/32144">released</a>.</p>
</div>
<div class="paragraph">
<p>In many ways, this release marks the final step for the major forcus of 6.x centered around changing how Hibernate generates SQL. Many improvements
in this release, as well as 6.0 and 6.1, have been implemented on top of this SQL AST work. As of 6.0 and 6.1, Hibernate used this SQL AST for loading
state from the database. With 6.2, Hibernate also uses SQL AST for writing to the database.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="structured-sql-types"><a class="anchor" href="#structured-sql-types" />Support for Structured SQL Types</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate now supports structured SQL types including struct, XML and JSON. Christian wrote a <a href="https://in.relation.to/2023/02/13/hibernate-orm-62-composite-aggregates/">blog post</a>
about this support which covers the details. See also the <a href="https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html#embeddable-mapping-aggregate">Aggregate embeddable mapping</a> and
<a href="https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html#_struct_aggregate_embeddable_mapping">@Struct aggregate embeddable mapping</a> User Guide sections.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="support-for-java-records"><a class="anchor" href="#support-for-java-records" />Support for Java records</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate now support the mapping of Java records as embeddables. E.g.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@Embeddable</span>
<span style="color:#088;font-weight:bold">public</span> record <span style="color:#0a8;font-weight:bold">Name</span>(
<span style="color:#0a8;font-weight:bold">String</span> firstName;
<span style="color:#0a8;font-weight:bold">String</span> lastName;
) {}</code></pre>
</div>
</div>
<div class="paragraph">
<p>even combined with <a href="#structured-sql-types">Support for Structured SQL Types</a> to persist to a struct!</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@Embeddable</span>
<span style="color:#007">@Struct</span>(name = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">Name</span><span style="color:#710">"</span></span>)
<span style="color:#088;font-weight:bold">public</span> record <span style="color:#0a8;font-weight:bold">Name</span>(
<span style="color:#0a8;font-weight:bold">String</span> firstName;
<span style="color:#0a8;font-weight:bold">String</span> lastName;
) {}</code></pre>
</div>
</div>
<div class="paragraph">
<p>See the <a href="https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html#_struct_aggregate_embeddable_mapping">@Struct aggregate embeddable mapping</a> User Guide section for more details.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="generated"><a class="anchor" href="#generated" />Unified generated value support</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Support for generated persisted values has been has been unified to use the same contracts, whether for identifiers or other basic values,
based on <code>org.hibernate.annotations.Generated</code>, <code>org.hibernate.annotations.ValueGenerationType</code> and <code>org.hibernate.generator.Generator</code>. E.g.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@Generated</span>( GenerationTime.INSERT )
<span style="color:#007">@ColumnDefault</span>( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">CURRENT_TIMESTAMP</span><span style="color:#710">"</span></span> )
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">Date</span> createdDate;</code></pre>
</div>
</div>
<div class="paragraph">
<p>or</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@Retention</span>(<span style="color:#0a8;font-weight:bold">RetentionPolicy</span>.RUNTIME)
<span style="color:#007">@Target</span>( { <span style="color:#0a8;font-weight:bold">ElementType</span>.FIELD, <span style="color:#0a8;font-weight:bold">ElementType</span>.METHOD, <span style="color:#0a8;font-weight:bold">ElementType</span>.ANNOTATION_TYPE } )
<span style="color:#007">@ValueGenerationType</span>( generatedBy = UuidValueGeneration.class )
<span style="color:#088;font-weight:bold">public</span> <span style="color:#007">@interface</span> GeneratedUuidValue {
GenerationTiming timing();
}
<span style="color:#088;font-weight:bold">public</span> <span style="color:#088;font-weight:bold">static</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">UuidValueGeneration</span> <span style="color:#088;font-weight:bold">implements</span> BeforeExecutionGenerator {...}
...
<span style="color:#007">@GeneratedUuidValue</span>( timing = GenerationTiming.INSERT )
<span style="color:#088;font-weight:bold">public</span> <span style="color:#0a8;font-weight:bold">UUID</span> createdUuid;</code></pre>
</div>
</div>
<div class="paragraph">
<p>See the <a href="https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html#mapping-generated">Generated properties</a> User Guide section for details.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="partitions"><a class="anchor" href="#partitions" />Database Partitions</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate now supports <a href="https://en.wikipedia.org/wiki/Partition_(database)">database partitions</a> as a first-class citizen using <code>org.hibernate.annotations.PartitionKey</code> to map the parition column. E.g.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@Entity</span>
<span style="color:#088;font-weight:bold">public</span> <span style="color:#088;font-weight:bold">static</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">User</span> {
<span style="color:#007">@Id</span> <span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">Integer</span> id;
...
<span style="color:#007">@PartitionKey</span> <span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">String</span> region;
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>See the <a href="https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html#partitioning">Paritioning</a> User Guide section for details.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="merge"><a class="anchor" href="#merge" />SQL MERGE for "optional table" updates</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Building on top of the SQL AST, Hibernate can now use the SQL <code>MERGE</code> command to handle updates against optional tables.</p>
</div>
<div class="paragraph">
<p>An update to an optional table will have one of 3 ultimate outcomes:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>if there is no corresponding row already in the table, insert the row</p>
</li>
<li>
<p>else if all the new "value" columns are null, delete the row</p>
</li>
<li>
<p>else update the row</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>The legacy behavior was to just do these if-checks ourselves at runtime and execute the insert, update and delete statements individually.
The <code>MERGE</code> command allows that to happen more efficiently in a single JDBC call.</p>
</div>
<div class="paragraph">
<p>Currently this is supported on:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HHH-16084">H2</a></p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HHH-16101">Oracle</a></p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HHH-16103">SQL Server</a></p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HHH-16110">PostgreSQL</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The fall back is to just use the legacy behavior.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="jdbc-type"><a class="anchor" href="#jdbc-type" />Proprietary SQL types</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Dealing with certain SQL types requires access to JDBC driver specific classes in
order to properly read and write values of that type. In some environments (various
containers, e.g.), those classes are not available to Hibernate.</p>
</div>
<div class="paragraph">
<p>Hibernate better handles these situations now when it can, usually based on casts to more standardized types. For example,
we might read a JSON value from a ResultSet as a String by wrapping the JSON expression in a cast function.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="community"><a class="anchor" href="#community" />Community</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.2/">release page</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/incubating/incubating.txt">incubating report</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/deprecated/deprecated.txt">deprecation report</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/internals/internal.txt">internals report</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/community/compatibility-policy/">compatibility policy</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>See the <a href="https://hibernate.org/community/">website</a> for getting in touch with us.</p>
</div>
</div>
</div>
https://in.relation.to/2023/03/17/orm-62-cr4/Hibernate 6.2 CR42024-03-22T12:27:07+00:002023-03-17T00:00:00+00:00Steve Ebersole
Hibernate ORM 6.2.0.CR4 has just been released. It contains 61 resolutions, including 33 bug-fixes. Many of these improvements come directly from the excellent feedback and bug reports we continue to get from the community. Thank you again for the continued support and feedback!
What’s next?
I fully expect this to be the final CR before Final. Hibernate Reactive has started to stabilize on the road to 2.0, so
additional SPI changes are less and less likely.
Community
For additional details, see:
the User Guide
the Migration Guide
the release page
the incubating report
the deprecation report
the internals report
the compatibility policy
See the website for getting in touch...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate ORM 6.2.0.CR4 has just been <a href="https://hibernate.atlassian.net/projects/HHH/versions/32142">released</a>. It contains 61 resolutions, including 33 bug-fixes. Many of these improvements come directly from the excellent feedback and bug reports we continue to get from the community. Thank you again for the continued support and feedback!</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-next"><a class="anchor" href="#whats-next" />What’s next?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>I fully expect this to be the final CR before Final. <a href="https://hibernate.org/reactive/">Hibernate Reactive</a> has started to stabilize on the road to 2.0, so
additional SPI changes are less and less likely.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="community"><a class="anchor" href="#community" />Community</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.2/">release page</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/incubating/incubating.txt">incubating report</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/deprecated/deprecated.txt">deprecation report</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/internals/internal.txt">internals report</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/community/compatibility-policy/">compatibility policy</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>See the <a href="https://hibernate.org/community/">website</a> for getting in touch with us.</p>
</div>
</div>
</div>
https://in.relation.to/2023/03/01/orm-62-cr3/Hibernate 6.2 CR32024-03-22T12:27:07+00:002023-03-01T00:00:00+00:00Steve Ebersole
Hibernate ORM 6.2.0.CR3 has just been released. It contains 64 resolutions, including 37 bug-fixes. Many of these improvements come directly from the excellent feedback and bug reports we continue to get from the community. Thank you again for the continued support and feedback!
What’s next?
We will hold releasing a Final until a few integration contracts stabilize, especially as Hibernate Reactive makes a push to 2.0. That is expected to be very short term.
Community
For additional details, see:
the User Guide
the Migration Guide
the release page
the incubating report
the deprecation report
the internals report
the compatibility policy
See the website for getting in touch with...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate ORM 6.2.0.CR3 has just been released. It contains 64 resolutions, including 37 bug-fixes. Many of these improvements come directly from the excellent feedback and bug reports we continue to get from the community. Thank you again for the continued support and feedback!</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-next"><a class="anchor" href="#whats-next" />What’s next?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>We will hold releasing a <code>Final</code> until a few integration contracts stabilize, especially as <a href="https://hibernate.org/reactive/">Hibernate Reactive</a> makes a push to 2.0. That is expected to be very short term.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="community"><a class="anchor" href="#community" />Community</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.2/">release page</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/incubating/incubating.txt">incubating report</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/deprecated/deprecated.txt">deprecation report</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.2/internals/internal.txt">internals report</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/community/compatibility-policy/">compatibility policy</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>See the <a href="https://hibernate.org/community/">website</a> for getting in touch with us.</p>
</div>
</div>
</div>
https://in.relation.to/2023/02/20/hibernate-orm-62-ctes/Hibernate ORM 6.2 - CTE support2024-03-22T12:27:06+00:002023-02-20T00:00:00+00:00Christian Beikov
Hibernate ORM version 6.2.0.Final is around the corner, and the following post tries to shed some light
on one of the new features that comes with that release.
With clause
The with clause was introduced in SQL:1999
and allows to specify common table expressions (CTEs), which can be imagined like named subqueries.
Every uncorrelated subquery can be factored to a CTE in the with clause. The semantics are equivalent.
The with clause offers features beyond naming subqueries though:
Specify materialization hints
Recursive querying
The most important part of CTEs is the support for recursive querying that allows to query hierarchies or graphs of data.
Hibernate chose to support the same...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate ORM version <code>6.2.0.Final</code> is around the corner, and the following post tries to shed some light
on one of the new features that comes with that release.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="with-clause"><a class="anchor" href="#with-clause" />With clause</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <code>with</code> clause was <a href="https://en.wikipedia.org/wiki/Hierarchical_and_recursive_queries_in_SQL">introduced in SQL:1999</a>
and allows to specify <em>common table expressions (CTEs)</em>, which can be imagined like named subqueries.
Every uncorrelated subquery can be factored to a CTE in the <code>with</code> clause. The semantics are equivalent.</p>
</div>
<div class="paragraph">
<p>The <code>with</code> clause offers features beyond naming subqueries though:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Specify materialization hints</p>
</li>
<li>
<p>Recursive querying</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The most important part of CTEs is the support for recursive querying that allows to query hierarchies or graphs of data.</p>
</div>
<div class="paragraph">
<p>Hibernate chose to support the same syntax as the SQL standard, though there are some differences:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>No need for the <code>recursive</code> keyword - Hibernate infers that information</p>
</li>
<li>
<p>Specifying cte attribute names has to be done through select item aliases. Names in the CTE header are not allowed</p>
</li>
</ul>
</div>
<div class="exampleblock">
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="antlrv4">queryExpression
: withClause? orderedQuery (setOperator orderedQuery)*
;
withClause
: "WITH" cte ("," cte)*
;
cte
: identifier AS ("NOT"? "MATERIALIZED")? "(" queryExpression ")" searchClause? cycleClause?
;</code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="materialization-hint"><a class="anchor" href="#materialization-hint" />Materialization hint</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The materialization hint <code>MATERIALIZED</code> or <code>NOT MATERIALIZED</code> can be applied to tell the DBMS whether a CTE should
or shouldn’t be materialized. Consult the database manual of the respective database for the exact meaning of the hint.</p>
</div>
<div class="paragraph">
<p>Usually, one can expect that <code>MATERIALIZED</code> will cause the subquery to be executed separately and saved into a temporary table,
whereas <code>NOT MATERIALIZED</code> will cause the subquery to be inlined into every use site and considered during optimizations separately.</p>
</div>
<div id="hql-cte-materialized-example" class="exampleblock">
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="SQL">with data <span style="color:#080;font-weight:bold">as</span> materialized(
<span style="color:#B06;font-weight:bold">select</span> p.person <span style="color:#080;font-weight:bold">as</span> owner, c.payment <span style="color:#080;font-weight:bold">is</span> <span style="color:#080;font-weight:bold">not</span> <span style="color:#069">null</span> <span style="color:#080;font-weight:bold">as</span> payed
<span style="color:#080;font-weight:bold">from</span> Call c
<span style="color:#080;font-weight:bold">join</span> c.phone p
<span style="color:#080;font-weight:bold">where</span> p.number = :phoneNumber
)
<span style="color:#B06;font-weight:bold">select</span> d.owner, d.payed
<span style="color:#080;font-weight:bold">from</span> data d</code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="recursive-querying"><a class="anchor" href="#recursive-querying" />Recursive querying</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The main use case for the <code>with</code> clause is to define a name for a subquery,
such that this subquery can refer to itself, which ultimately enables recursive querying.</p>
</div>
<div class="paragraph">
<p>Recursive CTEs must follow a very particular shape, which is</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Base query part</p>
</li>
<li>
<p><code>union</code> or <code>union all</code></p>
</li>
<li>
<p>Recursive query part</p>
</li>
</ul>
</div>
<div id="hql-cte-recursive-example" class="exampleblock">
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="SQL">with paymentConnectedPersons <span style="color:#080;font-weight:bold">as</span>(
<span style="color:#777">-- Base query part</span>
<span style="color:#B06;font-weight:bold">select</span> a.owner owner
<span style="color:#080;font-weight:bold">from</span> Account a <span style="color:#080;font-weight:bold">where</span> a.id = :startId
<span style="color:#777">-- union or union all</span>
<span style="color:#080;font-weight:bold">union</span> <span style="color:#080;font-weight:bold">all</span>
<span style="color:#777">-- Recursive query part</span>
<span style="color:#B06;font-weight:bold">select</span> a2.owner owner
<span style="color:#080;font-weight:bold">from</span> paymentConnectedPersons d
<span style="color:#080;font-weight:bold">join</span> Account a <span style="color:#080;font-weight:bold">on</span> a.owner = d.owner
<span style="color:#080;font-weight:bold">join</span> a.payments p
<span style="color:#080;font-weight:bold">join</span> Account a2 <span style="color:#080;font-weight:bold">on</span> a2.owner = p.person
)
<span style="color:#B06;font-weight:bold">select</span> d.owner
<span style="color:#080;font-weight:bold">from</span> paymentConnectedPersons d</code></pre>
</div>
</div>
</div>
</div>
<div class="paragraph">
<p>The base query part represents the initial set of rows. When fetching a tree of data,
the base query part usually is the tree root.</p>
</div>
<div class="paragraph">
<p>The recursive query part is executed again and again until it produces no new rows.
The result of such a CTE is the base query part result <em>unioned</em> together with all recursive query part executions.
Depending on whether <code>union all</code> or <code>union</code> (<code>distinct</code>) is used, duplicate rows are preserved or not.</p>
</div>
<div class="paragraph">
<p>Recursive queries additionally can have</p>
</div>
<div class="ulist">
<ul>
<li>
<p>a <code>search</code> clause to hint the DBMS whether to use breadth or depth first searching</p>
</li>
<li>
<p>a <code>cycle</code> clause to hint the DBMS how to determine that a cycle was reached</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Defining the <code>search</code> clause requires specifying a name for an attribute in the <code>set</code> sub-clause,
that will be added to the CTE type and allows ordering results according to the search order.</p>
</div>
<div id="hql-cte-recursive-search-bnf-example" class="exampleblock">
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="antlrv4">searchClause
: "SEARCH" ("BREADTH"|"DEPTH") "FIRST BY" searchSpecifications "SET" identifier
;
searchSpecifications
: searchSpecification ("," searchSpecification)*
;
searchSpecification
: identifier sortDirection? nullsPrecedence?
;</code></pre>
</div>
</div>
</div>
</div>
<div class="paragraph">
<p>A DBMS has two possible orders when executing the recursive query part</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Depth first - handle the <strong>newest</strong> produced rows by the recursive query part first</p>
</li>
<li>
<p>Breadth first - handle the <strong>oldest</strong> produced rows by the recursive query part first</p>
</li>
</ul>
</div>
<div id="hql-cte-recursive-search-example" class="exampleblock">
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="SQL">with paymentConnectedPersons <span style="color:#080;font-weight:bold">as</span>(
<span style="color:#B06;font-weight:bold">select</span> a.owner owner
<span style="color:#080;font-weight:bold">from</span> Account a <span style="color:#080;font-weight:bold">where</span> a.id = :startId
<span style="color:#080;font-weight:bold">union</span> <span style="color:#080;font-weight:bold">all</span>
<span style="color:#B06;font-weight:bold">select</span> a2.owner owner
<span style="color:#080;font-weight:bold">from</span> paymentConnectedPersons d
<span style="color:#080;font-weight:bold">join</span> Account a <span style="color:#080;font-weight:bold">on</span> a.owner = d.owner
<span style="color:#080;font-weight:bold">join</span> a.payments p
<span style="color:#080;font-weight:bold">join</span> Account a2 <span style="color:#080;font-weight:bold">on</span> a2.owner = p.person
) search breadth first <span style="color:#080;font-weight:bold">by</span> owner <span style="color:#B06;font-weight:bold">set</span> orderAttr
<span style="color:#B06;font-weight:bold">select</span> d.owner
<span style="color:#080;font-weight:bold">from</span> paymentConnectedPersons d</code></pre>
</div>
</div>
</div>
</div>
<div class="paragraph">
<p>Recursive processing can lead to cycles which might lead to queries executing forever.
The <code>cycle</code> clause hints the DBMS which CTE attributes to track for the cycle detection.
It requires specifying a name for a cycle mark attribute in the <code>set</code> sub-clause,
that will be added to the CTE type and allows detecting if a cycle occurred for a result.</p>
</div>
<div class="paragraph">
<p>By default, the cycle mark attribute will be set to <code>true</code> when a cycle is detected and <code>false</code> otherwise.
The values to use can be explicitly specified through the <code>to</code> and <code>default</code> sub-clauses.
Optionally, it’s also possible to specify a cycle path attribute name through the <code>using</code> clause
The cycle path attribute can be used to understand the traversal path that lead to a result.</p>
</div>
<div id="hql-cte-recursive-cycle-bnf-example" class="exampleblock">
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="antlrv4">cycleClause
: "CYCLE" cteAttributes "SET" identifier ("TO" literal "DEFAULT" literal)? ("USING" identifier)?
;</code></pre>
</div>
</div>
</div>
</div>
<div id="hql-cte-recursive-cycle-example" class="exampleblock">
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="SQL">with paymentConnectedPersons <span style="color:#080;font-weight:bold">as</span>(
<span style="color:#B06;font-weight:bold">select</span> a.owner owner
<span style="color:#080;font-weight:bold">from</span> Account a <span style="color:#080;font-weight:bold">where</span> a.id = :startId
<span style="color:#080;font-weight:bold">union</span> <span style="color:#080;font-weight:bold">all</span>
<span style="color:#B06;font-weight:bold">select</span> a2.owner owner
<span style="color:#080;font-weight:bold">from</span> paymentConnectedPersons d
<span style="color:#080;font-weight:bold">join</span> Account a <span style="color:#080;font-weight:bold">on</span> a.owner = d.owner
<span style="color:#080;font-weight:bold">join</span> a.payments p
<span style="color:#080;font-weight:bold">join</span> Account a2 <span style="color:#080;font-weight:bold">on</span> a2.owner = p.person
) cycle owner <span style="color:#B06;font-weight:bold">set</span> cycleMark
<span style="color:#B06;font-weight:bold">select</span> d.owner, d.cycleMark
<span style="color:#080;font-weight:bold">from</span> paymentConnectedPersons d</code></pre>
</div>
</div>
</div>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important" />
</td>
<td class="content">
<div class="paragraph">
<p>Hibernate merely translates recursive CTEs but doesn’t attempt to emulate the feature.
Therefore, this feature will only work if the database supports recursive CTEs.
Hibernate does emulate the <code>search</code> and <code>cycle</code> clauses though if necessary, so you can safely use that.</p>
</div>
<div class="paragraph">
<p>Note that most modern database versions support recursive CTEs already.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="outlook"><a class="anchor" href="#outlook" />Outlook</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This was a long awaited feature as you can tell from the issue number <a href="https://hibernate.atlassian.net/browse/HHH-4030">HHH-4030</a>,
so it’s great that Hibernate finally supports the with clause.</p>
</div>
<div class="paragraph">
<p>You might think that we are already done with this, but there is still a nice little addition to recursive querying that can be made.
We are currently discussing <a href="https://github.com/hibernate/hibernate-orm/discussions/6100">support for a <code>recursive join fetch</code></a>
feature which would make fetching data trees a lot simpler. If you have demand for it, let us know and join the discussion!</p>
</div>
</div>
</div>
https://in.relation.to/2023/02/15/hibernate-orm-62-db-version-support/Hibernate ORM 6.2 - DB version support2024-03-22T12:27:06+00:002023-02-15T00:00:00+00:00Christian Beikov
Hibernate ORM version 6.2.0.Final is around the corner, and the following post tries to shed some light
on one of the new features that comes with that release.
Supported database versions
For a long time, Hibernate kept around code for supporting database versions that are now considered ancient.
It wasn’t always clear what the minimum database version is that is supposed to be supported and there was no continuous testing
against old or the latest version of a database. The Hibernate team tried to support database versions on a best effort basis.
With Hibernate 6.0 the team wanted to do better and by making sure we...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate ORM version <code>6.2.0.Final</code> is around the corner, and the following post tries to shed some light
on one of the new features that comes with that release.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="supported-database-versions"><a class="anchor" href="#supported-database-versions" />Supported database versions</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For a long time, Hibernate kept around code for supporting database versions that are now considered ancient.
It wasn’t always clear what the minimum database version is that is supposed to be supported and there was no continuous testing
against old or the latest version of a database. The Hibernate team tried to support database versions on a best effort basis.</p>
</div>
<div class="paragraph">
<p>With Hibernate 6.0 the team wanted to do better and by making sure we commit ourselves to a <a href="https://github.com/hibernate/hibernate-orm/blob/main/dialects.adoc#supported-dialects">certain set of DBs</a>,
and move dialects for other DBs into a <a href="https://github.com/hibernate/hibernate-orm/blob/main/dialects.adoc#community-dialects">new module</a>, called <code>hibernate-community-dialects</code>.
We provided clear requirements for vendors on <a href="https://github.com/hibernate/hibernate-orm/blob/main/dialects.adoc#requirements-for-moving-to-hibernate-core">how to get their dialects to <code>hibernate-core</code></a>.</p>
</div>
<div class="paragraph">
<p>Another thing that changed with Hibernate 6.0 is that dialects can now self-configure based on the database version,
which eliminated the need for the various version specific dialects. There was still some overhead for dialect
maintenance due to code that was trying to emulate certain functions or SQL constructs for ancient database versions.
Since the Hibernate team is relatively <a href="https://github.com/hibernate/hibernate-orm/wiki/Huge-Project,-Small-Team">small when considering the size of the project</a>,
we decided to clarify the supported set of databases in version 6.2 by also specifying versions which are supported.
Doing so will make it easily understandable for users what Hibernate supports and what not.
Additionally, it allows us to get rid of some code which makes maintenance easier.</p>
</div>
<div class="paragraph">
<p>As of version 6.2, every dialect will have a "minimum supported version" attached, and during self-configuration
of the dialect, it will check if the database version is greater or equal to that. If it isn’t, Hibernate emits a warning.
Dialects that support even older database versions were moved to the <code>hibernate-community-dialects</code> module
and are only updated on a best effort basis.</p>
</div>
<div class="paragraph">
<p>In general, Hibernate ties its database version support to the support cycle of the respective vendor.
Minor versions of Hibernate might drop support for database versions that have become unsupported.
The list of version support changes for Hibernate 6.2 can be nicely seen on <a href="https://hibernate.atlassian.net/browse/HHH-15175">HHH-15175</a></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="outlook"><a class="anchor" href="#outlook" />Outlook</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate 6.3 will be the next minor version and as part of that, support for some more database versions will be dropped.
The list of planned version support changes can be seen on <a href="https://hibernate.atlassian.net/browse/HHH-15491">HHH-15491</a>.</p>
</div>
<div class="paragraph">
<p>I hope that this insight into the process of database version support is not a shocker to anyone.
For the few people to which this is bad news, maybe this article helps you to justify a more continuous version upgrade.</p>
</div>
</div>
</div>
https://in.relation.to/2023/02/14/hibernate-search-6-2-0-Alpha2/Hibernate Search 6.2.0.Alpha2 is out2024-03-22T12:27:07+00:002023-02-14T00:00:00+00:00Yoann Rodière
We just published Hibernate Search 6.2.0.Alpha2,
an alpha release of the next minor version of Hibernate Search.
This version brings simpler and/or/not predicates,
mass indexing for multiple tenants,
and a switch to UUIDs for identifiers in the outbox-polling coordination strategy.
6.2.0.Alpha2 also includes many bugfixes and improvements,
compatibility with Elasticsearch 8.6 and OpenSearch 2.5,
an upgrade of -orm6 artifacts to Hibernate ORM 6.2.0.CR2,
and more.
Thanks
Thanks to Yannis Bres for his work on AND/OR predicates.
What’s new
Hibernate Search 6.2 is still in development:
some features are still incomplete or may change in a backward-incompatible way.
Dependency upgrades
Hibernate ORM (HSEARCH-4747/HSEARCH-4791)
Hibernate Search now depends on Hibernate ORM 5.6.14.Final,
or Hibernate ORM 6.2.0.CR2 for -orm6 artifacts.
Elasticsearch...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We just published Hibernate Search 6.2.0.Alpha2,
an alpha release of the next minor version of Hibernate Search.</p>
</div>
<div class="paragraph">
<p>This version brings simpler <code>and</code>/<code>or</code>/<code>not</code> predicates,
mass indexing for multiple tenants,
and a switch to UUIDs for identifiers in the <code>outbox-polling</code> coordination strategy.</p>
</div>
<div class="paragraph">
<p>6.2.0.Alpha2 also includes many bugfixes and improvements,
compatibility with Elasticsearch 8.6 and OpenSearch 2.5,
an upgrade of <code>-orm6</code> artifacts to Hibernate ORM 6.2.0.CR2,
and more.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="thanks"><a class="anchor" href="#thanks" />Thanks</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Thanks to <a href="https://github.com/YannisBres">Yannis Bres</a> for <a href="https://github.com/hibernate/hibernate-search/pull/3152">his work on AND/OR predicates</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
<div class="paragraph">
<p>Hibernate Search 6.2 is still in development:
some features are still incomplete or may change in a backward-incompatible way.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="dependency-upgrades"><a class="anchor" href="#dependency-upgrades" />Dependency upgrades</h3>
<div id="orm-version" class="dlist">
<dl>
<dt class="hdlist1">Hibernate ORM (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4747">HSEARCH-4747</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4791">HSEARCH-4791</a>)</dt>
<dd>
<p>Hibernate Search now depends on Hibernate ORM 5.6.14.Final,
or Hibernate ORM 6.2.0.CR2 for -orm6 artifacts.</p>
</dd>
</dl>
</div>
<div id="elasticsearch-version" class="dlist">
<dl>
<dt class="hdlist1">Elasticsearch (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4777">HSEARCH-4777</a>)</dt>
<dd>
<p>The Elasticsearch backend now works with Elasticsearch 8.6
as well as other versions that were already compatible.</p>
</dd>
</dl>
</div>
<div id="opensearch-version" class="dlist">
<dl>
<dt class="hdlist1">OpenSearch (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4790">HSEARCH-4790</a>)</dt>
<dd>
<p>The Elasticsearch backend now works with OpenSearch 2.5
as well as other versions that were already compatible.</p>
</dd>
</dl>
</div>
<div id="others-version" class="dlist">
<dl>
<dt class="hdlist1">Others</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4793">HSEARCH-4793</a>: Upgrade to Elasticsearch <strong>client</strong> 8.6.1</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4659">HSEARCH-4659</a>: Upgrade to Avro 1.11.1</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4660">HSEARCH-4660</a>: Upgrade to GSON 2.9.1</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4661">HSEARCH-4661</a>: Upgrade to JBeret 1.4.8.Final</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4697">HSEARCH-4697</a>: Upgrade to Jackson 2.13.4</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4739">HSEARCH-4739</a>: Upgrade to jackson-databind 2.13.4.2</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4694">HSEARCH-4694</a>: Compatibility with Jandex 3.0</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4798">HSEARCH-4798</a>: Upgrade to AWS SDK 2.20.2</p>
</li>
</ul>
</div>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="mapper-pojo-standalone"><a class="anchor" href="#mapper-pojo-standalone" />Standalone POJO Mapper</h3>
<div class="paragraph">
<p>The Standalone POJO Mapper enables mapping arbitrary POJOs to indexes, even without Hibernate ORM.
See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#mapper-pojo-standalone">this section of the reference documentation</a>
for more information,
or <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#mapper-pojo-standalone-getting-started">this getting started guide</a>.</p>
</div>
<div class="paragraph">
<p>In this release, there were several improvements to the configuration of the Standalone POJO mapper:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4615">HSEARCH-4615</a>:
More configuration is set simply through configuration properties.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4620">HSEARCH-4620</a>:
Indexing plan synchronization is now configured through strategies,
just like with the ORM mapper.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="mapping-projection"><a class="anchor" href="#mapping-projection" />Mapping index content to custom types (projection constructors)</h3>
<div class="paragraph">
<p>In a previous release, Hibernate Search 6.2 introduced the ability to define projections through the mapping of custom types (typically records),
by applying the <code>@ProjectionConstructor</code> annotation to those types or their constructor.
See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#mapping-projection">this section of the reference documentation</a>
for more information.</p>
</div>
<div class="paragraph">
<p>In this release, there were several improvements to the projection constructors:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4579">HSEARCH-4579</a>:
With the Standalone POJO Mapper, when searching on an entity type with no loading configured,
Hibernate Search will now attempt to use that entity type’s projection constructor if it exists.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4591">HSEARCH-4591</a>:
Object projections are now allowed on single-valued, flattened object fields with the Lucene backend.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4669">HSEARCH-4669</a>:
Hibernate Search will provide more information when a projection constructor cannot be applied to an index.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4673">HSEARCH-4673</a>:
The <code>-parameters</code> compiler flag is no longer necessary when using the default constructor of records as projection constructor.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="mapping-improvements"><a class="anchor" href="#mapping-improvements" />Mapping improvements</h3>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4714">HSEARCH-4714</a>:
Property names in the mapping, e.g. @IndexingDependency(derivedFrom = …),
will now be checked early to provide a clear error message in case of incorrect syntax.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4782">HSEARCH-4782</a>:
Hibernate Search will now infer a default decimal scale automatically for identifiers of Hibernate ORM entities;
previously it was only inferred for non-identifier properties.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="search-dsl-improvements"><a class="anchor" href="#search-dsl-improvements" />Search DSL improvements</h3>
<div id="predicate-and-or-not" class="dlist">
<dl>
<dt class="hdlist1">Simpler boolean operators with the <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-and"><code>and</code></a>/<a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-or"><code>or</code></a>/<a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-not"><code>not</code></a> predicates (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4601">HSEARCH-4601</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4645">HSEARCH-4645</a>)</dt>
<dd>
<p>For simpler use cases, you can now avoid the rather complex <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-boolean"><code>bool</code> predicate</a>
and use the new <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-and"><code>and</code></a>/<a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-or"><code>or</code></a>/<a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-not"><code>not</code></a>
predicates instead:</p>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f -> f.and(
f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">title</span><span style="color:#710">"</span></span> )
.matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">robot</span><span style="color:#710">"</span></span> ),
f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">description</span><span style="color:#710">"</span></span> )
.matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">crime</span><span style="color:#710">"</span></span> )
) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f -> f.or(
f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">title</span><span style="color:#710">"</span></span> )
.matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">robot</span><span style="color:#710">"</span></span> ),
f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">description</span><span style="color:#710">"</span></span> )
.matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">investigation</span><span style="color:#710">"</span></span> )
) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f -> f.not(
f.match()
.field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">genre</span><span style="color:#710">"</span></span> )
.matching( Genre.SCIENCE_FICTION )
) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
</dd>
</dl>
</div>
<div id="predicate-bool-new-syntax-root" class="dlist">
<dl>
<dt class="hdlist1">Simpler <code>and</code> predicate for <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-boolean-lambda"><code>where( (f, b) → … )</code></a> (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4676">HSEARCH-4676</a>)</dt>
<dd>
<p>Instead of a <code>bool</code> predicate` as in 6.2.0.Alpha1, <code>where( (f, b) → … )</code> now provides a simpler <code>and</code> predicate:</p>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA">MySearchParameters searchParameters = getSearchParameters();
<span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( (f, root) -> {
root.add( f.matchAll() );
<span style="color:#080;font-weight:bold">if</span> ( searchParameters.getGenreFilter() != <span style="color:#069">null</span> ) {
root.add( f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">genre</span><span style="color:#710">"</span></span> )
.matching( searchParameters.getGenreFilter() ) );
}
<span style="color:#080;font-weight:bold">if</span> ( searchParameters.getFullTextFilter() != <span style="color:#069">null</span> ) {
root.add( f.match().fields( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">title</span><span style="color:#710">"</span></span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">description</span><span style="color:#710">"</span></span> )
.matching( searchParameters.getFullTextFilter() ) );
}
<span style="color:#080;font-weight:bold">if</span> ( searchParameters.getPageCountMaxFilter() != <span style="color:#069">null</span> ) {
root.add( f.range().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">pageCount</span><span style="color:#710">"</span></span> )
.atMost( searchParameters.getPageCountMaxFilter() ) );
}
} )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
</dd>
</dl>
</div>
<div id="predicate-nested-new-syntax" class="dlist">
<dl>
<dt class="hdlist1">Simpler <code>and</code> predicate for the <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#search-dsl-predicate-nested"><code>nested</code> predicate</a> (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4676">HSEARCH-4676</a>)</dt>
<dd>
<p>Instead of a <code>bool</code> predicate` as in as in 6.2.0.Alpha1 6.2.0.Alpha1, <code>f.nested( … )</code> now provides a simpler <code>and</code> predicate:</p>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="JAVA"><span style="color:#0a8;font-weight:bold">List</span><<span style="color:#0a8;font-weight:bold">Book</span>> hits = searchSession.search( <span style="color:#0a8;font-weight:bold">Book</span>.class )
.where( f -> f.nested( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors</span><span style="color:#710">"</span></span> )
.add( f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors.firstName</span><span style="color:#710">"</span></span> )
.matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">isaac</span><span style="color:#710">"</span></span> ) )
.add( f.match().field( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">authors.lastName</span><span style="color:#710">"</span></span> )
.matching( <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">asimov</span><span style="color:#710">"</span></span> ) ) )
.fetchHits( <span style="color:#00D">20</span> );</code></pre>
</div>
</div>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="mass-indexing-improvements"><a class="anchor" href="#mass-indexing-improvements" />Mass indexing improvements</h3>
<div class="dlist">
<dl>
<dt class="hdlist1">Mass indexing multiple tenants (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4321">HSEARCH-4321</a>)</dt>
<dd>
<p>In multi-tenant applications, mass indexing can now handle multiple tenants at once,
provided you don’t pass any tenant identifier when creating the mass indexer,
and you provided a list of tenants in the Hibernate Search configuration.
See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#indexing-massindexer-multitenancy">this section of the reference documentation</a>
for more information.</p>
</dd>
<dt class="hdlist1">Setting up thread locals during mass indexing (<a href="https://hibernate.atlassian.net/browse/HSEARCH-1809">HSEARCH-1809</a>)</dt>
<dd>
<p>The mass indexer now has a concept of "mass indexing environment",
allowing for instance to set up custom thread locals in mass indexing threads.
See the <code>environment</code> parameter in <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#indexing-massindexer-parameters">this section of the reference documentation</a>
for more information.</p>
</dd>
<dt class="hdlist1">Better exception handling (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4541">HSEARCH-4541</a>)</dt>
<dd>
<p>Exceptions thrown by Hibernate ORM during mass indexing
are now passed to the failure handler as every other exception, instead of aborting the whole mass indexing.</p>
</dd>
<dt class="hdlist1">Smarter defaults for parameters (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4612">HSEARCH-4612</a>)</dt>
<dd>
<p><code>purgeAllOnStart</code> is now disabled by default in the mass indexer when <code>dropAndCreateSchemaOnStart</code> is enabled.</p>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="outbox-polling-improvements"><a class="anchor" href="#outbox-polling-improvements" /><code>outbox-polling</code> coordination improvements</h3>
<div class="dlist">
<dl>
<dt class="hdlist1">Outbox events and agents now use UUIDs for their identifiers (<a href="https://hibernate.atlassian.net/browse/HSEARCH-4678">HSEARCH-4678</a>/<a href="https://hibernate.atlassian.net/browse/HSEARCH-4748">HSEARCH-4748</a>)</dt>
<dd>
<p>The primary key of the relevant tables are now using UUIDs instead of longs,
to avoid reliance on sequences that were slowing down event processing on some databases.
The migration guide includes migration scripts for the necessary database schema changes.
See <a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#_custom_schematable_nameetc">this section of the reference documentation</a>
for more information.</p>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="other-changes"><a class="anchor" href="#other-changes" />Other improvements and bug fixes</h3>
<div class="ulist">
<ul>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4618">HSEARCH-4618</a>:
<code>BooleanPredicateOptionsCollector</code>/<code>SimpleBooleanPredicateClausesCollector</code> now expose a <code>hasClause()</code> method.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4294">HSEARCH-4294</a>:
The Search DSL now allows targeting "implicit" Elasticsearch fields such as <code>_index</code>.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4644">HSEARCH-4644</a>:
Hibernate Search is now tested regularly against CockroachDB.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4679">HSEARCH-4679</a>:
Hibernate Search will now automatically simplify boolean predicates with a single clause.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4305">HSEARCH-4305</a>, <a href="https://hibernate.atlassian.net/browse/HSEARCH-4708">HSEARCH-4708</a>:
Automatic reindexing will no longer be skipped when changing a property annotated with <code>@OneToOne(mappedBy = …) @IndexedEmbedded</code></p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4727">HSEARCH-4727</a>:
With <code>outbox-polling</code> coordination and when using DB2,
<code>OutboxEvent</code> table used to be created with a <code>payload</code> column with the wrong type <code>blob(255)</code>,
making it almost unusable. It is no longer the case.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4634">HSEARCH-4634</a>, <a href="https://hibernate.atlassian.net/browse/HSEARCH-4647">HSEARCH-4647</a>:
<code>outbox-polling</code> coordination now works with CockroachDB.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4652">HSEARCH-4652</a>:
Schema validation with the Elasticsearch backend will no longer fail
when setting <code>searchAnalyzer</code> to the same value as <code>analyzer</code> on a full-text field.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4654">HSEARCH-4654</a>:
Hibernate Search will no longer deadlock when experiencing a large number of concurrent failures
during startup or schema validation.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4701">HSEARCH-4701</a>:
When running Hibernate Search as a Java module (in the modulepath),
Elasticsearch schema management will no longer lead to exceptions
caused by missing inter-module dependencies.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4703">HSEARCH-4703</a>:
Fixed missing entries in the Java module descriptor of <code>hibernate-search-mapper-orm-coordination-outbox-polling</code>
leading to errors when running Hibernate Search in the modulepath.</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH-4724">HSEARCH-4724</a>:
Classpath scanning (for projection constructors in particular)
no longer ignores classes within Spring Boot’s "repackaged" JARs.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>And more. For a full list of changes since the previous releases,
please see the <a href="https://hibernate.atlassian.net/issues/?jql=project=10061+AND+fixVersion=32091">release notes</a>.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-get-this-release"><a class="anchor" href="#how-to-get-this-release" />How to get this release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>All details are available and up to date on the
<a href="https://hibernate.org/search/releases/6.2/#get-it">dedicated page on hibernate.org</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="getting-started-migrating"><a class="anchor" href="#getting-started-migrating" />Getting started, migrating</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For new applications,
refer to the getting started guide:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#mapper-orm-getting-started">here for the Hibernate ORM integration</a></p>
</li>
<li>
<p><a href="https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/#mapper-pojo-standalone-getting-started">here for the Standalone POJO Mapper</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For existing applications, Hibernate Search 6.2 is a drop-in replacement for 6.1,
assuming you also upgrade the dependencies.
Information about deprecated configuration and API
is included in the <a href="https://docs.jboss.org/hibernate/search/6.2/migration/html_single/">migration guide</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the following channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="http://stackoverflow.com/questions/tagged/hibernate-search">hibernate-search tag on Stackoverflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-search">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HSEARCH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>
https://in.relation.to/2023/02/13/hibernate-orm-62-composite-aggregates/Hibernate ORM 6.2 - Composite aggregate mappings2024-03-22T12:27:06+00:002023-02-13T00:00:00+00:00Christian Beikov
Hibernate ORM version 6.2.0.Final is around the corner, and the following post tries to shed some light
on one of the new features that comes with that release.
Composite SQL types
For a long time, SQL was fully relational and every data model had to be modeled as table with columns and constraints.
Then came the object relational hype and the SQL:1999 standard introduced support for structured types.
With the XML hype coming next, the SQL:2003 standard added support for XML
and in the SQL:2016 standard JSON support first appeared.
Structured or unstructured, composite types have their use cases,
so it was about time that Hibernate came up...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate ORM version <code>6.2.0.Final</code> is around the corner, and the following post tries to shed some light
on one of the new features that comes with that release.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="composite-sql-types"><a class="anchor" href="#composite-sql-types" />Composite SQL types</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For a long time, SQL was fully relational and every data model had to be modeled as table with columns and constraints.
Then came the object relational hype and the SQL:1999 standard introduced support for <a href="https://en.wikipedia.org/wiki/Structured_type">structured types</a>.
With the XML hype coming next, the SQL:2003 standard added support for <a href="https://en.wikipedia.org/wiki/SQL/XML">XML</a>
and in the SQL:2016 standard <a href="https://en.wikipedia.org/wiki/SQL:2016">JSON</a> support first appeared.</p>
</div>
<div class="paragraph">
<p>Structured or unstructured, composite types have their use cases,
so it was about time that Hibernate came up with an answer for these data types.</p>
</div>
<div class="paragraph">
<p>Values of these composite types provide access to their sub-parts and do not have identity like a row of a table.
In the realm of ORM, embeddable types have the same properties, so it is only natural to allow mapping to these SQL types.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="struct-mapping"><a class="anchor" href="#struct-mapping" />Struct mapping</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Mapping an embeddable to a named SQL object type, also known as structured type,
is now possible by annotating either the embeddable type or the <code>@Embedded</code> field/property with <code>@Struct(name = "…")</code>.</p>
</div>
<div class="paragraph">
<p>The hbm2ddl schema generation tool supports generating DDL to create and drop these structured types.
Since the order of structured type attributes is important and has to match the expectations of Hibernate,
users can compare the type definition until schema validation adds <a href="https://hibernate.atlassian.net/browse/HHH-16156">support for structured types</a> as well.</p>
</div>
<div class="paragraph">
<p>Considering this simple example mapping:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@Embeddable</span>
<span style="color:#007">@Struct</span>(name = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">my_point</span><span style="color:#710">"</span></span>)
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Point</span> {
<span style="color:#088;font-weight:bold">private</span> <span style="color:#339;font-weight:bold">int</span> x;
<span style="color:#088;font-weight:bold">private</span> <span style="color:#339;font-weight:bold">int</span> y;
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>will produce a schema similar to the following:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="sql"><span style="color:#B06;font-weight:bold">create</span> type my_point <span style="color:#080;font-weight:bold">as</span> (
x <span style="color:#0a8;font-weight:bold">int</span> <span style="color:#080;font-weight:bold">not</span> <span style="color:#069">null</span>,
y <span style="color:#0a8;font-weight:bold">int</span> <span style="color:#080;font-weight:bold">not</span> <span style="color:#069">null</span>
)</code></pre>
</div>
</div>
<div class="paragraph">
<p>The name and the nullability of the struct column can be refined through applying a <code>@Column</code> on the persistent attribute.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@Entity</span>
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">PointHolder</span> {
<span style="color:#007">@Id</span>
<span style="color:#088;font-weight:bold">private</span> <span style="color:#339;font-weight:bold">int</span> id;
<span style="color:#007">@Column</span>(name = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">the_point</span><span style="color:#710">"</span></span>, nullable = <span style="color:#069">false</span>)
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">Point</span> p;
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>which will emit a schema similar to this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="sql"><span style="color:#B06;font-weight:bold">create</span> <span style="color:#339;font-weight:bold">table</span> PointHolder <span style="color:#080;font-weight:bold">as</span> (
id <span style="color:#0a8;font-weight:bold">int</span> <span style="color:#080;font-weight:bold">not</span> <span style="color:#069">null</span> <span style="color:#088;font-weight:bold">primary</span> <span style="color:#339;font-weight:bold">key</span>,
the_point my_point <span style="color:#080;font-weight:bold">not</span> <span style="color:#069">null</span>
)</code></pre>
</div>
</div>
<div class="paragraph">
<p>Since the order of structured type attributes is vital, it is important to understand how to control the expectations of Hibernate.
There are essentially two possible ways to control the order:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Specifying the <code>attributes</code> member on the <code>@Struct</code> annotation to define the order</p>
</li>
<li>
<p>Using a Java record to implicitly specify the order through the canonical constructor</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The first option is pretty simple. If the desired order is <code>(y,x)</code>, then the <code>Point</code> embeddable type needs to declare that
by using <code>@Struct(name = "my_point", attributes = {"y", "x"})</code>.</p>
</div>
<div class="paragraph">
<p>The second option is more interesting as it makes use of another new feature that was introduced in Hibernate 6.2,
which is the support for Java records out of the box.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@Embeddable</span>
<span style="color:#007">@Struct</span>(name = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">my_point</span><span style="color:#710">"</span></span>)
<span style="color:#088;font-weight:bold">public</span> record <span style="color:#0a8;font-weight:bold">Point</span>(<span style="color:#339;font-weight:bold">int</span> y, <span style="color:#339;font-weight:bold">int</span> x) {}</code></pre>
</div>
</div>
<div class="paragraph">
<p>There is no need for the <code>@EmbeddableInstantiator</code> anymore for Java records,
because Hibernate now configures an appropriate instantiator automatically based on the canonical constructor.
The order of the record components in that canonical constructor then also represents the order in which Hibernate
expects the structured types attributes to be defined in.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
At the time of writing, structured type support is only implemented for Oracle, PostgreSQL and DB2.
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="xml-and-json-mapping"><a class="anchor" href="#xml-and-json-mapping" />XML and JSON mapping</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Since XML and JSON are predefined unstructured types, there is no type name or attribute order that has to be defined.
Mapping an embeddable as XML or JSON can be done by annotating the <code>@Embedded</code> field/property with <code>@JdbcTypeCode(SqlTypes.SQLXML)</code>
or <code>@JdbcTypeCode(SqlTypes.JSON)</code> respectively.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
At the time of writing, there is no database dialect for which XML support has been implemented,
so the following will focus on the JSON parts only, but apply the same way to XML support in the future.
</td>
</tr>
</table>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@Entity</span>
<span style="color:#088;font-weight:bold">public</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">JsonHolder</span> {
<span style="color:#007">@Id</span>
<span style="color:#088;font-weight:bold">private</span> <span style="color:#339;font-weight:bold">int</span> id;
<span style="color:#007">@JdbcTypeCode</span>(SqlTypes.JSON)
<span style="color:#007">@Column</span>(name = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">my_json</span><span style="color:#710">"</span></span>, nullable = <span style="color:#069">false</span>)
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">Point</span> point;
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>An entity with a mapping like this will roughly produce a schema like the following:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="sql"><span style="color:#B06;font-weight:bold">create</span> <span style="color:#339;font-weight:bold">table</span> JsonHolder <span style="color:#080;font-weight:bold">as</span> (
id <span style="color:#0a8;font-weight:bold">int</span> <span style="color:#080;font-weight:bold">not</span> <span style="color:#069">null</span> <span style="color:#088;font-weight:bold">primary</span> <span style="color:#339;font-weight:bold">key</span>,
my_json json <span style="color:#080;font-weight:bold">not</span> <span style="color:#069">null</span>,
<span style="color:#080;font-weight:bold">check</span> (json_value(my_json, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">$.x</span><span style="color:#710">'</span></span>) <span style="color:#080;font-weight:bold">is</span> <span style="color:#080;font-weight:bold">not</span> <span style="color:#069">null</span> <span style="color:#080;font-weight:bold">and</span> json_value(my_json, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">$.y</span><span style="color:#710">'</span></span>) <span style="color:#080;font-weight:bold">is</span> <span style="color:#080;font-weight:bold">not</span> <span style="color:#069">null</span>)
)</code></pre>
</div>
</div>
<div class="paragraph">
<p>As you can see, the table definition contains a check constraint that enforces the constraints of the embeddable type
within the JSON value by accessing the fields through the <code>json_value</code> function.</p>
</div>
<div class="paragraph">
<p>HQL queries that make use of embeddable attributes</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="sql"><span style="color:#B06;font-weight:bold">select</span> j.point.x, j.point.y
<span style="color:#080;font-weight:bold">from</span> JsonHolder j</code></pre>
</div>
</div>
<div class="paragraph">
<p>will resolve to the respective <code>json_value</code> expression:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="sql"><span style="color:#B06;font-weight:bold">select</span> json_value(j.point, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">$.x</span><span style="color:#710">'</span></span>), json_value(j.point, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">$.y</span><span style="color:#710">'</span></span>)
<span style="color:#080;font-weight:bold">from</span> JsonHolder j</code></pre>
</div>
</div>
<div class="paragraph">
<p>Similarly, assignment expressions will update the relevant part of the json document.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note" />
</td>
<td class="content">
At the time of writing, JSON support is only implemented for Oracle and PostgreSQL.
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="outlook"><a class="anchor" href="#outlook" />Outlook</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In upcoming releases we plan to add support for <a href="https://hibernate.atlassian.net/browse/HHH-16158">struct types on SQL Server</a>,
as well as support for other databases for the <a href="https://hibernate.atlassian.net/browse/HHH-16160">XML</a>
and <a href="https://hibernate.atlassian.net/browse/HHH-16159">JSON</a> mappings.
We will also try to lift restrictions on composite type mappings and enable the use of <a href="https://hibernate.atlassian.net/browse/HHH-16161">association mappings</a>
as well as <a href="https://hibernate.atlassian.net/browse/HHH-16162">array mappings</a>.</p>
</div>
<div class="paragraph">
<p>I hope you like the new features and can provide us feedback about this in the <a href="https://discourse.hibernate.org/">forum</a>
or on our <a href="https://hibernate.zulipchat.com/">chat platform</a>!</p>
</div>
</div>
</div>
https://in.relation.to/2023/02/08/hibernate-orm-62-partitioning/Hibernate ORM 6.2 - Partitioning support2024-03-22T12:27:06+00:002023-02-08T00:00:00+00:00Christian Beikov
Hibernate ORM version 6.2.0.Final is around the corner, and the following post tries to shed some light
on one of the new features that comes with that release.
Table partitioning
In data management, it is sometimes necessary to split data of a table into various (physical) partitions,
based on partition keys and a partitioning scheme.
Every database has a different way of defining the partitioning keys and scheme for a table,
but something that all of them have in common is the fact that the query planner needs to decide which partition to look into
for a query. Unless the database supports globally unique indexes on partitioned...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Hibernate ORM version <code>6.2.0.Final</code> is around the corner, and the following post tries to shed some light
on one of the new features that comes with that release.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="table-partitioning"><a class="anchor" href="#table-partitioning" />Table partitioning</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In data management, it is sometimes necessary to split data of a table into various (physical) partitions,
based on partition keys and a partitioning scheme.</p>
</div>
<div class="paragraph">
<p>Every database has a different way of defining the partitioning keys and scheme for a table,
but something that all of them have in common is the fact that the query planner needs to decide which partition to look into
for a query. Unless the database supports globally unique indexes on partitioned tables,
the query planner can’t know which partition it must target, and hence will have to plan to access every partition.
This unfortunately leads to poor query planning performance on the popular open source databases PostgreSQL and MySQL/MariaDB,
which support partitioning but not globally unique indexes on partitioned tables.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="partition-key-mapping"><a class="anchor" href="#partition-key-mapping" />Partition Key Mapping</h2>
<div class="sectionbody">
<div class="paragraph">
<p>After <a href="https://github.com/hibernate/hibernate-orm/discussions/5353">some discussions</a> about how this could be supported in Hibernate,
we went with a minimal approach first, to make sure we can help people improve their performance as soon as possible.</p>
</div>
<div class="paragraph">
<p>The minimal approach is to allow marking persistent attributes to be part of the partition key, by annotating <code>@PartitionKey</code>.
This has the effect that SQL update and delete statements, which are issued by Hibernate when flushing entity state changes,
will additionally restrict the partition key columns in <code>WHERE</code> clause predicate.</p>
</div>
<div class="paragraph">
<p>Consider the following entity model:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span style="color:#007">@Entity</span>
<span style="color:#007">@Table</span>(name = <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">user_tbl</span><span style="color:#710">"</span></span>)
<span style="color:#088;font-weight:bold">public</span> <span style="color:#088;font-weight:bold">static</span> <span style="color:#339;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">User</span> {
<span style="color:#007">@Id</span>
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">Long</span> id;
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">String</span> firstname;
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">String</span> lastname;
<span style="color:#007">@PartitionKey</span>
<span style="color:#088;font-weight:bold">private</span> <span style="color:#0a8;font-weight:bold">String</span> tenantKey;
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>When updating or deleting such an entity, Hibernate will now generate SQL similar to this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="sql"><span style="color:#B06;font-weight:bold">update</span> user_tbl <span style="color:#B06;font-weight:bold">set</span> firstname=<span style="color:#F00;background-color:#FAA">?</span>,lastname=<span style="color:#F00;background-color:#FAA">?</span>,tenantKey=<span style="color:#F00;background-color:#FAA">?</span> <span style="color:#080;font-weight:bold">where</span> id=<span style="color:#F00;background-color:#FAA">?</span> <span style="color:#080;font-weight:bold">and</span> tenantKey=<span style="color:#F00;background-color:#FAA">?</span>
<span style="color:#B06;font-weight:bold">delete</span> <span style="color:#080;font-weight:bold">from</span> user_tbl <span style="color:#080;font-weight:bold">where</span> id=<span style="color:#F00;background-color:#FAA">?</span> <span style="color:#080;font-weight:bold">and</span> tenantKey=<span style="color:#F00;background-color:#FAA">?</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>The presence of a restriction in the <code>WHERE</code> clause predicate allows the planner to take a peek at the parameter value
and immediately prune tables that don’t fit the partition key.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="outlook"><a class="anchor" href="#outlook" />Outlook</h2>
<div class="sectionbody">
<div class="paragraph">
<p>So far, Hibernate only makes use of the partitioning information in SQL update and delete statements.
There were discussions about adding support for <a href="https://github.com/hibernate/hibernate-orm/discussions/5360">DDL generation</a>
as well, but nothing has been agreed upon yet.</p>
</div>
<div class="paragraph">
<p>Do you think you could profit from DDL support? If so, let us know about your use case in the comments of the <a href="https://github.com/hibernate/hibernate-orm/discussions/5360">GitHub discussion</a>.</p>
</div>
</div>
</div>
https://in.relation.to/2023/02/07/hibernate-orm-617-final/Hibernate ORM 6.1.7.Final released2024-03-22T12:27:06+00:002023-02-07T00:00:00+00:00Andrea Boriero
Today, we published a new maintenance release of Hibernate ORM 6.1: 6.1.7.Final.
What’s new
This release includes some important bug fixes.
Bugfixes
OneToMany and @Where annotation
We have fixed a bug causing an EntityNotFoundException to be thrown when EntityManager#refresh() is called for a parent entity having a child annotated with @Where (see HHH-15902)
Embeddables
We have fixed few issues related to embeddables:
a PropertyAccessException was thrown when deleting an entity having an embeddable with a collection attribute (see HHH-16007)
an ArrayIndexOutOfBoundsException was thrown when loading an entity having an Embeddable with more attributes than the parent that was causing (see HHH-15778)
an IllegalArgumentException was thrown when deleting an entity...
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Today, we published a new maintenance release of Hibernate ORM 6.1: 6.1.7.Final.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-new"><a class="anchor" href="#whats-new" />What’s new</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This release includes some important bug fixes.</p>
</div>
<div class="sect2">
<h3 id="bugfixes"><a class="anchor" href="#bugfixes" />Bugfixes</h3>
<div class="sect3">
<h4 id="onetomany-and-where-annotation"><a class="anchor" href="#onetomany-and-where-annotation" />OneToMany and @Where annotation</h4>
<div class="paragraph">
<p>We have fixed a bug causing an <code>EntityNotFoundException</code> to be thrown when <code>EntityManager#refresh()</code> is called for a parent entity having a child annotated with <code>@Where</code> (see <a href="https://hibernate.atlassian.net/browse/HHH-15902">HHH-15902</a>)</p>
</div>
</div>
<div class="sect3">
<h4 id="embeddables"><a class="anchor" href="#embeddables" />Embeddables</h4>
<div class="paragraph">
<p>We have fixed few issues related to embeddables:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>a <code>PropertyAccessException</code> was thrown when deleting an entity having an embeddable with a collection attribute (see <a href="https://hibernate.atlassian.net/browse/HHH-16007">HHH-16007</a>)</p>
</li>
<li>
<p>an <code>ArrayIndexOutOfBoundsException</code> was thrown when loading an entity having an Embeddable with more attributes than the parent that was causing (see <a href="https://hibernate.atlassian.net/browse/HHH-15778">HHH-15778</a>)</p>
</li>
<li>
<p>an <code>IllegalArgumentException</code> was thrown when deleting an entity having an embeddable with a collection attribute annotated with <code>orphanRemoval=true</code> (see <a href="https://hibernate.atlassian.net/browse/HHH-15864">HHH-15864</a>)</p>
</li>
<li>
<p>a <code>NullPointException</code> was thrown when the model contains a nested embeddable with a non-optional association (see <a href="https://hibernate.atlassian.net/browse/HHH-15794">HHH-15794</a>)</p>
</li>
<li>
<p>a <code>ClassCastException</code> was thrown when a not nullable <code>OneToMany</code> association references an entity with an embedded id (see <a href="https://hibernate.atlassian.net/browse/HHH-15866">HHH-15866</a> see <a href="https://hibernate.atlassian.net/browse/HHH-15865">HHH-15865</a>)</p>
</li>
<li>
<p>an <code>IllegalArgumentException</code> was thrown when retrieving by identifier entities extending a <code>MappedSuperclass</code> class with an embeddable id (see <a href="https://hibernate.atlassian.net/browse/HHH-16070">HHH-16070</a>)</p>
</li>
<li>
<p>an <code>HibernateException</code> was thrown when querying an entity having an embeddable with a collection attribute with cascade delete orphan (see <a href="https://hibernate.atlassian.net/browse/HHH-16117">HHH-16117</a>)</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="bytecode-enhancement-and-dirty-checking"><a class="anchor" href="#bytecode-enhancement-and-dirty-checking" />Bytecode enhancement and dirty checking</h4>
<div class="paragraph">
<p>We have fixed a bug causing the execution of unnecessary SQL update statements when setting a property to its current value (see <a href="https://hibernate.atlassian.net/browse/HHH-16049">HHH-16049</a>)</p>
</div>
</div>
<div class="sect3">
<h4 id="polymorphic-queries"><a class="anchor" href="#polymorphic-queries" />Polymorphic Queries</h4>
<div class="paragraph">
<p>We have fixed a bug causing an <code>HibernateException</code> when a polymorphic query contains a join (see <a href="https://hibernate.atlassian.net/browse/HHH-15944">HHH-15944</a>)</p>
</div>
</div>
<div class="sect3">
<h4 id="batching"><a class="anchor" href="#batching" />Batching</h4>
<div class="paragraph">
<p>We have fixed a couple of bugs affecting batch fetching:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>when refreshing an entity annotated with <code>@BatchSize</code> its lazy associations may be swapped with a wrong instance (see <a href="https://hibernate.atlassian.net/browse/HHH-15851">HHH-15851</a>)</p>
</li>
<li>
<p>collection batch fetching generated more queries than needed when retrieving empty collections (see <a href="https://hibernate.atlassian.net/browse/HHH-16043">HHH-16043</a>)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>You can find the full list of changes in this version <a href="https://hibernate.atlassian.net/issues?jql=project=10031+AND+fixVersion=32126">here</a>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="conclusion"><a class="anchor" href="#conclusion" />Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For additional details, see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.1/userguide/html_single/Hibernate_User_Guide.html">User Guide</a></p>
</li>
<li>
<p>the <a href="https://docs.jboss.org/hibernate/orm/6.1/migration-guide/migration-guide.html">Migration Guide</a></p>
</li>
<li>
<p>the <a href="https://hibernate.org/orm/releases/6.1/">release page</a>.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="feedback-issues-ideas"><a class="anchor" href="#feedback-issues-ideas" />Feedback, issues, ideas?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To get in touch, use the usual channels:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://stackoverflow.com/questions/tagged/hibernate"><strong>hibernate</strong> tag on Stack Overflow</a> (usage questions)</p>
</li>
<li>
<p><a href="https://discourse.hibernate.org/c/hibernate-orm">User forum</a> (usage questions, general feedback)</p>
</li>
<li>
<p><a href="https://hibernate.atlassian.net/browse/HHH">Issue tracker</a> (bug reports, feature requests)</p>
</li>
<li>
<p><a href="http://lists.jboss.org/pipermail/hibernate-dev/">Mailing list</a> (development-related discussions)</p>
</li>
</ul>
</div>
</div>
</div>