I am trying to map a Postgresql UUID column, to Java UUID field, using OpenJPA (included with TomEE microprofile). After doing a fair amount of google searching, I think it's due to postgres supplying the UUID as a Blob. OpenJPA is throwing a "Caused by: java.io.StreamCorruptedException: invalid stream header:" error, when the UUID field is populated.
One solution I have tried (below), doesn't work. Maybe I need some kind of field converter, but I do not know how make one in a standards compatible way? I also tried making a String to UUID converter, but this wasn't even being called.
Thanks.
@Entity
public class Fs_players {
@Id
public int userid;
public String profile_name;
public String infotxt;
@Column(columnDefinition = "uuid", updatable = false )
private UUID profile_pic;
public long stock_price;
public long cash;
public long credits;
public Date proexpiry;
...
question from:
https://stackoverflow.com/questions/65641213/tomee-openjpa-persistence-postgress-uuid-field 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…