Introduction
The Hibernate Types repository gives you extra types that are not supported by the Hibernate ORM core.
Features
JSON
- Jackson
JsonNode
- Java Object to String or Binary JSON column mapping
- Java Collection to String or Binary JSON column mapping
- How to customize the Jackson ObjectMapper used by Hibernate-Types
- How to customize the JSON Serializer used by Hibernate-Types
- How to fix the Hibernate “No Dialect mapping for JDBC type: 1111” issue when mixing JSON types with native SQL queries
PostgreSQL Types (e.g. ARRAY, ENUM, INET)
- PostgreSQL ARRAY mapping
- Java Enum to PostgreSQL Enum Type
- How to map the PostgreSQL inet type with JPA and Hibernate
Generic Types
java.time.YearMonth
to DATE or INTEGER columnCharacter
to nullable CHAR columnImmutableType
utility to simplifyUserType
implementations
Installation
Depending on the Hibernate version you are using, you need to following dependency:
Hibernate 5.4, 5.3 and 5.2
<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>hibernate-types-52</artifactId>
<version>2.3.3</version>
</dependency>
Hibernate 5.1 and 5.0
<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>hibernate-types-5</artifactId>
<version>2.3.3</version>
</dependency>
Hibernate 4.3
<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>hibernate-types-43</artifactId>
<version>2.3.3</version>
</dependency>
Hibernate 4.2 and 4.1
<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>hibernate-types-4</artifactId>
<version>2.3.3</version>
</dependency>
If you like it, you are going to love my book as well!
Requirements
- Java version supported by the Hibernate ORM version you are using.
- SLF4J
- Jackson Databind