cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Loiko Dima (JIRA)" <>
Subject [jira] Updated: (CAY-1220) A function to auto-map the DB relationships
Date Mon, 31 Aug 2009 11:06:32 GMT


Loiko Dima updated CAY-1220:

    Attachment: combo_3.txt

> A function to auto-map the DB relationships
> -------------------------------------------
>                 Key: CAY-1220
>                 URL:
>             Project: Cayenne
>          Issue Type: Task
>          Components: CayenneModeler GUI
>    Affects Versions: 3.0M5
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>         Attachments: cay-1220.txt, combo.txt, combo1.txt, combo2.txt, combo_3.txt, inferCombo.txt,
InferRelationships.txt, InferRelationships_2.1.txt
> (note that mapping Db to Obj relationships will be done via a separate Jira... This one
deals with DbRelationships only)
> We need to add a Modeler function that infers Db relationships in a given DataMap based
on the DbAttribute naming conventions. This can be implemented inside the Modeler for now,
although at some point later in the game we may extract the actual algorithm in the new cayenne-tools
> 1. Add a menu item called "Infer Relationships" and a corresponding action in the Modeler
under "Tools" below "Reengineer Database Schema". It should be active when a DataMap is selected
in the project model, and inactive otherwise.
> 2. When clicked, it should analyze the current DataMap, and infer relationships based
on the naming conventions (see below). A dialog is presented to the user with all relationships
that are about to be created listed with checkboxes (initially all checked), allowing user
to uncheck individual relationships. Buttons in the bottom should be "Cancel" and "Create".
Dialog look can be borrowed from Class Generation -> Entities (of course with different
columns), with the "check all" checkbox on top.
> 3. Algorithm for inferring the relationships should take into account the existing relationships
over the same keys (i.e. avoid creating duplicates). 
> 4. Mapping 1..N:  Primary key column (to-one part) should be mapped explicitly. To detect
a foreign key use the following naming convention: column name should be "tablename_id", where
"tablename" is a DbEntity name.
> 5. Mapping 1..1: If the foreign key is also the only PK, map the relationship as 1..1.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message