Hello all,
I am using torque b4, with Mssql and struts. I successfully generated om
objects, using the defaultIdMethod="none" and everything was fine. The
problem I ran into was that when I inserted a record into a table called
approgram, which has a primary key called ndx (autoincrement). The save was
successful, but when I try to retrieve the ndx right after calling the save,
I get a null pointer exception.

      approgram.setUserndx("1");
      approgram.save();
      System.out.println(approgram.getNdx().toString());        <-- Null pointer
exception right here.

Then I changed the defaultIdMethod="native" to see, if that will solve my
problem and I am getting the following error:

org.apache.torque.TorqueException: IdGenerator for table 'apProgram' is null
at com.adphobia.om.BaseApprogram.save(BaseApprogram.java:1405)
at com.adphobia.om.BaseApprogram.save(BaseApprogram.java:1382)
at com.adphobia.test.TestTorque.addProgram(TestTorque.java:46)
at com.adphobia.test.TestTorque.main(TestTorque.java:61)

Has anyone seen this. Is it possible to retreive the ndx, right after saving
it, without having to do another lookup. Any help is greatly appreciated.

Thanks,
Abbas.


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to