Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-146

If in the Java Source tree, Entity plugin should default to current directory

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 1.0.0.Alpha4
    • 1.0.0.Alpha3
    • Builtin Plugins
    • None

    Description

      [jbw2011] as7 $
      [jbw2011] as7 $ entity --named Jason
      ? In which package you'd like to create this @Entity, or enter for default: [org.jboss.jbw.demos.domain]

      Default to the current directory if under JavaSourceFacet.getSourceFolders(...)

      – Concept

         @DefaultCommand(help = "Create a JPA @Entity")
         public void newEntity(
                  @Option(required = true,
                           name = "named",
                           description = "The @Entity name") final String entityName) throws FileNotFoundException
         {
            // TODO this should accept a qualified name as a parameter instead of
            // prompting for the package later
            PersistenceFacet jpa = project.getFacet(PersistenceFacet.class);
            JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);
      
            String entityPackage = shell.promptCommon(
                     "In which package you'd like to create this @Entity, or enter for default:",
                     PromptType.JAVA_PACKAGE, jpa.getEntityPackage());

      If

       java.getBasePackageResource()

      is a parent of

        shell.getCurrentDirectory()

      Prompt to use the current directory, otherwise do the current prompt

      Attachments

        Activity

          People

            jporter@redhat.com Jason Porter
            lincolnthree Lincoln Baxter III (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: