Hi
I’m using this plugin (
http://www.hibernate.org/255.html) to reverse engineer a MySQL database with eclipse. I’ve successfully create the DAO and VO classes, but when I try to use them from a simple application I keep getting this error:
Exception in thread "main" java.lang.IllegalStateException: Could not locate SessionFactory in JNDIjava.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType
I assume I’m missing a basic step, but cant figure out which. My intention is to use the JDBC driver, not the JNDI. This is my configuration file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.password">pass</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/pharma_backend</property>
<property name="hibernate.connection.username">user</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
</session-factory>
</hibernate-configuration>
Do I need to code a SessionFactory myself?
What am I missing?
Thanks
Gonzo