Maybe my question is very basic, but regretfully I have very little experience with Java EE applications and little understanding of Hibernate.
I am developing a console Java application (that is not-Java EE application), for which I want to configure Hibernate to do the ORM to MySQL database I use for persistence of my data. However, I don’t know how to do that and was never able to find any source in the net about it.
So basically:
- I have downloaded and put in my buildpath
hibernate-jpa-2.0-api-1.0.1.Final.jar,hibernate3.jarandmysql-connector-java-5.1.19-bin.jarlibraries. - I know that I need
persistence.xmlfile to declare my persistence units. In an ordinary Java EE application this will reside insrc/META-INF/persistence.xml. However, I am not sure where should I place the file in the case of java console application. - I was never able to tell whether including the jars in the buildpath and adding the
persistence.xmlis enough to get me going with Hibernate, so please say if something else is needed.
I hope that somebody with more experience with Hibernate can help me get going.
Check this set of video tutorials: http://embedr.com/playlist/java-hibernate-tutorial
It will help.