We defined the field in database as a varchar, and when starting the application, the data validation wants it as a VarBinary, it seems not taking into account the @Enumerated(EnumType.STRING).
When trying to save the entity, it seems to serialize the Enum Nature instead of storing the actual value. Like it does with other databases such as Oracle.
@Entity @Table(name = "address_level") public class AddressLevel extends DescriptionEntity { private static final long serialVersionUID = 1L;
@Column(columnDefinition = "varchar", nullable = false, length = 100) @Enumerated(EnumType.STRING) private Nature nature;
@Column(nullable = false) private Integer rank;
@Column(nullable = false) private boolean required;
public AddressLevel() { // Do nothing, default constructor needed by JPA / Hibernate }
public Nature getNature() { return this.nature; }
public void setNature(final Nature nature) { this.nature = nature; }
public Integer getRank() { return this.rank; }
public void setRank(final Integer rank) { this.rank = rank; }
public boolean getRequired() { return this.required; }
public void isRequired(final boolean required) { this.required = required; }
}
DescriptionEntity defined as @MappedSuperclass
|