Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] New QueryException in version 1.1

Is there a way to figure out why I am getting a QueryException in a delete
request?
[3/30/09 14:47:35:328 CDT] 0000003f SystemOut     O [EL Warning]: 2009-03-30
14:47:35.328--UnitOfWork(2104393070)--Thread(Thread[WebContainer :
5,5,main])--Exception [EclipseLink-6094] (Eclipse Persistence Services -
1.1.0.r3634): org.eclipse.persistence.exceptions.QueryException
Exception Description: The parameter name [POLICY_NUMBER] in the query's
selection criteria does not match any parameter name defined in the query.
Query: DeleteObjectQuery(com.gmrc.jpa.domain.CpTransaction@de21fdeb)

I was not seeing this in the 1.0.2 version.

I have narrowed it down to the relationship between these two entities.

@Entity
@Table(name = "CP_TRANSACTION")
public class CpTransaction extends BaseDomain implements
java.io.Serializable {
....
    private Set<CpMsg> cpMsgs = new HashSet<CpMsg>(0);
....
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "cpTransaction")
    @JoinColumn(name = "POLICY_NUMBER", referencedColumnName = "POLICY_NBR")
    @PrivateOwned
    public Set<CpMsg> getCpMsgs() {
        return this.cpMsgs;
    }

    @Column(name = "POLICY_NUMBER", length = 20)
    public String getPolicyNumber() {
        return this.policyNumber;
    }
}

@Entity
@Table(name = "CP_MSG")
public class CpMsg extends BaseDomain {
    private Long msgId;
.....
    private String policyNbr;
    private CpTransaction cpTransaction;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "POLICY_NBR", referencedColumnName = "POLICY_NUMBER",
updatable = false, insertable = false)
    public CpTransaction getCpTransaction() {
        return this.cpTransaction;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "MSG_ID", unique = true, nullable = false, precision =
11, scale = 0)
    public Long getMsgId() {
        return this.msgId;
    }
    
    @Column(name = "POLICY_NBR", length = 20)
    public String getPolicyNbr() {
        return this.policyNbr;
    }
}

The SQL relationship is CP_TRANSACTION.POLICY_NUMBER = CP_MSG.POLICY_NBR.

If I do a getCpMsgs() it seems to find them correctly.

Thanks
Kevin
-- 
View this message in context: http://www.nabble.com/New-QueryException-in-version-1.1-tp22792539p22792539.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top