[jira] Created: (MODELLO-211) Add support for Java annotations, default imports, improve/finish JPA plugin

View: New views
4 Messages — Rating Filter:   Alert me  

[jira] Created: (MODELLO-211) Add support for Java annotations, default imports, improve/finish JPA plugin

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Add support for Java annotations, default imports, improve/finish JPA plugin
----------------------------------------------------------------------------

                 Key: MODELLO-211
                 URL: http://jira.codehaus.org/browse/MODELLO-211
             Project: Modello
          Issue Type: New Feature
          Components: modello-core, modello-plugin-java, modello-test, sandbox
    Affects Versions: 1.0.1
            Reporter: Ludovic Maître
         Attachments: global.diff, JAnnotations.java, jsonapps-2.tar.bz2

Hi all!

I was in need to generate Java annotations from Modello model files, so i have done a patch for this, which impact a lot of classes i'm afraid. It works well and now i can generate JPA, JAXB, JAX-RS and any other annotations from my modello files. Could you take a look at it and include it in modello if it is ok ?

I also attach a sample application (jsonapps) where the subproject jsonapps-model contain an improved modello model which generate an enhanced model. Cumulated with the finition of the JPA plugin it allow to generate a near fully fonctionnal persistence layer. (you should disable the "argo2modello" plugin from the pom of jsonapps-model if you test it).

To test:
mkdir ModelloWork
cd ModelloWork/
svn co http://svn.codehaus.org/modello/trunk/ modello
cd modello/
svn co http://svn.codehaus.org/modello/modello-plugins-sandbox/trunk/ modello-plugins-sandbox
cp mypathto/global.diff .
patch<global.diff
cp mypathto/JAnnotations.java modello-plugins/modello-plugin-java/src/main/java/org/codehaus/modello/plugin/java/javasource/
mvn install

Thanks,

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (MODELLO-211) Add support for Java annotations, default imports, improve/finish JPA plugin

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/MODELLO-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=183677#action_183677 ]

Ludovic Maître commented on MODELLO-211:
----------------------------------------

Also i forgot to say that the patch also add a <modifiers><modifier>public</modifier></modifiers> element to fields (perhaps it is a mistake and it already exist this feature in the Java plugin - but i have added it at the Model(Field) level). Now if only i could find a job where this work on modello could be useful :-)

> Add support for Java annotations, default imports, improve/finish JPA plugin
> ----------------------------------------------------------------------------
>
>                 Key: MODELLO-211
>                 URL: http://jira.codehaus.org/browse/MODELLO-211
>             Project: Modello
>          Issue Type: New Feature
>          Components: modello-core, modello-plugin-java, modello-test, sandbox
>    Affects Versions: 1.0.1
>            Reporter: Ludovic Maître
>         Attachments: global.diff, JAnnotations.java, jsonapps-2.tar.bz2
>
>
> Hi all!
> I was in need to generate Java annotations from Modello model files, so i have done a patch for this, which impact a lot of classes i'm afraid. It works well and now i can generate JPA, JAXB, JAX-RS and any other annotations from my modello files. Could you take a look at it and include it in modello if it is ok ?
> I also attach a sample application (jsonapps) where the subproject jsonapps-model contain an improved modello model which generate an enhanced model. Cumulated with the finition of the JPA plugin it allow to generate a near fully fonctionnal persistence layer. (you should disable the "argo2modello" plugin from the pom of jsonapps-model if you test it).
> To test:
> mkdir ModelloWork
> cd ModelloWork/
> svn co http://svn.codehaus.org/modello/trunk/ modello
> cd modello/
> svn co http://svn.codehaus.org/modello/modello-plugins-sandbox/trunk/ modello-plugins-sandbox
> cp mypathto/global.diff .
> patch<global.diff
> cp mypathto/JAnnotations.java modello-plugins/modello-plugin-java/src/main/java/org/codehaus/modello/plugin/java/javasource/
> mvn install
> Thanks,

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (MODELLO-211) Add support for Java annotations, default imports, improve/finish JPA plugin

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/MODELLO-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=183692#action_183692 ]

Herve Boutemy commented on MODELLO-211:
---------------------------------------

Hi Ludovic,

I had a look at your patch: pfew, a lot of things!
In fact, a lot too much in one single Jira issue and one patch, IMHO: it should be split in one Jira issue per feature, with corresponding focused patch.

I suggest you to begin with MODELLO-181, adding annotation generation capability to javasource and using it to generate @SuppressWarning.

Then, here are a few comments on the patch content:
- please use Modello coding style, which is [Maven one|http://maven.apache.org/developers/conventions/code.html]: no tabs, space after and before braces, ...
- if you add an element in Modello model, please update [modello.mdo|http://modello.codehaus.org/modello.html] with proper description to explain the feature

Thanks for your interest in Modello

> Add support for Java annotations, default imports, improve/finish JPA plugin
> ----------------------------------------------------------------------------
>
>                 Key: MODELLO-211
>                 URL: http://jira.codehaus.org/browse/MODELLO-211
>             Project: Modello
>          Issue Type: New Feature
>          Components: modello-core, modello-plugin-java, modello-test, sandbox
>    Affects Versions: 1.0.1
>            Reporter: Ludovic Maître
>         Attachments: global.diff, JAnnotations.java, jsonapps-2.tar.bz2
>
>
> Hi all!
> I was in need to generate Java annotations from Modello model files, so i have done a patch for this, which impact a lot of classes i'm afraid. It works well and now i can generate JPA, JAXB, JAX-RS and any other annotations from my modello files. Could you take a look at it and include it in modello if it is ok ?
> I also attach a sample application (jsonapps) where the subproject jsonapps-model contain an improved modello model which generate an enhanced model. Cumulated with the finition of the JPA plugin it allow to generate a near fully fonctionnal persistence layer. (you should disable the "argo2modello" plugin from the pom of jsonapps-model if you test it).
> To test:
> mkdir ModelloWork
> cd ModelloWork/
> svn co http://svn.codehaus.org/modello/trunk/ modello
> cd modello/
> svn co http://svn.codehaus.org/modello/modello-plugins-sandbox/trunk/ modello-plugins-sandbox
> cp mypathto/global.diff .
> patch<global.diff
> cp mypathto/JAnnotations.java modello-plugins/modello-plugin-java/src/main/java/org/codehaus/modello/plugin/java/javasource/
> mvn install
> Thanks,

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (MODELLO-211) Add support for Java annotations, default imports, improve/finish JPA plugin

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/MODELLO-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=183718#action_183718 ]

Ludovic Maître commented on MODELLO-211:
----------------------------------------

Hi Hervé,

Thanks for your quick review, i have opened 3 separate issues :
- for the changes in the test classes to support various java versions: MODELLO-212,
- for the default imports feature (required to import the annotations packages) : MODELLO-213,
- for the annotations themselves (and the modifier field on fields) : MODELLO-214.
I cannot separate more the issues because some impact the same files.

For the coding style i have adjusted my Eclipse configuration and now the code should be ok, i have reviewed each file one by one to check that there is no unneeded difference with the original code source, it should be ok, let me know.

For updating modello.mdo, well i don't really know how to do : i think there is nothing to do for the default imports (it is a ModelDefault so the tags are already defined in modello.mdo), and for the annotation as i have no class i'm wondering if this suffice:

        <field>
          <name>annotations</name>
          <version>1.0.0</version>
          <association>
            <type>String</type>
            <multiplicity>*</multiplicity>
          </association>
          <description>
            A list of annotations for this base element.
          </description>
        </field>    ?
If it's the case i will submit a patch in the issue MODELLO-214.

Regarding MODELLO-181, i have left a comment in it,

Thanks to you and the modello team to give to the community a good tool like this,
Best regards,


> Add support for Java annotations, default imports, improve/finish JPA plugin
> ----------------------------------------------------------------------------
>
>                 Key: MODELLO-211
>                 URL: http://jira.codehaus.org/browse/MODELLO-211
>             Project: Modello
>          Issue Type: New Feature
>          Components: modello-core, modello-plugin-java, modello-test, sandbox
>    Affects Versions: 1.0.1
>            Reporter: Ludovic Maître
>         Attachments: global.diff, JAnnotations.java, jsonapps-2.tar.bz2
>
>
> Hi all!
> I was in need to generate Java annotations from Modello model files, so i have done a patch for this, which impact a lot of classes i'm afraid. It works well and now i can generate JPA, JAXB, JAX-RS and any other annotations from my modello files. Could you take a look at it and include it in modello if it is ok ?
> I also attach a sample application (jsonapps) where the subproject jsonapps-model contain an improved modello model which generate an enhanced model. Cumulated with the finition of the JPA plugin it allow to generate a near fully fonctionnal persistence layer. (you should disable the "argo2modello" plugin from the pom of jsonapps-model if you test it).
> To test:
> mkdir ModelloWork
> cd ModelloWork/
> svn co http://svn.codehaus.org/modello/trunk/ modello
> cd modello/
> svn co http://svn.codehaus.org/modello/modello-plugins-sandbox/trunk/ modello-plugins-sandbox
> cp mypathto/global.diff .
> patch<global.diff
> cp mypathto/JAnnotations.java modello-plugins/modello-plugin-java/src/main/java/org/codehaus/modello/plugin/java/javasource/
> mvn install
> Thanks,

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email