-
-
Notifications
You must be signed in to change notification settings - Fork 962
Support for Gorm Entities with same name, but different packages #15036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Gorm Entities with same name, but different packages #15036
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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