Hi all.
I am trying to set up Hibernate to work with Apache Derby (embedded mode), as well as Maven, and i'm a bit confused. Would be nice with some help from someone who has used this combination before. I have used Hibernate on another project, but never set it up, so it's all a bit confusing at the moment.
So far, I have set up the pom.xml of Maven to include Hibernate (using code i found online): <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>3.3.2.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> <version>3.4.0.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-commons-annotations</artifactId> <version>3.3.0.ga</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>3.4.0.GA</version> </dependency>
as well as using Derby:
<dependency> <groupId>org.apache.derby</groupId> <artifactId>derbyclient</artifactId> <version>10.4.2.0</version> </dependency>
I have also created a hibernate.cfg.xml file, containing the following properties:
<property name="connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property> <property name="connection.url">jdbc:derby;safetyinformation;</property> <property name="dialect">org.hibernate.dialect.DerbyDialect</property>
My questions at the moment are:
What folder should i put the hibernate.cfg.xml file in? (I'm using eclipse, right now it is in the project root.)
I'm not sure if I can load the cfg file properly, since a simple test try { Configuration config = new Configuration(); } catch (Throwable ex) { System.err.println("ex.toString()); } yields "java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration"
Do I need to have the Derby db running seperatly in order to make this work?
Thanks in advance for any answers, i'll keeping hacking at it..
- Tobb
|