You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "priyanka (JIRA)" <ji...@apache.org> on 2011/05/19 14:39:47 UTC

[jira] [Commented] (CAY-1384) Modeler: migration should check existing relationships

    [ https://issues.apache.org/jira/browse/CAY-1384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13036156#comment-13036156 ] 

priyanka commented on CAY-1384:
-------------------------------

// ResolveDbRelationshipDialog.java ---->   save() 


if (!validateName(relationship.getSourceEntity(), relationship, sourceEntityName)) {
            //return;
            sourceEntityName="to"+sourceEntityName;
            JOptionPane.showMessageDialog(
                    this,
                    "There is an existing relationship name ,so created with this relationship \""
                            + sourceEntityName
                            + "\" name.");
            sourceObjEntityName=sourceEntityName;
        }


 // check if reverse name is valid

        DbJoinTableModel model = (DbJoinTableModel) table.getModel();
        boolean updatingReverse = model.getObjectList().size() > 0;

        if (updatingReverse
                && !validateName(
                        relationship.getTargetEntity(),
                        reverseRelationship,
                        targetEntityName)) {
            //return;

            targetEntityName="to"+targetEntityName;
            JOptionPane.showMessageDialog(
                    this,
                    "There is an existing reverse relationship name ,so created with this reverse relationship \""
                            + targetEntityName
                            + "\" name.");
            targetObjEntityName=targetEntityName;
        }



> Modeler: migration should check existing relationships
> ------------------------------------------------------
>
>                 Key: CAY-1384
>                 URL: https://issues.apache.org/jira/browse/CAY-1384
>             Project: Cayenne
>          Issue Type: Bug
>    Affects Versions: 3.1M1
>            Reporter: Andrey Razumovsky
>
> Migration should be smarter at adding new relationships to model. E.g. I have Artist and Painting with rel toArtist. Now I add new column ARTIST_NEW_ID to database, and do migrate. It fails, because auto-generate relationship with name "toArtist" already exists. We should check it and insert it with name "toArtist2"

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira