I have some basic questions:
1) How many xml files involved in JPA+Hibernate combination, if JPA annotations were used? i am having just persistence.xml.
2) Is hibernate.cfg.xml needed, if i use JPA annotaions. Because, i didnt added it till now.
3) Shall anyone give me the list of basic JAR file names, in case of using JPA 2.0 & Hibernate!!!
Thanks!
Usually this one file is enough, annotated entities will be automatically picked up through class path scanning. But you can define external mapping files (an example is available on this page). The mechanism is this:
hibernate.cfg.xml is proprietary hibernate stuff and not needed for jpa.
In JPA, you can use
<properties>to configure vendor-specific properties. Example:See this document for Hibernate / JPA configuration
you should use maven and add this dependency to your pom.xml:
(see this directory for the latest version, scan this file for the latest occurrence of
*.*.*-Finalor just read the Hibernate web site)You will also need to add the JBoss repository to the pom.xml or settings.xml:
that will automatically add everything else that’s needed, see this previous answer for more details.
If you don’t want to use maven, you can use the release bundles provided by sourceforge.