Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Stored Procedure error

We have a stored Procedure call to a SQL Server database that is erroring
out. 
The primary key read from the row [DatabaseRecord(
	paramAgentNumber => XXXXXXXXX
	paramAgentSubcode => ZZZZZZZ
	paramInitials => ABC
	paramLastName => SOME
	paramFirstName => ONE
	paramEmail => SONE@xxxxxxx                                   
	paramReturn => null)] during the execution of the query was detected to be
null.  Primary keys must not contain null.

Which indicates that part of the primary key is returning null, specifically
paramReturn.  But the primary key does not include paramReturn.

Here is the call -

        final ReadObjectQuery readObjectQuery = new
ReadObjectQuery(CpUser.class);
        final StoredProcedureCall call = new StoredProcedureCall();
        call.setProcedureName("spMSIRetrieve");
        call.addNamedArgumentValue("paramBinarySession", argumentValue);
        call.addNamedOutputArgument(CpUserManagerImpl.PARAM_AGENT_NUMBER);
        call.addNamedOutputArgument(CpUserManagerImpl.PARAM_AGENT_SUBCODE);
        call.addNamedOutputArgument(CpUserManagerImpl.PARAM_INITIALS);
        call.addNamedOutputArgument("paramUserID");
        call.addNamedOutputArgument(CpUserManagerImpl.PARAM_LAST_NAME);
        call.addNamedOutputArgument(CpUserManagerImpl.PARAM_FIRST_NAME);
        call.addNamedOutputArgument(CpUserManagerImpl.PARAM_EMAIL);
        call.addNamedOutputArgument(CpUserManagerImpl.PARAM_RETURN);
        readObjectQuery.setCall(call);

        return (CpUser) getSession().executeQuery(readObjectQuery);

Here is the entity -

@Entity
public class CpUser extends BaseDomain {

    // Attributes
    @Id
    @Column(name = "paramUserID")
    private String userId;

    @Column(name = "paramInitials")
    private String initials;

    @Column(name = "paramBinarySession")
    private String binarySessionID;

    @Column(name = "paramFirstName")
    private String firstName;

    @Column(name = "paramLastName")
    private String lastName;

    @Column(name = "paramAgentNumber")
    private String producer;

    @Column(name = "paramAgentSubcode")
    private String contractNumber;

    @Column(name = "paramEmail")
    private String emailAddress;

    @Column(name = "paramReturn")
    private int result;

Any ideas on what is wrong?
-- 
View this message in context: http://www.nabble.com/Stored-Procedure-error-tp23890538p23890538.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top