Mantis - Resin
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
95 | minor | always | 04-12-05 00:00 | 11-30-05 14:43 | |
|
|||||
Reporter: | sam | Platform: | |||
Assigned To: | OS: | ||||
Priority: | urgent | OS Version: | |||
Status: | closed | Product Version: | 3.0.12 | ||
Product Build: | 3.0.12 | Resolution: | fixed | ||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 3.0.15 | ||
|
|||||
Summary: | 0000095: EJB query with access more than two references deep | ||||
Description: |
RSN-86 (rep by A Barton) We are porting an application from Resin-ee.2.1.x to Resin-pro-3.0.12. We have discovered a problem in 3.0.12 that had been working fine in 2.1.x. Our problem seems to be related to the depth of reference in our queries. Our entity definition includes the following query: <query> <query-method> <method-name>findAll</method-name> <method-params> </method-params> </query-method> <ejb-ql><![CDATA[SELECT o FROM Faq o order by o.faqCategory.categoryName, o.intOrder]]></ejb-ql> </query> We wrote a simple JSP to exercise the problem finder: <% fooblox.faq.FaqHome home = (fooblox.faq.FaqHome)barblox.commons.ejb.EJBUtils.getLocalHome("FaqBean"); home.findAll(); %> Here is the stacktrace: java.lang.NullPointerException at com.caucho.amber.query.ColumnExpr.generateWhere(ColumnExpr.java:124) at com.caucho.amber.query.AbstractAmberExpr.generateSelect(AbstractAmberExpr.ja va:121) at com.caucho.amber.query.SelectQuery.generateLoadSQL(SelectQuery.java:437) at com.caucho.amber.query.SelectQuery.init(SelectQuery.java:291) at com.caucho.amber.query.QueryParser.parseSelect(QueryParser.java:399) at com.caucho.amber.query.QueryParser.parse(QueryParser.java:238) at com.caucho.amber.connection.AmberConnectionImpl.parseQuery(AmberConnectionIm pl.java:922) at com.caucho.amber.connection.AmberConnectionImpl.prepareQuery(AmberConnection Impl.java:894) at com.caucho.amber.connection.AmberConnectionImpl.prepareQuery(AmberConnection Impl.java:861) at _ejb.FaqBean.FaqBean__EJB$LocalHome.findAll(FaqBean__EJB.java:354) Here is a code snippet from the resin generated source: FaqBean__EJB.java: ... query = trans.getAmberConnection().prepareQuery("SELECT o FROM Faq o ORDER BY o.faqCategory.categoryName, o.intOrder"); com.caucho.amber.query.ResultSetImpl rs = (com.caucho.amber.query.ResultSetImpl) query.executeQuery(); java.util.ArrayList list = new java.util.ArrayList(); while (rs.next()) { com.caucho.ejb.entity.EntityObject item = (com.caucho.ejb.entity.EntityObject) rs.getObject(1); list.add(item); } rs.close(); ... If we remove the ?o.faqCategory.categoryName? reference from the order by clause, this finder will return successfully. Our problem seems to be related to accessing relationships in queries more than two levels deep. We are experiencing this same problem with ejbSelect methods as well. |
||||
Steps To Reproduce: | |||||
Additional Information: | Resin-pro 3.0.12 | ||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|