0 Replies Latest reply on Apr 14, 2003 10:53 AM by robertfreeman

    nullable primitive types causing NullPointerException

    robertfreeman Newbie

      I've discovered that JBoss throws a NullPointerException for primitive mappings to nullable database columns. This issue was also raised in a previous post, http://jboss.org/thread.jsp?forum=47&thread=3744&message=251406&q=primitive#251406

      However, there was no discussion as to what the expected behavior is. I've found a code-fix in an old mailing list post, http://www.kpi.com.au/jbossarchive/0101/0122.html, but I'd prefer not to have to maintain my own version of JBoss for this.

      Here're my questions,

      (1) Is this the expected behavior of JBoss or is it considered a bug (i.e., should JBoss throw a NullPointerException for primitive mappings to nullable database columns)?

      (2) I've found a reference in the bug list to this problem, but the resolution is "will not fix" because the jaws.xml is no longer maintained. Does this imply that the mappings in jaws.xml can fix this, or did the resolver of this bug not understand the issue?

      (3) If this is the expected behavior of JBoss, can anyone shed light on why this decision was made?

      (4) Is there a preferred workaround for this? Should I map all nullable database columns to Objects and then translate them to primitives in my own code?

      I appreciate any insite anyone can provide.

      Thanks.