cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Loiko Dima (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CAY-1220) A function to auto-map the DB relationships
Date Thu, 11 Jun 2009 12:13:07 GMT

     [ https://issues.apache.org/jira/browse/CAY-1220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Loiko Dima updated CAY-1220:
----------------------------

    Attachment: InferRelationships_1.txt

> A function to auto-map the DB relationships
> -------------------------------------------
>
>                 Key: CAY-1220
>                 URL: https://issues.apache.org/jira/browse/CAY-1220
>             Project: Cayenne
>          Issue Type: Task
>          Components: CayenneModeler GUI
>    Affects Versions: 3.0M5
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>         Attachments: InferRelationships.txt, InferRelationships_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
project.
> 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.


Mime
View raw message