I want to implement a separate JPA layer or service which can be use in multiple projects. 开发者_运维知识库Currently i am doing two projects one desktop and one Web based application using spring 3.0 framework. I want to create one JPA layer which can be used in both projects.Please suggest me how can integrate a single JPA project with two spring based projects?
Thanks, Sandeep
Build the Persistence (perhaps even including the service layer) into an jar and use that in the other projects as dependency. This would be the common way. How to manage the dependency and build the artefacts depends on the build enviroment you use (IDE, ant,maven,..).
The persistence(service) jar can include a spring config, which you can include into the spring config of the desktop and web applications.
Perhaps you can write a bit more on what you tried and what did not work?
精彩评论