via

Registers a reference as a field of the child entity class, which returns a parent object of this EntityClass, for use in many-to-many relations.

The reference should have been defined by the creation of a column using reference() on an intermediate table.

Parameters

table

The intermediate table containing reference columns to both child and parent objects.

Samples

org.jetbrains.exposed.sql.tests.shared.entities.EntityHookTestData.Userorg.jetbrains.exposed.sql.tests.shared.entities.EntityHookTestData.Cityorg.jetbrains.exposed.sql.tests.shared.entities.EntityHookTestData.UsersToCities

Registers a reference as a field of the child entity class, which returns a parent object of this EntityClass, for use in many-to-many relations.

The reference should have been defined by the creation of a column using reference() on an intermediate table.

Parameters

sourceColumn

The intermediate table's reference column for the child entity class.

targetColumn

The intermediate table's reference column for the parent entity class.

Samples

org.jetbrains.exposed.sql.tests.shared.entities.ViaTests.NodesTableorg.jetbrains.exposed.sql.tests.shared.entities.ViaTests.Nodeorg.jetbrains.exposed.sql.tests.shared.entities.ViaTests.NodeToNodes