permaculture playing cards
The moose likes Object Relational Mapping and the fly likes toplink session readobject nullpointerexception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "toplink session readobject nullpointerexception" Watch "toplink session readobject nullpointerexception" New topic

toplink session readobject nullpointerexception

gilbert engle

Joined: Jun 03, 2009
Posts: 24
toplink session readobject nullpointerexception

Are you looking for these keywords?

You will get a nullpointerexception from session.readObject if you don't include a setter method for your class.

DirectToFieldMapping somethingIntValueMapping = new DirectToFieldMapping();
somethingIntValueMapping.setSetMethodName("setIntValue"); // gotta have this!

When you call readObject this is a request to read an object from the database. It is required that you provide setter methods for ALL object data attributes so that the readObject method can do its job

Session.readObject should be able to detect this problem and give you a meaningful Exception to work with, but it does not. I spent a long time on this one!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: toplink session readobject nullpointerexception
It's not a secret anymore!