Announcement Announcement Module
No announcement yet.
'new' command with enums and @Service Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 'new' command with enums and @Service

    hi all..

    am I able to generate a class that has the @Service annotation? using the 'new' command, i don't see a path that has this capability.

    also, same question for enums. is there a way to generate enums?


  • #2
    At this stage we do not have Roo commands to create @Service types nor enums. You can create an empty Java source file, though, with "new java file" and "new test file", depending whether you prefer the created file to be in the SRC_MAIN_JAVA or SRC_TEST_JAVA directories respectively.

    You're invited to add new enhancement requests to our Jira issue tracker if you'd like inbuilt support for creating @Service classes and enums. You can add issues at

    One of the considerations with a "new java enum" command is the likelihood of an associated request for an "add enum constant" command so that people can build their enums via Roo scripts. In this case there will also likely need to be an "add field enum jpa" so you end up with an @Enumerated(EnumType.ORDINAL) or @Enumerated(EnumType.ORDINAL) or @Enumerated(EnumType.STRING) annotated on that field.

    There are fewer considerations for the "new java service" command. We have recently added JMS and email support and these seem logical commands to be used in combination with "new java service".


    • #3
      thanks Ben...

      great work on the jms and email. looking forward to those feature. i like your thinking in regards to enum support. right now, i'd prefer web flow support before service/emum. i noticed there's a jira for that.

      i'll add the enum and service features to jira...mainly for tracking purposes..

      appreciate the hard work..looking forward to the next release...



      • #4
        Thanks for the suggestions.

        Personally I would create an @Service by hand and wouldn't see much value unless there were value adds like JMS.

        I see more value in Enums because they are so verbose.

        In general, a consideration is whether Roo should be duplicating functionality that exists satisfactorily in the IDE, like one-way generation of Java constructs.