[FIX] Fixed wrong relationship example
This commit is contained in:
parent
1b3e66d1dd
commit
e3280aeea0
1 changed files with 3 additions and 3 deletions
|
@ -154,15 +154,15 @@ with custom parameters (ex. `@HasOne(foreignKey: 'foreign_id')`).
|
||||||
@orm
|
@orm
|
||||||
abstract class _Author extends Model {
|
abstract class _Author extends Model {
|
||||||
@hasMany // Use the defaults, and auto-compute `foreignKey`
|
@hasMany // Use the defaults, and auto-compute `foreignKey`
|
||||||
List<Book> books;
|
List<_Book> books;
|
||||||
|
|
||||||
// Also supports parameters...
|
// Also supports parameters...
|
||||||
@HasMany(localKey: 'id', foreignKey: 'author_id', cascadeOnDelete: true)
|
@HasMany(localKey: 'id', foreignKey: 'author_id', cascadeOnDelete: true)
|
||||||
List<Book> books;
|
List<_Book> books;
|
||||||
|
|
||||||
@SerializableField(alias: 'writing_utensil')
|
@SerializableField(alias: 'writing_utensil')
|
||||||
@hasOne
|
@hasOne
|
||||||
Pen pen;
|
_Pen pen;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue