I haven't worked until today with EclipseLink and I don't seem to able to find a @NaturalId
. So what is the equivalent of Hibernate's @NaturalId
in EclipseLink ?
import javax.persistence.CascadeType;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import org.hibernate.annotations.NaturalId;
import lombok.Data;
@Entity
@Data
public class Task {
enum Status{DONE,IN_PROGRESS,OPEN,REOPENED}
@Id
private long id;
@NaturalId
private String taskKey;
private Status status;
private int initEstimation;
@Embedded
Progress progress;
}