Annotation Interface JoinColumns


@Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface JoinColumns
Specifies the mapping for composite foreign keys. This annotation groups JoinColumn annotations for the same relationship.

Each JoinColumn annotation must explicit specify both name and referencedColumnName.

Example:

@ManyToOne
@JoinColumns({
    @JoinColumn(name = "ADDR_ID", referencedColumnName = "ID"),
    @JoinColumn(name = "ADDR_ZIP", referencedColumnName = "ZIP")})
public Address getAddress() { return address; }
Since:
1.0
See Also: