users@glassfish.java.net

Re: Unknown state or association field exception

From: <glassfish_at_javadesktop.org>
Date: Wed, 27 Jun 2007 17:02:04 PDT

An example of the NameQuery:

@NamedQuery(name = "SfcWiptran.findByProjectNoAndPartNoActive", query = "SELECT s FROM SfcWiptran s WHERE s.sfcWip.[b]sfcWipPK[/b].projectNoSub = :projectNoSub AND s.sfcWip.[b]sfcWipPK[/b].pcbPartNo = :pcbPartNo AND s.currProcess IS NOT NULL ORDER BY s.productId")

The query is incomplete when 'sfcWipPK', which hold the 'projectNoSub' and 'pcbPartNo', is missing. As a result, 'projectNoSub' and 'pcbPartNo' can't relate to 'sfcWip'. Therefore the exception is throw.
[Message sent by forum member 'sunright' (sunright)]

http://forums.java.net/jive/thread.jspa?messageID=224367