Darren Hartford
2003-12-22 14:03:01 UTC
Hey all,
This was a kicker to find. Have a database, it contains a Numeric field that is NULLable. Use CMP to connect to a J2EE application but get NullPointer exceptions during execution.
Instead of defining the Numeric as a java.lang.Integer object in the Entity Bean, it was defined as an 'int'.
public abstract int getMyNumberField();
public abstract void setMyNumberField(int myNumberField);
Is there a way to quickly fix this (outside of changing the generated source code), Then a gameplan to take care of it in the future? I know on the J2EE/CMP side you 99% always want Objects in the EntityBean, not sure on JDO side though. Thanks, I'm suprised no one else has run into this!
-D
This was a kicker to find. Have a database, it contains a Numeric field that is NULLable. Use CMP to connect to a J2EE application but get NullPointer exceptions during execution.
Instead of defining the Numeric as a java.lang.Integer object in the Entity Bean, it was defined as an 'int'.
public abstract int getMyNumberField();
public abstract void setMyNumberField(int myNumberField);
Is there a way to quickly fix this (outside of changing the generated source code), Then a gameplan to take care of it in the future? I know on the J2EE/CMP side you 99% always want Objects in the EntityBean, not sure on JDO side though. Thanks, I'm suprised no one else has run into this!
-D