Skip to content

One to One: Whats generated?

Ravi Teja Gudapati edited this page Jun 26, 2019 · 2 revisions

For Parent model

Preload methods

For Parent model, preload and preloadAll methods are generated to load child into the fields annotated with Relation annotation.

Cascade

Methods insert, insertMany, update, updateMany, upsert, upsertMany, find and remove methods get cascade parameter to control if the operations are cascaded into the related child record.

Associate

update method gets associate parameter.

For Child model

Find by parent

findByParent method is generated to find a child given the foreign key.

Remove by parent

removeByParent method is generated to remove a child given the foreign key.

Associate

associateParent method is generated to associate the child to the parent.