I want to have a unique number besides my string id. So I thought I could use Generated from Hibernate but the value is always null.
My entity:
@Entity(name = "user")
public class UserEntity {
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
@Column(updatable = false, nullable = false)
private String id;
....
@org.hibernate.annotations.Generated(GenerationTime.ALWAYS)
@Column(name = "identifier_id", insertable = false, updatable = false)
private Long identifierId;
}
Could someone please help me?