X-Git-Url: https://juplo.de/gitweb/?p=hibernate4-maven-plugin;a=blobdiff_plain;f=src%2Fit%2Fhibernate-lob-converter-bug%2Fsrc%2Ftest%2Fjava%2Fio%2Fblep%2FMyEntity.java;fp=src%2Fit%2Fhibernate-lob-converter-bug%2Fsrc%2Ftest%2Fjava%2Fio%2Fblep%2FMyEntity.java;h=0907809c65c7bb58a2fbc177a7de83a6455034b9;hp=0000000000000000000000000000000000000000;hb=c969993cb255167bf07632e03c1b2ecde72b2ebb;hpb=9c3a3b7ece6dfdbe79dad9aa10ce09c2fd34ed42 diff --git a/src/it/hibernate-lob-converter-bug/src/test/java/io/blep/MyEntity.java b/src/it/hibernate-lob-converter-bug/src/test/java/io/blep/MyEntity.java new file mode 100644 index 00000000..0907809c --- /dev/null +++ b/src/it/hibernate-lob-converter-bug/src/test/java/io/blep/MyEntity.java @@ -0,0 +1,48 @@ +package io.blep; + +import javax.persistence.*; + +/** + * @author blep + */ +@Entity +public class MyEntity { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Integer id; + + @Convert(converter = MyConverter.class) + @Lob + private String status; + + @Converter + public static class MyConverter implements AttributeConverter { + + @Override + public Integer convertToDatabaseColumn(String attribute) { + return attribute.length(); + } + + @Override + public String convertToEntityAttribute(Integer dbData) { + return ""; + } + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + +}