The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Is persistence.xml required Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Is persistence.xml required" Watch "Is persistence.xml required" New topic

Is persistence.xml required

rakesh sugirtharaj
Ranch Hand

Joined: Dec 16, 2007
Posts: 151

I m new to EJB so this may sound naive. I see that the only required tag in persistence.xml is persistence unit with name and all others are optional. My question is, in such a case is persistence.xml file required? Should every project using JPA must have a persistence.xml?

Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3011

persistence.xml is required for setting a persistence unit on JPA.

Founder of ExamLab and Systemup
See how I can help you to become an awesome programmer
wood burning stoves
subject: Is persistence.xml required
Similar Threads
EJB3 DEployment descriptor
JBoss AS 7.1.0 + Hibernate 3
JPA - inject of EntityManager is always null
JPA - What is the use of persistence.xml
jpa problems