Details
-
Enhancement
-
Resolution: Done
-
Major
-
1.0.0.Alpha3
-
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