Interface IdUUID


  • public interface IdUUID
    Models that use UUID as permanent identifier. UUID column should not be updatable:
     @Column(unique = true, updatable = false, nullable = false)
     @@Type(type = "uuid-binary")
     protected UUID uuid;
     
    The entity must generate a UUID before persisting the data:
     @PrePersist
     private void prepersist() {
            if (this.uuid == null) {
                    this.uuid = UUID.randomUUID();
            }
     }
     
    • Method Detail

      • getUuid

        UUID getUuid()
        Gets the uuid.
        Returns:
        the uuid