If you want a CMP field that can be null, use java.lang.Integer instead
of int.

Jeff

-----Original Message-----
From:   Eduardo Estefano
Sent:   Mon 4/9/2001 12:10 PM
To:     Orion-Interest
Cc:     
Subject:        Creating new CMP records

I have a CMP EJB that has a foreign key field in it (DepartmentID). This
field can be null (removed other fields for simplicity):

CREATE TABLE ACTIVITY ( 
  ACTIVITYID               NUMBER        NOT NULL, 
  DEPARTMENTID             NUMBER
)

The ActivityID and DepartmentID are class variables of the EJB.

I'm trying to create a record with no DepartmentID. But the value of the
DepartmentID is always 0 (zero) because ints default to 0. The end
result is
a constraint error because there is no department with ID=0.

My question: How can I tell orion to create the new record with a null
value
for DepartmentID instead of 0.

-----------------------------------------
Eduardo Estefano
Integrated Information Systems






winmail.dat

Reply via email to