package com.vladmihalcea.book.hpjp.hibernate.type.json.model;

import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;

import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs;

import com.vladmihalcea.book.hpjp.hibernate.type.array.IntArrayType;
import com.vladmihalcea.book.hpjp.hibernate.type.array.StringArrayType;

/**
 * @author Vlad Mihalcea
 */
@TypeDefs({
    @TypeDef(name = "string-array", typeClass = StringArrayType.class),
    @TypeDef(name = "int-array", typeClass = IntArrayType.class)
})
@MappedSuperclass
public class BaseEntity {

    @Id
    private Long id;

    @Version
    private Integer version;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getVersion() {
        return version;
    }
}

@@ -389,16 +389,156 @@
 rayType;
+%0Aimport com.vladmihalcea.book.hpjp.hibernate.type.json.JsonBinaryType;%0Aimport com.vladmihalcea.book.hpjp.hibernate.type.json.JsonStringType;
 %0A%0A/**%0A *
@@ -712,16 +712,144 @@
 e.class)
+,%0A    @TypeDef(name = %22json%22, typeClass = JsonStringType.class),%0A    @TypeDef(name = %22jsonb%22, typeClass = JsonBinaryType.class),
 %0A%7D)%0A@Map

Add the old types