Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.databases > #50
| From | "RC" <rc@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Hibernate Configuration.a |
| Message-ID | <fvcnd8$g73$1@news.nems.noaa.gov> (permalink) |
| Newsgroups | comp.lang.java.databases |
| Date | 2011-04-27 15:21 +0000 |
| Organization | TDS.net |
To: comp.lang.java.databases,
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!
---
* Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.databases | Previous | Next | Find similar
Hibernate Configuration.a "RC" <rc@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
csiph-web