@Retention(CLASS) @Target({FIELD})

public @interface JoinColumn

Foreign key column on the owning table.

Methods

public abstract String name() default ""Names the foreign key column on the owning table.
public abstract boolean nullable() default trueAllows a null foreign key, subject to the association optional setting.

Method details

name

public abstract String name() default ""
Names the foreign key column on the owning table.

Returns

column name; empty derives it from the relationship name

nullable

public abstract boolean nullable() default true
Allows a null foreign key, subject to the association optional setting.

Returns

true by default