I don't have any error message, but when I run the code below
Code:
Configuration cfg = new Configuration().addClass(User.class)
.addClass(Model.class);
SessionFactory sessions = cfg.buildSessionFactory();
// Cannot go to the next step, instead go to the exception.
Session session = sessions.openSession();
Seems like I cannot build the sessionFactory.
Actually, I use MiddleGen to generate the *.hbm.xml and then use HBM2JAVA tools to generate the java codes-- User.java and Model.java
Do I need to modify anything for those java files or xml?
my database is MySQL 4.18, and the Table primary key is auto_increment.
So I modify the hbm.xml file from " <generator class="identity" />" To "<generator class="identity" />"
Anybody has any idea what wrong I have?
Thanks a millions.