diff --git a/README.md b/README.md index b982327ed..d47190307 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,149 @@ ### Introduction -The Hibernate Types repository gives you extra types and general-purpose utilities that are not supported by the Hibernate ORM core. +The Hibernate Types project gives you extra types and general-purpose utilities that are not supported by the Hibernate ORM core. The main advantage of this project is that it supports a broad range of Hibernate versions, spanning from **Hibernate ORM 6** to **5.6**, **5.5**, **5.4**, **5.3**, **5.2**, **5.1**, **5**, **4.3**, **4.2**, and Hibernate **4.1**. +### Installation + +Depending on the Hibernate version you are using, you need to add the following dependency: + +#### Hibernate 6.0 + + + com.vladmihalcea + hibernate-types-60 + 2.17.1 + + +#### Hibernate 5.6 and 5.5 + + + com.vladmihalcea + hibernate-types-55 + 2.17.1 + + +#### Hibernate 5.4, 5.3 and 5.2 + + + com.vladmihalcea + hibernate-types-52 + 2.17.1 + + +#### Hibernate 5.1 and 5.0 + + + com.vladmihalcea + hibernate-types-5 + 2.17.1 + + +#### Hibernate 4.3 + + + com.vladmihalcea + hibernate-types-43 + 2.17.1 + + +#### Hibernate 4.2 and 4.1 + + + com.vladmihalcea + hibernate-types-4 + 2.17.1 + + +#### Optional Maven Dependencies + +The Hibernate Types project defines a list of optional dependencies that you will have to declare explicitly in your project in order to use them. + +The reason why all these dependencies are optional, like Guava, Jackson, or PostgreSQL JDBC Driver, is because not all projects may need them. + +More, the dependency version is extremely important because if you forget to upgrade a certain dependency, your application could be at risk in case the old dependency version suffers from security issues that have been recently discovered. + +For all these reasons, it is your responsibility to define explicitly all the dependencies that you are planning to use. + +##### JSON Optional Maven Dependencies + +If you are using JSON Types, then you might be interested in setting the following dependencies based on your Hibernate version: + +###### Hibernate 6.0 + +````xml + + com.fasterxml.jackson.module + jackson-module-jakarta-xmlbind-annotations + ${jackson-module-jakarta-xmlbind-annotation} + +```` + +###### Hibernate 5,5, 5.5, 5.4, 5.3, and 5.2 + +````xml + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind.version} + + + + com.fasterxml.jackson.module + jackson-module-jaxb-annotations + ${jackson-module-jaxb-annotation} + +```` + +###### Hibernate 5.1, 5.0, 4.3, 4.2, and 4.1 + +````xml + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + +```` + +##### Guava Optional Maven Dependency + +If you are mapping a `Range` using Guava, then you have to provide the Guava dependency explicitly: + +````xml + + com.google.guava + guava + ${guava.version} + +```` + +##### Java Money and Currency API Optional Maven Dependency + +If you are mapping a `MonetaryAmount`, then you have to provide the Moneta dependency explicitly: + +````xml + + org.javamoney + moneta + ${moneta.version} + pom + +```` + +##### PostgreSQL Optional Maven Dependency + +If you are mapping a PostgreSQL-specific column type (e.g., `inet`, `hstore`, `array`, `interval`), then you have to provide the PostgreSQL dependency explicitly: + +````xml + + org.postgresql + postgresql + ${postgresql.version} + +```` + ### Features #### JSON @@ -170,58 +309,6 @@ public class JpaConfiguration { * [`ListResultTransformer` - The best way to use a Hibernate ResultTransformer](https://vladmihalcea.com/hibernate-resulttransformer/) * [`MapResultTransformer` - How to return a Map result from a JPA or Hibernate query](https://vladmihalcea.com/jpa-query-map-result/) -### Installation - -Depending on the Hibernate version you are using, you need to add the following dependency: - -#### Hibernate 6.0 - - - com.vladmihalcea - hibernate-types-60 - 2.17.1 - - -#### Hibernate 5.6 and 5.5 - - - com.vladmihalcea - hibernate-types-55 - 2.17.1 - - -#### Hibernate 5.4, 5.3 and 5.2 - - - com.vladmihalcea - hibernate-types-52 - 2.17.1 - - -#### Hibernate 5.1 and 5.0 - - - com.vladmihalcea - hibernate-types-5 - 2.17.1 - - -#### Hibernate 4.3 - - - com.vladmihalcea - hibernate-types-43 - 2.17.1 - - -#### Hibernate 4.2 and 4.1 - - - com.vladmihalcea - hibernate-types-4 - 2.17.1 - - ### Requirements * Java version supported by the Hibernate ORM version you are using.