This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

toplink session readobject nullpointerexception

 
gilbert engle
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.setAttributeName("intValue");
somethingIntValueMapping.setGetMethodName("getIntValue");
somethingIntValueMapping.setSetMethodName("setIntValue"); // gotta have this!
somethingIntValueMapping.setFieldName("EGOV_IAC.SOMETHING.INTVALUE");
somethingIntValueMapping.readOnly();
descriptor.addMapping(somethingIntValueMapping);

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 agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic