23 lines
565 B
Java
23 lines
565 B
Java
package com.ankurm.idgen;
|
|
|
|
import jakarta.persistence.*;
|
|
import java.util.UUID;
|
|
import org.hibernate.annotations.UuidGenerator;
|
|
|
|
/** @UuidGenerator(style = TIME): a version 1 (Gregorian time) UUID with Hibernate's own layout. Not version 7. */
|
|
@Entity
|
|
public class UuidTimeItem {
|
|
@Id
|
|
@UuidGenerator(style = UuidGenerator.Style.TIME)
|
|
private UUID id;
|
|
private String name;
|
|
|
|
public UuidTimeItem() {}
|
|
|
|
public UuidTimeItem(String name) { this.name = name; }
|
|
|
|
public UUID getId() { return id; }
|
|
|
|
public String getName() { return name; }
|
|
}
|