JoinColumns
annotationin packageklyn.data.sql
public annotation JoinColumns(
names as IList<String>,
referencedColumnNames as IList<String> = [],
nullable as Boolean = true
)
JoinColumns

Maps one relationship to an ordered group of relational join columns.

names and referencedColumnNames use the same order. Omitting referenced names binds the join columns to the target identity columns in their mapped order. This compact form declares multiple join columns without constructing annotation instances inside an annotation. An explicitly supplied nullable value also defines relationship optionality when the relationship annotation leaves optional unspecified. Supplying contradictory explicit values is a mapping error.

Example
@ManyToOne(optional=false)
@JoinColumns(
names=["orderId", "orderRevision"],
referencedColumnNames=["id", "revision"],
nullable=false
)
public property order as Order