Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 514 Bytes

ForeignKey.md

File metadata and controls

23 lines (18 loc) · 514 Bytes

ForeignKey Annotation

Indicates that the annotated field represents a foreign key constraint in a database table.

Example usage:

@Entity
public class Phone {
    @Id
    @GeneratedValue
    private Long id;
    
    @ManyToOne
    @JoinColumn(name = "author_profile_id", foreignKey = @ForeignKey(name = "FK_phone_author_profile"))
    private AuthorProfile authorProfile;
}

See Also