annotation Athena::ORM::Annotations::JoinTable
#
Configures the join table of the owning side of a AORMA::ManyToMany association.
Without it, the join table is named after the classes of both sides, without their namespaces, in snake case and joined by an underscore; e.g. user_group.
@[AORMA::ManyToMany]
@[AORMA::JoinTable(name: "users_groups")]
@[AORMA::JoinColumn(name: "user_id", referenced_column_name: "id")]
@[AORMA::InverseJoinColumn(name: "group_id", referenced_column_name: "id")]
property groups : AORM::Collection(Group) = AORM::ArrayCollection(Group).new
The join table's columns are configured with AORMA::JoinColumn for the columns referencing this entity, and AORMA::InverseJoinColumn for those referencing the target entity.
Configuration#
Optional Arguments#
name#
Type: String? Default: the class names of both sides in snake case
The name of the join table. Wrap it in backticks if it needs to be quoted, see Quoting Reserved Words.
schema#
Type: String? Default: nil
The name of the schema the join table is in.