This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A question about Hibernate. About getting data out.

 
George Ren
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, everyone.
I use find method in Session class and returns a list of objects. I use a for loop to get the data in objects out. But when running, it is also throws a null pointer exception. I am confused...

the code is something like this:

I think the exception is thrown by
users[i] = (UserInfo)list.get(i);

but I can't find anything wrong in it.

Please help...Thanks a lot!
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That makes sense. You are trying to use two arrays which you have not initialized.

users[] is null. And so is rowData[][].
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic