You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Victor Antonovich (JIRA)" <ji...@apache.org> on 2010/05/24 15:42:23 UTC

[jira] Created: (CAY-1434) Different destDir for generated superclasses

Different destDir for generated superclasses
--------------------------------------------

                 Key: CAY-1434
                 URL: https://issues.apache.org/jira/browse/CAY-1434
             Project: Cayenne
          Issue Type: Improvement
          Components: Core Library
    Affects Versions: 3.1M1
            Reporter: Victor Antonovich
         Attachments: superclass_destdir.patch

In some cases classes and superclasses should be generated to different directories. In example, superclasses should be generated to /target/generated-classes out of SCM scope, while subclasses are stored in main source tree (/src/main/java) under version control.

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


[jira] Issue Comment Edited: (CAY-1434) Different destDir for generated superclasses

Posted by "Victor Antonovich (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870615#action_12870615 ] 

Victor Antonovich edited comment on CAY-1434 at 5/24/10 10:26 AM:
------------------------------------------------------------------

Yes, in Eclipse IDE source folder adding is as simple as one click to "Use as source folder" in context menu so I think it's minor problem. Storing superclasses in SCM seems to me inefficient  because changes are allowed only to subclasses, and continuous touching of generated subclasses in main sources root lead to extra data on commits and serious merging problems after schema changing by other developers.

      was (Author: kapyar):
    Yes, in Eclipse IDE source folder adding is as simple as one click to "Use as source folder" in context menu so I think it's minor problem. Storing superclasses in SCM seems to me inefficient  because changes are allowed only to subclasses, and continuous touching of generated subclasses in main sources root lead to extra data on commits and serious merging problems after schema changing by other developer.
  
> Different destDir for generated superclasses
> --------------------------------------------
>
>                 Key: CAY-1434
>                 URL: https://issues.apache.org/jira/browse/CAY-1434
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>    Affects Versions: 3.1M1
>            Reporter: Victor Antonovich
>         Attachments: superclass_destdir.patch
>
>
> In some cases classes and superclasses should be generated to different directories. In example, superclasses should be generated to /target/generated-classes out of SCM scope, while subclasses are stored in main source tree (/src/main/java) under version control.

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


[jira] Commented: (CAY-1434) Different destDir for generated superclasses

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870646#action_12870646 ] 

Andrus Adamchik commented on CAY-1434:
--------------------------------------

> after removing generated classes from Subversion repository

that's the key. Why would you do that?


> Different destDir for generated superclasses
> --------------------------------------------
>
>                 Key: CAY-1434
>                 URL: https://issues.apache.org/jira/browse/CAY-1434
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>    Affects Versions: 3.1M1
>            Reporter: Victor Antonovich
>         Attachments: superclass_destdir.patch
>
>
> In some cases classes and superclasses should be generated to different directories. In example, superclasses should be generated to /target/generated-classes out of SCM scope, while subclasses are stored in main source tree (/src/main/java) under version control.

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


[jira] Commented: (CAY-1434) Different destDir for generated superclasses

Posted by "Victor Antonovich (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870615#action_12870615 ] 

Victor Antonovich commented on CAY-1434:
----------------------------------------

Yes, in Eclipse IDE source folder adding is as simple as one click to "Use as source folder" in context menu so I think it's minor problem. Storing superclasses in SCM seems to me inefficient  because changes are allowed only to subclasses, and continuous touching of generated subclasses in main sources root lead to extra data on commits and serious merging problems after schema changing by other developer.

> Different destDir for generated superclasses
> --------------------------------------------
>
>                 Key: CAY-1434
>                 URL: https://issues.apache.org/jira/browse/CAY-1434
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>    Affects Versions: 3.1M1
>            Reporter: Victor Antonovich
>         Attachments: superclass_destdir.patch
>
>
> In some cases classes and superclasses should be generated to different directories. In example, superclasses should be generated to /target/generated-classes out of SCM scope, while subclasses are stored in main source tree (/src/main/java) under version control.

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


[jira] Commented: (CAY-1434) Different destDir for generated superclasses

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870617#action_12870617 ] 

Andrus Adamchik commented on CAY-1434:
--------------------------------------

> Yes, in Eclipse IDE source folder adding is as simple as one click to "Use as source folder" in context menu so I think it's minor problem. 

and then later when you do "mvn clean" from command line, Eclipse will get seriously upset.

> Storing superclasses in SCM seems to me inefficient because changes are allowed only to subclasses, 
> and continuous touching of generated subclasses in main sources root lead to extra data on commits 
> and serious merging problems after schema changing by other developers.

Wait a minute. Why would " continuous touching of generated subclasses" occur? It only happens when the model changes. Even if you run cgen multiple times over the same model, it would generate the same sources over and over, so no SCM commit will happend. From my long experience this is never a problem.


> Different destDir for generated superclasses
> --------------------------------------------
>
>                 Key: CAY-1434
>                 URL: https://issues.apache.org/jira/browse/CAY-1434
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>    Affects Versions: 3.1M1
>            Reporter: Victor Antonovich
>         Attachments: superclass_destdir.patch
>
>
> In some cases classes and superclasses should be generated to different directories. In example, superclasses should be generated to /target/generated-classes out of SCM scope, while subclasses are stored in main source tree (/src/main/java) under version control.

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


[jira] Commented: (CAY-1434) Different destDir for generated superclasses

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870610#action_12870610 ] 

Andrus Adamchik commented on CAY-1434:
--------------------------------------

while I do not mind adding this for completeness, the specific example cited seems unusual... How do you prevent your IDE from complaining when subclasses have no superclass? Mapping target/generated-classes as a source folder?

> Different destDir for generated superclasses
> --------------------------------------------
>
>                 Key: CAY-1434
>                 URL: https://issues.apache.org/jira/browse/CAY-1434
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>    Affects Versions: 3.1M1
>            Reporter: Victor Antonovich
>         Attachments: superclass_destdir.patch
>
>
> In some cases classes and superclasses should be generated to different directories. In example, superclasses should be generated to /target/generated-classes out of SCM scope, while subclasses are stored in main source tree (/src/main/java) under version control.

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


[jira] Commented: (CAY-1434) Different destDir for generated superclasses

Posted by "Victor Antonovich (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870640#action_12870640 ] 

Victor Antonovich commented on CAY-1434:
----------------------------------------

> and then later when you do "mvn clean" from command line, Eclipse will get seriously upset. 
Yes, but next "mvn compile" will make Eclipse happy again. :)

> Wait a minute. Why would " continuous touching of generated subclasses" occur? It only happens when the model changes. Even if you run cgen multiple times over the same model, it would generate the same sources over and over, so no SCM commit will happend. From my long experience this is never a problem. 

We had serious problems with working copies after removing generated classes from Subversion repository.  `svn update` checks timestamp of files in working copy, so touched by cgen subclasses are treated by subversion as changed and never removed from filesystem. Manually removing of stale generated classes was really pain, especially on remote working copies in CI system.

> Different destDir for generated superclasses
> --------------------------------------------
>
>                 Key: CAY-1434
>                 URL: https://issues.apache.org/jira/browse/CAY-1434
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>    Affects Versions: 3.1M1
>            Reporter: Victor Antonovich
>         Attachments: superclass_destdir.patch
>
>
> In some cases classes and superclasses should be generated to different directories. In example, superclasses should be generated to /target/generated-classes out of SCM scope, while subclasses are stored in main source tree (/src/main/java) under version control.

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


[jira] Updated: (CAY-1434) Different destDir for generated superclasses

Posted by "Victor Antonovich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Victor Antonovich updated CAY-1434:
-----------------------------------

    Attachment: superclass_destdir.patch

Proposed patch add property superDestDir to ClassGenerationAction and CayenneGeneratorMojo. While undefined, this property defaults to destDir. Patch also add both destDir and superDestDir to Maven sources root.

> Different destDir for generated superclasses
> --------------------------------------------
>
>                 Key: CAY-1434
>                 URL: https://issues.apache.org/jira/browse/CAY-1434
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>    Affects Versions: 3.1M1
>            Reporter: Victor Antonovich
>         Attachments: superclass_destdir.patch
>
>
> In some cases classes and superclasses should be generated to different directories. In example, superclasses should be generated to /target/generated-classes out of SCM scope, while subclasses are stored in main source tree (/src/main/java) under version control.

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


[jira] Commented: (CAY-1434) Different destDir for generated superclasses

Posted by "Victor Antonovich (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870708#action_12870708 ] 

Victor Antonovich commented on CAY-1434:
----------------------------------------

Generally after some kind of refactoring,  for example, classes package name changing in Cayenne data domain schema.

> Different destDir for generated superclasses
> --------------------------------------------
>
>                 Key: CAY-1434
>                 URL: https://issues.apache.org/jira/browse/CAY-1434
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>    Affects Versions: 3.1M1
>            Reporter: Victor Antonovich
>         Attachments: superclass_destdir.patch
>
>
> In some cases classes and superclasses should be generated to different directories. In example, superclasses should be generated to /target/generated-classes out of SCM scope, while subclasses are stored in main source tree (/src/main/java) under version control.

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