开发者

Groovy and Spring Integration with Maven

I am attempting to run an application. I have gmaven so it can build. Basically, I am trying to run a script everytime the application starts where it parses and XML file and populates a database using the existing data access objects. I am unclear of where I should pu开发者_StackOverflow社区t the script etc. Has anyone had experience regarding this? Not sure if it's relevant, but the project I am working on uses JPA.


Write a Groovy class, put it in some package below src/main/groovy, register it as a Spring bean, inject the DAO(s), and make sure that one of the methods of the Groovy class gets executed when the Spring container starts up (see Execute method on startup in Spring). Essentially no difference to how you would do it in Java.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜