Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Complete
-
1.2.0.RELEASE
-
None
Description
Found this while trying to replicate ROO-3010.
If you try to create a service in a different module to the one containing the relevant entity, the four service-related classes/ITDs are created in the module containing the entity, instead of the currently focused module. Here's a minimal script that demonstrates the problem:
project --topLevelPackage com.multi --packaging POM
module create --moduleName core --topLevelPackage com.multi.core
jpa setup --database HYPERSONIC_IN_MEMORY --provider HIBERNATE
entity jpa --class ~.Thing
field string name
module focus --moduleName ~
module create --moduleName services --topLevelPackage com.multi.serve
service --interface ~.ThingService --entity core|~.Thing
Here's the console output; note in the last five lines that the service's package and source files are created within the "core" module instead of the "services" module:
project --topLevelPackage com.multi --packaging POM
Created ROOT/pom.xml
module create --moduleName core --topLevelPackage com.multi.core
Created ROOT/core
Created ROOT/core/pom.xml
Created core|SPRING_CONFIG_ROOT
Created core|SPRING_CONFIG_ROOT/applicationContext.xml
Updated ROOT/pom.xml [added module core]
jpa setup --database HYPERSONIC_IN_MEMORY --provider HIBERNATE
Created core|SPRING_CONFIG_ROOT/database.properties
Updated core|SPRING_CONFIG_ROOT/applicationContext.xml
Created core|SRC_MAIN_RESOURCES/META-INF/persistence.xml
Updated core|ROOT/pom.xml [added dependencies org.hsqldb:hsqldb:1.8.0.10, org.hibernate:hibernate-core:3.6.8.Final, org.hibernate:hibernate-entitymanager:3.6.8.Final, org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final, org.hibernate:hibernate-validator:4.2.0.Final, javax.validation:validation-api:1.0.0.GA, cglib:cglib-nodep:2.2.2, javax.transaction:jta:1.1, org.springframework:spring-jdbc:${spring.version}, org.springframework:spring-orm:${spring.version}, commons-pool:commons-pool:1.5.6, commons-dbcp:commons-dbcp:1.3]
entity jpa --class ~.Thing
Created core|SRC_MAIN_JAVA/com/multi/core
Created core|SRC_MAIN_JAVA/com/multi/core/Thing.java
Created core|SRC_MAIN_JAVA/com/multi/core/Thing_Roo_Configurable.aj
Created core|SRC_MAIN_JAVA/com/multi/core/Thing_Roo_ToString.aj
Created core|SRC_MAIN_JAVA/com/multi/core/Thing_Roo_Jpa_ActiveRecord.aj
Created core|SRC_MAIN_JAVA/com/multi/core/Thing_Roo_Jpa_Entity.aj
field string name
Updated core|SRC_MAIN_JAVA/com/multi/core/Thing.java
Created core|SRC_MAIN_JAVA/com/multi/core/Thing_Roo_JavaBean.aj
module focus --moduleName ~
module create --moduleName services --topLevelPackage com.multi.serve
Created ROOT/services
Created ROOT/services/pom.xml
Created services|SPRING_CONFIG_ROOT
Created services|SPRING_CONFIG_ROOT/applicationContext.xml
Updated ROOT/pom.xml [added module services]
service --interface ~.ThingService --entity core|~.Thing
Created core|SRC_MAIN_JAVA/com/multi/serve
Created core|SRC_MAIN_JAVA/com/multi/serve/ThingService.java
Created core|SRC_MAIN_JAVA/com/multi/serve/ThingServiceImpl.java
Created core|SRC_MAIN_JAVA/com/multi/serve/ThingService_Roo_Service.aj
Created core|SRC_MAIN_JAVA/com/multi/serve/ThingServiceImpl_Roo_Service.aj