Hi,
We have entity class contain BLOB like: @Entity @Table(name = "RawGpsData") public class RawGpsData implements Serializable { private Long id; private String vehNo; private Date dateTime; @Lob private String data; }
We don't want to have duplicate data in the database.
I am to try to define data field as unique, but unique attribute seem not work for Lob: @Lob @Column(name = "data",columnDefinition = "MEDIUMTEXT", unique = true) public String getData() { return data; } public void setData(String data) { this.data = data; }
Duplicated happened from two user try to save same data at the same. I try to find this data before save it, but it does not work.
Anyone know its solution?
Thanks
|