snusnu / ramom

relational algebra meets object mapping
MIT License
6 stars 0 forks source link

Provide a NaturalJoin field naming strategy #3

Closed snusnu closed 10 years ago

snusnu commented 10 years ago

Given the following mapper definition (depends on #2)

register :person do
  map :id,       , from: :person_id
  map :account_id, from: :account_id
  map :name,       from: :person_name
end

It should be possible to write it like this:

register :person do
  map :id
  map :account_id
  map :name
end

FK constraint definitions can be used to find out that the :account_id attribute must be mapped from: :account_id as compared to from: :person_account_id (which would be inferred using #2)

The NaturalJoin field naming strategy shall expose a neutral way of "skipping" some attributes from (re)naming which can later be injected by examining the FK constraints.