@Retention(value=RUNTIME) @Target(value=TYPE) public @interface BelongsTo
This annotation will do exactly the same as HasMany
, but is placed on a 'child' side of a relationship.
There is no need to add both HasMany
and BelongsTo
on the two related models. Just one is
fully sufficient.
HasMany
Modifier and Type | Required Element and Description |
---|---|
String |
foreignKeyName |
Class<? extends Model> |
parent |
Copyright © 2019 JavaLite. All rights reserved.