Weceem

Work out the optimal ORM mapping strategy for the content model

Details

  • Type: Improvement Improvement
  • Status: Committed Committed
  • Priority: Blocker Blocker
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: 1.2
  • Component/s: None
  • Labels:
    None
  • Request Controller:
    Please Select
  • External Supervisor:
    Please select
  • Executing Programmer:
    Please select

Description

The current table-per-hierarchy mapping is bad news - a single table for all types.

However turning this off in Grails leads to table-per-subclass mapping, which gives us a table for each and a column tying into the row in the ancestor class, but this makes the "children" (and parent?) association very expensive to query as there is an outer join for every content type.

The suggestion is that we introduce a new intermediary domain object:

class ContentReference {
       String fromClassName
       Long fromId

       String toClassName
       Long toId
}

The parent, children and VirtualContent.target associations would then be of this type, and we would hide the maintenance of this info from the end user with the eachChild tags etc. and helper methods on Content

Activity

Hide
Marc Palmer added a comment - 04/Feb/10 3:51 PM

Deferring this. We discussed it and decided that due to import/export features it is not so important how we do this, we could always change it in a later release

Show
Marc Palmer added a comment - 04/Feb/10 3:51 PM Deferring this. We discussed it and decided that due to import/export features it is not so important how we do this, we could always change it in a later release

People

Vote (0)
Watch (1)

Dates

  • Created:
    15/Dec/09 2:59 PM
    Updated:
    25/Aug/11 5:16 PM