Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Hibernate Confi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 16044 of 16078
Post > Topic >>

Hibernate Configuration.addClass(tableClass) and Session.createCriteria(tableClass)

by RC <raymond.chui@[EMAIL PROTECTED] > May 1, 2008 at 11:25 AM

I got run time error throw to NullPointerException
when I do
Configuration config = new Configuration();
config.addClass(myClassA.class).addClass(myClassB.class);

Why?

But I don't get any run time error when

do

SesstionFactory sf = config.buildSessionFactory();

Session session = sf.openSession();
List list = 
session.createCriteria(myClassA).createCriteria(myClassB).list();

Instead session.createCriteria, I would like to try

List list = session.createQuery("....").list();

But I get run time error in config.addClass().

How to resolve this problem?

Thank you in advance!




 1 Posts in Topic:
Hibernate Configuration.addClass(tableClass) and Session.createC
RC <raymond.chui@[EMAI  2008-05-01 11:25:28 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 23:18:35 CDT 2008.