[Grails] GORM Embedded table column which declared as a member (property)

Normally member(property) would be mapped as a parent-child relationship, but uses embedded would be mapped as a one table.

Example:
Person has a Address object.

And Address class is like below.

Declare as a embedded property, Person table mapped as below.

  • id
  • home_address_number
  • home_address_code
  • work_address_number
  • work_address_code

Each column names are concatenated with _(an underscore) and the parent object name and the child object name.


http://grails.org/doc/latest/guide/GORM.html#gormComposition







Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.