[jboss-user] [EJB/JBoss] - Reference Foreign Key in EJB-QL

pcarrollnf do-not-reply at jboss.com
Thu Jun 26 09:14:28 EDT 2008


I have a one-to-many ejb-relation configured.  I am trying to create an ejb-ql or jboss-ql query where I need to reference the foreign key of the one side of the ejb-relation.  Since I cannot explicitly enter this foreign key as a <cmp-field> in the many side of the , it appears I cannot write the following:


  | <ejb-ql>
  |     <![CDATA[SELECT OBJECT(p) FROM PartStructure p WHERE p.foreignKeyId = ?1 AND p.partName = ?2]]>
  | </ejb-ql>
  | 

I get the following error when I start JBoss:


org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT OBJECT(p) FROM PartStructure p WHERE p.foreignKeyId = ?1 AND p.partName = ?2'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.UnknownPathException: Unknown terminal field: at line 1, column 51.  Encountered: "foreignKeyId" after: "p.")


Is it possible to reference that foreignKeyId in the ejb-ql or jboss-ql?  Thanks.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4160857#4160857

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4160857



More information about the jboss-user mailing list