Support for Gorm Entities with same name, but different packages#15036
Support for Gorm Entities with same name, but different packages#15036jdaugherty merged 25 commits intoapache:7.0.xfrom
Conversation
jdaugherty
left a comment
There was a problem hiding this comment.
We need to add tests for this to merge it.
|
@jdaugherty the scaffolding plugin doesn't have any tests? Do you know of any? This is a fix. If there are no existing tests, it is better to merge than to leave broken, no? |
|
@codeconsole We should add a functional test project. DomainServiceLocator appears more complex than it should be. How do we know an existing workflow didn't break without a test? |
I've simplified it to its original intent. It now just only uses services of type GormService
RestfulServiceController is a new class that is just an example of the Service Layer pattern. There are no existing workflows and it would be silly to just add 1 test to the entire plugin that only tests this. |
jdaugherty
left a comment
There was a problem hiding this comment.
I've added this to Wednesday's developer meeting to see where people stand on this. I tried to point out in the review some possible problem points. I'm not 100% sure if it would cause compilation issues - but if it does we have to agree to do another RC.
grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/DomainServiceLocator.java
Show resolved
Hide resolved
grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/DomainServiceLocator.java
Show resolved
Hide resolved
grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/RestfulServiceController.groovy
Show resolved
Hide resolved
grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/DomainServiceLocator.java
Show resolved
Hide resolved
|
For the scaffolding functional tests, the following existing test projects are a good place to copy as a quick starting point. These all use Geb w/ TestContainers. https://github.com/apache/grails-core/tree/7.0.x/grails-test-examples/geb |
@jamesfredley are there already functional tests for the scaffolding plugin in those examples? Where exactly are you saying to put it? |
380c117 to
e48f971
Compare
|
I took the app you created at https://github.com/codeconsole/scaffold-app and integrated it under grails-test-examples/scaffolding. I added a test to invoke the user/index and it works correctly.
|
|
@jdaugherty you missed codeconsole/scaffold-app@60cc372 |
|
@jamesfredley can you please review? |

Currently RestfulServiceController will not work for situations where you have domain objects with the same name.
This scenario is more likely for complex websites that use plugins with domain objects.
For instance:
This introduces a fix that will resolve the appropriate service class for the respective GormService