my dog learned polymorphism
The moose likes Object Relational Mapping and the fly likes How to add a  JPA project to Web Project? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How to add a  JPA project to Web Project?" Watch "How to add a  JPA project to Web Project?" New topic

How to add a JPA project to Web Project?

Marco Di Baggio
Ranch Hand

Joined: Apr 11, 2009
Posts: 35
Hi everyone,

I'm rather new to many things Java related. I recently have been reading up on JPA
and want to take advantage of the ability to reverse engineer the tables into JPA

I successfully created a JPA project that did this through the use of a online tutorial. I too
have an exiting web project (dynamic) that I would like to take advantage of the JPA project
and was wondering what is best practice.

Should I have my web project reference my JPA project or is there a way to create a Web project
that has JPA capabilities (specifically the reverse engineering)?

Thanks everyone
ntumba lobo
Ranch Hand

Joined: Oct 21, 2008
Posts: 180
I am assuming your are using Eclipse.
I would just create a web project and add JPA manually on top of it.
1)You will understand better the JPA components and how they work together
2) there is not much configuration anyway to make a project JPA enable. Merely persistence.xml to add to classpath amd pojo classes with annotations and that's about it.

My point of view is that using too much advanced tools hide a lot of details that you may need to know

I agree. Here's the link:
subject: How to add a JPA project to Web Project?
It's not a secret anymore!