<commit_before>RFC 0096: Foreign key relations
========================================================================
$Id$

@authors: friebe, wagner
@created: Sun Dec 17 18:22:48     2006
@status: draft
@category: rdbms

Scope of Change
---------------
The DataSet classes will be enhanced to know about
- foreign keys.
- foreign keys, they are target of.


Rationale
---------
- Easy access to related data
- Create "Rails-like" applications


Functionality
-------------

The DataSet Class Generator has also collect data about foreign keys.
Therefor the database adapter classes have to be rewritten.

A naming strategy is necessary to avoid collisions. Also, the nameing
strategy has to be replaceable.

With this two problems solved you can generate access methods for each
of a DataSet's related DataSet.

usage example
~~~~~~~~~~~~~

<?php
  uses(    
    'rdbms.ConnectionManager',
    'de.schlund.db.rubentest.Department'
  );
<commit_msg>- add: code example<commit_after>RFC 0096: Foreign key relations
========================================================================
$Id$

@authors: friebe, wagner
@created: Sun Dec 17 18:22:48     2006
@status: draft
@category: rdbms

Scope of Change
---------------
The DataSet classes will be enhanced to know about
- foreign keys.
- foreign keys, they are target of.


Rationale
---------
- Easy access to related data
- Create "Rails-like" applications


Functionality
-------------

The DataSet Class Generator has also collect data about foreign keys.
Therefor the database adapter classes have to be rewritten.

A naming strategy is necessary to avoid collisions. Also, the nameing
strategy has to be replaceable.

With this two problems solved you can generate access methods for each
of a DataSet's related DataSet.

Advantage
~~~~~~~~~

former code:
<?php
  $chief= Person::getPersonById(Department::getDepartmentById(1)->getChief_id());
?>

new code:
<?php
  $chief= Department::getDepartmentById(1)->getDepartmentChief();
?>




usage example
~~~~~~~~~~~~~

<?php
  uses(    
    'rdbms.ConnectionManager',
    'de.schlund.db.rubentest.Department'
  );

{'fraction_non_alphanumeric': 0.1834040546911834, 'fraction_numerical': 0.01603017444601603, 'mean_word_length': 3.8558352402745997, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '758445', 'n_tokens_mistral': 624, 'n_tokens_neox': 569, 'n_words': 230}