Red Hat

In Relation To

The Hibernate team blog on everything data.

Hibernate ORM 5.0.12.Final and 5.1.4.Final released

Posted by    |       |    Tagged as Hibernate ORM Releases
These are the last releases in the 5.0/5.1 series. You will need to migrate to 5.2 for future bugfixes.

Hibernate ORM 5.0.12.Final:

Hibernate ORM 5.1.4.Final:

For information on consuming the release via your favorite dependency-management-capable build tool, see http://hibernate.org/orm/downloads/

Seventh bug-fix release for ORM 5.2

Posted by    |       |    Tagged as Hibernate ORM Releases

The Seventh bug-fix release for Hibernate ORM 5.2 has just been published. It is tagged at https://github.com/hibernate/hibernate-orm/releases/tag/5.2.7

The complete list of changes can be found here (or here for people without a Hibernate Jira account).

For information on consuming the release via your favorite dependency-management-capable build tool, see http://hibernate.org/orm/downloads/

The release bundles can be obtained from SourceForge or BinTray.

Meet Dmitry Alexandrov

Posted by    |       |    Tagged as Discussions Hibernate ORM Interview

In this post, I’d like you to meet Dmitry Alexandrov, who, not only that he’s a well known Java technologist and conference speaker, but he’s also a polyglot, speaking 6 languages (e.g. Russian, Bulgarian, Ukrainian, English, German, and French).

Dmitry Alexandrov, align=
  1. Hi, Dmitry. Would you like to introduce yourself and tell us a little bit about your developer experience?

    Hi! My name is Dmitry Aleksandrov and currently for more than a year I’m a Principal expert developer and architect at T-Systems. I’ve got 10 years experience mainly in Java EE/Spring stack.

    Most of my time I was dealing with big enterprise projects in banking, insurance, and telecoms. Along with four other awesome guys, I’m a co-lead in the Bulgarian Java User Group and jPrime conference co-organizer.

  2. You have recently published an article about a major performance optimization you underwent in one enterprise project. Can you tell us what are the most common performance issues in enterprise systems?

    Surprisingly, or actually not so much surprisingly, the most of the optimizations in enterprise projects are made on the persistence layer. The way the data is stored and accessed is essential as the most of the latency may come out of there.

    The other source of latency may be the remote calls, but the only way gain performance there is to reduce their quantity and upgrade the hardware architecture. As for the persistence much more can be done in this field. It is essential to really pay attention to what is taken out the DB and what is shown to the user. Heavy CPU processing is rarely seen, at least from my experience.

    So. it is really important to invest time in a good design of the persistence layer. ORMs are doing really great job, and the automation they have brought saves tremendous efforts, time and money. But at the same time, the users of the ORMs are a little bit spoiled of the magic they bring.

    The developers and architects tend to design the object model as the primary source of data and the DB schemas as a product of the model and heavily rely on the ORM to manage this. This quite often leads to very suboptimal data representation in the RDBMS thus performance issues, since the mathematics in Relational Databases are much different from those of the programming language objects. And those mistakes are often very hard and expensive to fix, as DB schemas are extremely hard to change especially when they are in production already.

    And the ORM, although it is an extremely smart tool nowadays, is still not an AI (yet). So to deal with those problems, I believe that every enterprise or full stack developer should invest more time in educating in Databases and the way their programming language interacts with them. A good persistence layer design may solve the most of the performance issues or even fully prevent them from happening.

  3. Hibernate offers many optimizations that aim to increase application performance. Has Hibernate met your goals in the projects you’ve been involved with?

    Yes, definitely. Although we try to use as much standard JPA as possible, on our final customer deployments we also do Hibernate specific optimizations, like pre-build code instrumentation if we use Hibernate version 5. In one of my previous project we have used some second-level caching, and Hibernate integrated almost seamlessly.

  4. You are a Java EE aficionado and international speaker. How to you see the future of Java EE and JPA in the context of cloud computing and Microservices architectures?

    Java EE is a subject of many discussions recently. Quite a lot of even fatal prognoses were made, but I personally believe Java EE will still be there and make big progress. There is a huge аmount of companies and enterprises that build their business with Java EE technologies, and they won’t disappear soon since EE is a proven standard.

    Actually, this is the main advantage of Java EE – it is a standard. It means it is guaranteed, a reliable and tested set of functionalities that have the same behavior and results on all supported platforms. And a standard is not something that is just assigned, standards are established based on what’s the best and most valuable in current technology at the moment. And the establishment of these technologies the most often comes from the community.

    A good example of community effort is exactly the Microprofile initiative, which is driven by Independent Java EE Server vendors. As Microservices are now very popular, the activists try to create a really common solution for the best utilization of this architecture on Java EE.

    Although there are some controversies about what should this profile include, there is a starting point. The discussion is open, and everybody is welcome to contribute. Actually, it is very curious to see how a standard is being born! The guys are doing a great job! Another example is the Java EE Guardians who are doing great input in all aspects of the Java EE evolution!

    As for the cloud, Oracle has made some promises that they will put more efforts in a better Java EE cloud integration. But as for now in our environments, we have a mixture of PaaS and IaaS solutions. Like some of the servers are Dockerized or packed as executable jars and running somewhere in the cloud, and the databases are provided like services. But there we have some issues with the latency.

  5. We always value feedback from our users, so can you tell us what you’d like us to improve or are there features that we should add support for?

    I am now waiting for the full support of the Entity Graph functionality. I personally believe that’s a very handy way to have a good fine control over what you fetch and can give some really good performance improvements, especially on systems which are in production already.

Thank you, Dmitry, for taking your time. It is a great honor to have you here. To reach Dmitry, you can follow him on Twitter.

Hibernate Validator 5.4.0.CR1

Posted by    |       |    Tagged as Hibernate Validator Releases

I am proud to announce the release of Hibernate Validator 5.4.0.CR1. This is a candidate release, please take the time to test it and report any issues you might find so that we can build the best possible 5.4.0.Final.

What’s new

5.4.0.CR1 is a small release built on the shoulders of our previous beta. It contains a couple of nice improvements and bugfixes:

  • We improved the javax.money support with a new annotation @Currency

  • Marko Bekhta finished his work on the annotation processor: we are now on a par with the Hibernate Validator engine features

  • We also fixed a possible overflow issue in java.time validation reported by Stanislav Bashkyrtsev

You can find the complete list of all addressed issues in the change log.

Playing with @Currency

In Beta1, we introduced the ability to validate your Order bean containing a MonetaryAmount property with the @DecimalMin annotation. Starting from CR1, you can also use the @Currency annotation to specify the currencies allowed:

public class Order {

    @NotBlank
    private String name;

    @DecimalMin(value = "0", inclusive = false)
    @Currency("EUR")
    private MonetaryAmount amount;

    public JavaxMoneyOrder(String name, MonetaryAmount amount) {
        this.name = name;
        this.amount = amount;
    }
}

JDK 9 support

As usual, we are working on validating the releases of Hibernate Validator with the latest JDK 9 early access builds.

5.4.0.CR1 is supported on the JDK 9+148 build. However, a blocking issue in JDK 9 prevents it to run on +151. It should be fixed in the next JDK 9 release.

Getting 5.4.0.CR1

To get the release with Maven, Gradle etc. use the GAV coordinates org.hibernate:{hibernate-validator|hibernate-validator-cdi|hibernate-validator-annotation-processor}:5.4.0.CR1.

Alternatively, a distribution bundle containing all the bits is provided on SourceForge (TAR.GZ, ZIP).

Feedback, issues, ideas?

To get in touch, use the usual channels:

What’s next?

The obvious next step is the 5.4.0.Final release.

As far as Bean Validation 2.0 is concerned, there are very interesting discussions going on about value extraction which is THE big BV 2.0 feature. Come and join us on Bean Validation website to define the future of Bean Validation.

Hibernate Community Newsletter 1/2017

Posted by    |       |    Tagged as Discussions Hibernate ORM

Welcome to the Hibernate community newsletter in which we share blog posts, forum, and StackOverflow questions that are especially relevant to our users.

Articles

Dmitry Alexandrov wrote an awesome article which explains how he managed to optimize the memory allocation of an enterprise application so that, instead of occupying 8 GB, it now requires only 89 MB of Heap storage.

If yu are using the TABLE identifier generator, you should know that this generator does not scale very well. Check out this article for more details.

For out Portuguese readers, Daniel Dias wrote an article about how you can persist data into a NoSQL database using Hibernate OGM.

Thorben Janssen continues his Hibernate Envers series with an article about extending the standard revision.

Time to upgrade

Hibernate Search 5.5.6.Final is out

Posted by    |       |    Tagged as Hibernate Search Releases

Hibernate Search 5.5.6.Final is here!

This is a maintenance release and contains exclusively bugfixes.

What’s new?

  • HSEARCH-2494: @TikaBridge will now work correctly on properties of type byte[].

  • HSEARCH-2535: @Facet with string encoding will now work properly on multi-valued properties (such as String[] or List<String>).

  • HSEARCH-2486: @ContainedIn in a superclass will now be taken into account even if the concrete class does not carry any Hibernate Search annotation.

  • HSEARCH-2479: building phrase queries with the Hibernate Search DSL used to trigger an IllegalArgumentException in some specific cases; this has been fixed.

  • …​ and more: the full change log can be found on our JIRA instance.

Thanks to Julien Bénichou, Andrew Robie and Timo Tretter for reporting issues, and even fixing one!

How to get this release

All versions are available on Hibernate Search’s web site.

Ideally use a tool to fetch it from Maven central; these are the coordinates:

<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-search-orm</artifactId>
   <version>5.5.6.Final</version>
</dependency>

Downloads from Sourceforge are available as well.

Feedback, issues, ideas?

To get in touch, use the following channels:

Hibernate OGM 5.1 Beta3 and 5.0.4 are out

Posted by    |       |    Tagged as Hibernate OGM Releases

Hello everybody, holidays are over and we decided to start back with a small release.

Hibernate OGM 5.1 Beta3 and a new 5.0 maintainance releases are now available.

In these releases we fixed some issues around sequence generation and queries on entities using the single table per class inheritance strategy. An update is highly recommended.

Hibernate OGM 5.0.4.Final is backward compatible with 5.0.3.Final. If you need to upgrade from a version before 5.0, you can find help on the migration notes.

All the details about these releases are on the 5.0.4.Final changelog, the 5.1.0.Beta2 changelog and the 5.1.0.Beta3 changelog.

What happened to 5.1 Beta2?

Think of it as the crazy uncle nobody wants to talk about, you should check 5.1 Beta3 instead.

Where can I get them?

5.0.4.Final

You can get the required core library using the following Maven coordinates:

  • org.hibernate.ogm:hibernate-ogm-core:5.0.4.Final

and these are the backends currently available:

  • Cassandra: org.hibernate.ogm:hibernate-ogm-cassandra:5.0.4.Final

  • CouchDB: org.hibernate.ogm:hibernate-ogm-couchdb:5.0.4.Final

  • Infinispan: org.hibernate.ogm:hibernate-ogm-infinispan:5.0.4.Final

  • Ehcache: org.hibernate.ogm:hibernate-ogm-ehcache:5.0.4.Final

  • MongoDB: org.hibernate.ogm:hibernate-ogm-mongodb:5.0.4.Final

  • Neo4j: org.hibernate.ogm:hibernate-ogm-neo4j:5.0.4.Final

  • Redis: org.hibernate.ogm:hibernate-ogm-redis:5.0.4.Final

Alternatively, you can download archives containing all the binaries, source code and documentation from Sourceforge.

5.1.0.Beta3

You can get the required core library using the following Maven coordinates:

  • org.hibernate.ogm:hibernate-ogm-core:5.1.0.Beta3

and these are the backends currently available for 5.1.0.Beta3:

  • Cassandra: org.hibernate.ogm:hibernate-ogm-cassandra:5.1.0.Beta3

  • CouchDB: org.hibernate.ogm:hibernate-ogm-couchdb:5.1.0.Beta3

  • Infinispan

    • Embedded: org.hibernate.ogm:hibernate-ogm-infinispan:5.1.0.Beta3

    • Remote: org.hibernate.ogm:hibernate-ogm-infinispan-remote:5.1.0.Beta3

  • Ehcache: org.hibernate.ogm:hibernate-ogm-ehcache:5.1.0.Beta3

  • MongoDB: org.hibernate.ogm:hibernate-ogm-mongodb:5.1.0.Beta3

  • Neo4j: org.hibernate.ogm:hibernate-ogm-neo4j:5.1.0.Beta3

  • Redis: org.hibernate.ogm:hibernate-ogm-redis:5.1.0.Beta3

Alternatively, you can download archives containing all the binaries, source code and documentation from Sourceforge.

What’s next?

We are getting ready for the first 5.1 candidate release.

How can I get in touch?

You can find us through the following channels:

We are looking forward to hear your feedback!

It’s finally here! We just published the first candidate release of Hibernate Search with experimental Elasticsearch integration (5.6.0.CR1), along with 5.7.0.Beta2.

Version 5.6.0.CR1 brings the latest bugfixes and previously missing features for our experimental Elasticsearch integration. This is the version to use with Hibernate ORM versions 5.0 and 5.1.

Version 5.7.0.Beta2 brings the exact same changes as 5.6.0.CR1, and it still features the compatibility with Hibernate ORM version 5.2 that was introduced with 5.7.0.Alpha1.

What’s new?

  • HSEARCH-2348: Elasticsearch queries are now logged at the DEBUG level on the org.hibernate.search.fulltext_query logger, just as embedded Lucene queries.

  • HSEARCH-2449: more configuration options have been added regarding the connection to Elasticsearch, including the size of connection pools, the connection/read timeouts, and the automatic discovery of new nodes in the Elasticsearch cluster for client-side loadbalancing and (limited) failover.

  • HSEARCH-2219: analyzer definitions are now automatically translated and added to the Elasticsearch settings when Elasticsearch indexes are created. Please note there are still some limitations, most notably the definitions are not updated automatically (no support for the MERGE schema management strategy). See the documentation for more information about analyzers with Elasticsearch.

  • HSEARCH-2387: Elasticsearch mappings generated by Hibernate Search used to be strictly static. This can be an issue in some cases, which is why opt-in dynamic mappings are now available, either through a global option (see org.hibernate.search.elasticsearch.cfg.ElasticsearchEnvironment.DYNAMIC_MAPPING) or locally on metadata-providing field bridges (builder.field( name, FieldType.OBJECT ).mappedOn( Elasticsearch.class ).dynamic( DynamicType.TRUE )). Thanks to Alex Laptseu for reporting this!

  • …​ and much more, mainly bug fixes. The full change log can be found on our JIRA instance.

When will 5.6 be released?

As far as we are concerned, 5.6 is ready. Version 5.6.0.CR1 is the last opportunity for the community to test it and report bugs before the release which, if all goes well, will happen in early January.

What about Elasticsearch 5 support?

As mentioned in the blog post about the previous release, Elasticsearch 5.x is not supported yet.

Quoting:

The main reason is it brings several backward-incompatible changes that would require quite a bit of work if we still want to support the 2.x series. And we don’t want to postpone the Hibernate Search 5.6.0 release any more.

Our plan is to release a 5.6 supporting Elasticsearch 2.x, and add Elasticsearch 5 support in Hibernate Search 6.0 or, maybe, in an early 5.8 release. You may refer to HSEARCH-2434 to track the status of Elasticsearch 5.0 support.

When will 5.7 be released?

We are planning to publish a candidate release for 5.7 soon after 5.6.0.Final has been released.

How to get these releases

All versions are available on Hibernate Search’s web site.

Ideally use a tool to fetch it from Maven central; these are the coordinates:

<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-search-orm</artifactId>
   <version>5.6.0.CR1</version>
</dependency>

Or, for Hibernate Search 5.7:

<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-search-orm</artifactId>
   <version>5.7.0.Beta2</version>
</dependency>

To use the experimental Elasticsearch integration you’ll also need:

<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-search-elasticsearch</artifactId>
   <version>5.6.0.CR1</version>
</dependency>

Change the version to 5.7.0.Beta2 in order to test the Elasticsearch integration within Hibernate Search 5.7.

Downloads from Sourceforge are available as well.

Feedback, issues, ideas?

To get in touch, use the following channels:

Sixth bug-fix release for ORM 5.2

Posted by    |       |    Tagged as Hibernate ORM Releases

The Sixth bug-fix release for Hibernate ORM 5.2 has just been published. It is tagged at https://github.com/hibernate/hibernate-orm/releases/tag/5.2.6

The complete list of changes can be found here (or here for people without a Hibernate Jira account).

For information on consuming the release via your favorite dependency-management-capable build tool, see http://hibernate.org/orm/downloads/

The release bundles can be obtained from SourceForge or BinTray.

Hibernate Community Newsletter 25/2016

Posted by    |       |    Tagged as Discussions Hibernate ORM

Welcome to the Hibernate community newsletter in which we share blog posts, forum, and StackOverflow questions that are especially relevant to our users.

Articles

Sanne Grinovero and John Griffin have worked on the Getting Started with Hibernate Search RefCard on DZone. Check out the PDF version which is even more detailed than the web version.

If you want to customize the JOIN clause of an entity association, you can use the Hibernate @JoinFormula annotation, as explained in this article.

There are multiple ways to delete a JPA entity, as illustrated in this article on Baeldung.

Thorben Janssen wrote a Getting Started article for Hibernate Envers and another one about querying audit log entries.

Dimo Velev gives a very detailed explanation of why Class.forName can cause lock contention. The HHH-4959 was affecting both JPQL and Criteria API entity queries, and the fix will be available starting from Hibernate ORM 5.2.6.

If you want to use Hibernate ORM with SQL Server, then you should read this article. There are plenty of tips related to optimal data access patterns and indexing considerations.

Jakub Kubrynski explains why you should care about equals and hashCode, especially when dealing with JPA entities.

back to top