ManyToOne
annotation in package klyn.data.mapping

    public annotation ManyToOne(
    fetch as FetchType = FetchType.EAGER,
    optional as Boolean = true,
    cascade as IList<CascadeType> = []
    )

ManyToOne

Declares a many-to-one entity relationship.

A many-to-one relationship is eager by default, matching JPA semantics. Set `fetch` to `FetchType.LAZY` when the target should be represented as an unloaded relationship until the entity framework loads it.

Example

    import klyn.data.mapping
    import klyn.data.sql

    @ManyToOne(
    fetch=FetchType.LAZY,
    optional=false,
    cascade=[CascadeType.PERSIST, CascadeType.MERGE]
    )
    @JoinColumn(name="customerId")
    public property customer as Customer