What you are looking for isn't supported through core Spring, but can be easily achieved through on of the spring projects, spcifically, Spring Roo. There are also 3rd party paid/free tools which you can take help from.
Once I used CodePro Analytix developed by Google probably in 3-4 years back. I don't know how much it is improved now, but it was amazing at that time.
https://developers.google.com/java-dev-tools/codepro/doc/