* Define a new hasOne relation. * @param name - The name of the hasOne relation. * @param definition - The definition of the hasOne relation.
(
name: string,
definition: Omit<HasOneDefinition, 'name' | 'type' | 'targetsMany'>,
)
| 211 | * @param definition - The definition of the hasOne relation. |
| 212 | */ |
| 213 | hasOne( |
| 214 | name: string, |
| 215 | definition: Omit<HasOneDefinition, 'name' | 'type' | 'targetsMany'>, |
| 216 | ): this { |
| 217 | const meta: HasOneDefinition = { |
| 218 | ...definition, |
| 219 | name, |
| 220 | type: RelationType.hasOne, |
| 221 | targetsMany: false, |
| 222 | }; |
| 223 | return this.addRelation(meta); |
| 224 | } |
| 225 | |
| 226 | /** |
| 227 | * Define a new hasMany relation. |
no test coverage detected