7
|
I use EclipseLink, but configuration must be very similar. Here you have most important parts.
pom.xml:
persistence.xml:
applicationContext-dao.xml:
User.java:
UserDao.java:
UserService.java:
Hope it helps.
| ||
2
|
Alternatively Spring 3+ and JPA 2.0 can be integrated with the help of dynamic proxies.
You can find all the documentation and download example here
In this case interfaces with named JPA queries are used to execute queries. Interfaces are treated as ordinary Spring beans with the help of dynamic proxies. They can be injected (or autowired) into any other beans the same way.
Also queries can be located in separate orm-mapping.xml files and split up by domain (or at your convenience). That gives a high flexibility and maintainability to persistent layer.
| ||
1
|
I would suggest you take a look at Spring Roo, it creates a Spring web project together with the pom and all configuration files needed (e.g. JPA). And if you don't like Roo you can drop it and threat the project as usual Spring Web application. IMHO the fastest way to get a initial project setup.
|
No comments:
Post a Comment