Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1491 Perform a review of Forge 2.x
  3. FORGE-1479

Explicitly setup in Bean Validation, not in JPA

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Done
    • Major
    • 2.1.0.Final
    • 2.0.0.CR2
    • UI - Shell
    • None

    Description

      Just after a creating a project, a create a new entity without setting up the persistence (jpa-setup) :

      ***SUCCESS*** Project named 'test' has been created.
      [test]$ jpa-new-entity --named Author
      [Author.java]$ jpa-new-field --named firstname --length 50
      ***SUCCESS*** Field firstname created
      

      This hasn't created a persistence.xml file. But on the other hand, if I want to add a constraint on the entity, I need to explicitelly setup Bean Validation :

      [Author.java]$ con
      connection-profile-create  connection-profile-remove  constraint-setup
      [Author.java]$ constraint-setup
      ***SUCCESS*** Bean Validation is installed.
      [Author.java]$ con
      connection-profile-create  connection-profile-remove  constraint-add  constraint-setup
      [Author.java]$ constraint-add --constraint NotNull --onProperty firstname
      ***SUCCESS*** Constraint NotNull successfully configured
      

      if most of the information is giving at project creation, do we still need to explicitly setup Java EE components ? At the moment we have the following :

      servlet-setup
      ejb-setup
      soap-setup
      cdi-setup
      jms-setup
      rest-setup
      jpa-setup
      faces-setup
      jstl-setup
      jta-setup
      constraint-setup
      

      Most of these commands do not have parameters (except for persistence, rest, validation). So why not activate them by default (or only if export ACCEPT_DEFAULTS=true ) ? Something like : "if the command constraint-add is entered, Forge would go if constraint is not setup, then I invoke constraint-setup", "if the command ejb-new is entered, Forge would go if ejb is not setup, then I invoke ejb-setup"

      That would save some bugs (developers forgetting to setup things), less typing and shorter scripts.

      Attachments

        Issue Links

          Activity

            People

              rhn-support-ggastald George Gastaldi
              agoncal Antonio Goncalves (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: