The hibernate-types open-source project is born

Imagine having a tool that can automatically detect if you are using JPA and Hibernate properly. Hypersistence Optimizer is that tool!

Introduction

Recently, I got a very interesting request from one of my readers. Since I’ve been providing many custom types to support JSON, ARRAY or nullable Character types, I decided to start a new open-source project to make it easier for you to get this extra Hibernate Types.

The project

As expected, the project is hosted on GitHub, so it’s business as usual.

To use it, you just have to set up a new Maven dependency in your project since all artifacts can be grabbed from Maven Central.

For Hibernate 5.2, use this dependency:

<dependency>
    <groupId>com.vladmihalcea</groupId>
    <artifactId>hibernate-types-52</artifactId>
    <version>${hibernate-types.version}</version>
</dependency>

For Hibernate 5.1 and 5.0, use this dependency:

<dependency>
    <groupId>com.vladmihalcea</groupId>
    <artifactId>hibernate-types-5</artifactId>
    <version>${hibernate-types.version}</version>
</dependency>

For Hibernate 4.3, use this dependency:

<dependency>
    <groupId>com.vladmihalcea</groupId>
    <artifactId>hibernate-types-43</artifactId>
    <version>${hibernate-types.version}</version>
</dependency>

For Hibernate 4.2 and 4.1, use this dependency:

<dependency>
    <groupId>com.vladmihalcea</groupId>
    <artifactId>hibernate-types-4</artifactId>
    <version>${hibernate-types.version}</version>
</dependency>

For older versions of Hibernate, it’s time to upgrade and benefit from a great variety of features.

Extra Hibernate Types

The 1.0.0 version brings you the following Hibernate Types:

If you enjoyed this article, I bet you are going to love my Book and Video Courses as well.

Conclusion

Stay tuned!

The next release is going to add support for combining the assigned identifier generator with either IDENTITY or SEQUENCE as well as the SEQUENCE locating mechanism explained in this article.

Therefore, it’s all about trade-offs, so choose wisely.

FREE EBOOK

4 Comments on “The hibernate-types open-source project is born

    • Once it will be included in the JPA standard, it will be implemented.

      If you’d like to have it sooner, send us a Pull Request with your proposal and we’ll take a lookat it.

      • I would really like to see that feature in hibernate first before it’s included in the spec because there’s not so much happening on that front (and I don’t want to wait five more years). This feature does not require any modifications to the Persistence API, it’s just a matter of interpretation.

        I tried to implement it once but it was not easy for someone who’s not that familiar with hibernate’s internals.

        If you have some ideas/pointers on how to do it (classes/methods), I would gladly give it another try.

      • I don’t have any pointers about it. But you can surely study the base code and come up with a solution. It’s just Java code after all. Due to lack of resources, it’s unlikely that this issue will be implemented prior to being added to the standard. That’s why you need to implemented it and send a Pull Request. A pull request has a higher priority than a Jira issue since there are already thousands of other issues waiting to be implemented.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.