diff --git a/persistence-modules/hibernate5/pom.xml b/persistence-modules/hibernate5/pom.xml
index 363e2153b6..7e9a0ddb29 100644
--- a/persistence-modules/hibernate5/pom.xml
+++ b/persistence-modules/hibernate5/pom.xml
@@ -51,6 +51,11 @@
hibernate-testing
5.2.2.Final
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson.version}
+
@@ -69,6 +74,7 @@
2.2.3
1.4.196
3.8.0
+ 2.8.11.3
diff --git a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/persistjson/Customer.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/persistjson/Customer.java
new file mode 100644
index 0000000000..6bd1c24869
--- /dev/null
+++ b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/persistjson/Customer.java
@@ -0,0 +1,80 @@
+package com.baeldung.hibernate.persistjson;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.persistence.Convert;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@Entity
+@Table(name = "Customers")
+public class Customer {
+
+ @Id
+ private int id;
+
+ private String firstName;
+
+ private String lastName;
+
+ private String customerAttributeJSON;
+
+ @Convert(converter = HashMapConverter.class)
+ private Map customerAttributes;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public String getCustomerAttributeJSON() {
+ return customerAttributeJSON;
+ }
+
+ public void setCustomerAttributeJSON(String customerAttributeJSON) {
+ this.customerAttributeJSON = customerAttributeJSON;
+ }
+
+ public Map getCustomerAttributes() {
+ return customerAttributes;
+ }
+
+ public void setCustomerAttributes(Map customerAttributes) {
+ this.customerAttributes = customerAttributes;
+ }
+
+ private static final ObjectMapper objectMapper = new ObjectMapper();
+
+ public void serializeCustomerAttributes() throws JsonProcessingException {
+ this.customerAttributeJSON = objectMapper.writeValueAsString(customerAttributes);
+ }
+
+ public void deserializeCustomerAttributes() throws IOException {
+ this.customerAttributes = objectMapper.readValue(customerAttributeJSON, Map.class);
+ }
+
+}
diff --git a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/persistjson/HashMapConverter.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/persistjson/HashMapConverter.java
new file mode 100644
index 0000000000..b1c2d50480
--- /dev/null
+++ b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/persistjson/HashMapConverter.java
@@ -0,0 +1,47 @@
+package com.baeldung.hibernate.persistjson;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.persistence.AttributeConverter;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.baeldung.hibernate.interceptors.CustomInterceptor;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class HashMapConverter implements AttributeConverter