import lombok.*; import org.springframework.data.annotation.Immutable; import javax.persistence.*; @Entity @Immutable @Table(name = "acl_object_identity", uniqueConstraints = { @UniqueConstraint(name = "_ak_object_id_class_object_id_identity", columnNames = {"object_id_class", "object_id_identity"}) }) @AllArgsConstructor @NoArgsConstructor @Getter @EqualsAndHashCode @ToString public final class AclObjectIdentity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @ManyToOne(optional = false) @JoinColumn(name = "object_id_class", referencedColumnName = "id", nullable = false) private AclClass objectIdClass; @Column(name = "object_id_identity", nullable = false) private Long objectIdIdentity; @ManyToOne @JoinColumn(name = "parent_object", referencedColumnName = "id") private AclObjectIdentity parentObject; @ManyToOne(optional = false) @JoinColumn(name = "owner_sid", referencedColumnName = "id", nullable = false) private AclSid ownerSid; }