Experimente assim:
public class BaseEntity{
@Column(nullable = false)
private String uuid;
public BaseEntity(){
setUuid(UUID.randomUUID().toString());
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
@PrePersist
public void prePersist(){
if(null == getUuid())
setUuid(UUID.randomUUID().toString());
}
....
Definição da coluna:
uuid varchar(255) DEFAULT NULL
Ao gerar
UUID
use toString
método:entity.setUuid(UUID.randomUUID().toString())