Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Priyanka Dhingra
Dynamic Query Vs CustomSql
December 11, 2012 8:55 PM
Answer

Priyanka Dhingra

Rank: Liferay Master

Posts: 501

Join Date: December 19, 2011

Recent Posts

Which is better Dynamic Query or Custom Sql and why???
Priyanka Dhingra
RE: Dynamic Query Vs CustomSql
December 12, 2012 9:20 PM
Answer

Priyanka Dhingra

Rank: Liferay Master

Posts: 501

Join Date: December 19, 2011

Recent Posts

any guidelines or links ????
David H Nebinger
RE: Dynamic Query Vs CustomSql
December 13, 2012 10:35 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 8440

Join Date: September 1, 2006

Recent Posts

DQ is used when you are processing service-builder-based entities. I this case you don't have to know actual table/column names/types because you're relying on the ORM layer to handle it all.

Custom SQL is used when you have no entities (i.e. it is not defined using SB ), when you don't want or need the entire entity, or when you don't know what you're doing (i.e. you can't figure out how to use DQ to build a complex query).

DQ is the better option because you're not tied to the underlying database (ORM hides the actual database details and allows you to move databases/tables/etc quite easily) where custom SQL does bind you to the database.
Priyanka Dhingra
RE: Dynamic Query Vs CustomSql
December 16, 2012 11:01 PM
Answer

Priyanka Dhingra

Rank: Liferay Master

Posts: 501

Join Date: December 19, 2011

Recent Posts

thanks David for the reply. you explained so well.


one more thing
on page load...
i wanted to fetch some data
I used dynamic query but it gave exception so, i chose custom-sql

why is that so that dynamic query didnt executed on first time page load??
David H Nebinger
RE: Dynamic Query Vs CustomSql
December 18, 2012 5:44 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 8440

Join Date: September 1, 2006

Recent Posts

DQ has some dependencies on the plugin(s) providing the SB entities. When doing something at startup you actually need to wait for the dependent plugins to start. You should be able to do this by defining the dependent plugins as required deployment contexts in liferay-plugin-package.properties.
Priyanka Dhingra
RE: Dynamic Query Vs CustomSql
September 10, 2013 10:59 AM
Answer

Priyanka Dhingra

Rank: Liferay Master

Posts: 501

Join Date: December 19, 2011

Recent Posts

David H Nebinger:
You should be able to do this by defining the dependent plugins as required deployment contexts in liferay-plugin-package.properties.

Still not able to do...because it is the same portlet where service is defined
Consider this:-
in view.jsp
1<%MyTableLocalServiceUtil.getIds(myId)%>

in MyTableLocalServiceImpl.java
 1    public Map<String, Integer> getIds(long myrId) {
 2
 3        Map<String, Integer> resultsMap = new HashMap<String, Integer>();
 4
 5        ProjectionList projectionList = ProjectionFactoryUtil.projectionList();
 6
 7        DynamicQuery dynaQuery = DynamicQueryFactoryUtil
 8                .forClass(MyTable.class);
 9
10        projectionList.add(ProjectionFactoryUtil
11                .property("uid"));
12        projectionList.add(ProjectionFactoryUtil
13                .property("mid"));
14
15        dynaQuery.setProjection(projectionList);
16        dynaQuery.add(RestrictionsFactoryUtil.eq(
17"myId", mId));
18        try {
19            List<Object[]> newIds = (MyTableLocalServiceUtil
20                    .dynamicQuery(dynaQuery));
21
22            for (Object[] o : newIds) {
23                resultsMap.put((String) o[0], ((Long) o[1]).intValue());
24            }
25        } catch (SystemException e) {
26            e.printStackTrace();
27        }
28        return resultsMap;
29    }
Priyanka Dhingra
RE: Dynamic Query Vs CustomSql
September 10, 2013 11:48 PM
Answer

Priyanka Dhingra

Rank: Liferay Master

Posts: 501

Join Date: December 19, 2011

Recent Posts

he stacktrace:-
  111 Sep, 2013 6:43:00 AM org.apache.catalina.core.ApplicationDispatcher invoke
  2SEVERE: Servlet.service() for servlet jsp threw exception
  3org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'com.myportal.service.MyTableLocalService' is defined
  4    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529)
  5    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1094)
  6    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:276)
  7    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
  8    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1075)
  9    at com.liferay.portal.bean.BeanLocatorImpl.doLocate(BeanLocatorImpl.java:137)
 10    at com.liferay.portal.bean.BeanLocatorImpl.locate(BeanLocatorImpl.java:83)
 11    at com.liferay.portal.kernel.bean.PortletBeanLocatorUtil.locate(PortletBeanLocatorUtil.java:47)
 12    at com.symstream.symportal.service.StagingTableLocalServiceUtil.getService(StagingTableLocalServiceUtil.java:321)
 13    at com.symstream.symportal.service.StagingTableLocalServiceUtil.findTIdSid(StagingTableLocalServiceUtil.java:283)
 14    at org.apache.jsp.html.terminal.view_jsp._jspService(view_jsp.java:218)
 15    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 16    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 17    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
 18    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
 19    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
 20    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 21    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 22    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 23    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
 24    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 25    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
 26    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 27    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 28    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
 29    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
 30    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530)
 31    at com.liferay.portlet.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:323)
 32    at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:105)
 33    at com.liferay.util.bridges.mvc.MVCPortlet.include(MVCPortlet.java:367)
 34    at com.liferay.util.bridges.mvc.MVCPortlet.include(MVCPortlet.java:383)
 35    at com.liferay.util.bridges.mvc.MVCPortlet.doView(MVCPortlet.java:145)
 36    at com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(LiferayPortlet.java:218)
 37    at com.liferay.util.bridges.mvc.MVCPortlet.doDispatch(MVCPortlet.java:319)
 38    at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
 39    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
 40    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
 41    at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:111)
 42    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 43    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 44    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 45    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
 46    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
 47    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 48    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 49    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
 50    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
 51    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530)
 52    at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:534)
 53    at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:607)
 54    at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:359)
 55    at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1207)
 56    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 57    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 58    at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:97)
 59    at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PACLRequestDispatcherWrapper.java:90)
 60    at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLRequestDispatcherWrapper.java:54)
 61    at com.liferay.portal.util.PortalImpl.renderPortlet(PortalImpl.java:5158)
 62    at com.liferay.portal.util.PortalUtil.renderPortlet(PortalUtil.java:1569)
 63    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.processPortlet(RuntimePortletImpl.java:165)
 64    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.processPortlet(RuntimePortletImpl.java:97)
 65    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.doProcessTemplate(RuntimePortletImpl.java:531)
 66    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.doDispatch(RuntimePortletImpl.java:394)
 67    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.processTemplate(RuntimePortletImpl.java:228)
 68    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.processTemplate(RuntimePortletImpl.java:216)
 69    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processTemplate(RuntimePortletUtil.java:113)
 70    at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portlet_jsp.java:507)
 71    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 72    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 73    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
 74    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
 75    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
 76    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 77    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 78    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 79    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
 80    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 81    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
 82    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 83    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 84    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
 85    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
 86    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530)
 87    at com.liferay.portal.action.LayoutAction.includeLayoutContent(LayoutAction.java:468)
 88    at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:735)
 89    at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:249)
 90    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
 91    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
 92    at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:176)
 93    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
 94    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
 95    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
 96    at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:560)
 97    at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:537)
 98    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 99    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
100    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
101    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
102    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
103    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
104    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
105    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
106    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
107    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
108    at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:294)
109    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
110    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
111    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
112    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
113    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
114    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
115    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
116    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
117    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
118    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
119    at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:138)
120    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
121    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
122    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
123    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
124    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
125    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
126    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
127    at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:335)
128    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
129    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
130    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
131    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
132    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
133    at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
134    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
135    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
136    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
137    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
138    at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:294)
139    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
140    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
141    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
142    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
143    at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:241)
144    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
145    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
146    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
147    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
148    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
149    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
150    at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:56)
151    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
152    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
153    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
154    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
155    at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:246)
156    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
157    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
158    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
159    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
160    at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
161    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
162    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
163    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
164    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
165    at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:80)
166    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
167    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
168    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
169    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
170    at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:216)
171    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
172    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
173    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
174    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
175    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
176    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
177    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
178    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
179    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
180    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
181    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
182    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
183    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
184    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
185    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
186    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
187    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
188    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
189    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
190    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
191    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
192    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
193    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
194    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
195    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
196    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
197    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
198    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
199    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
200    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
201    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
202    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
203    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
204    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
205    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
206    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
207    at java.lang.Thread.run(Thread.java:679)
Ahmed Hasan
RE: Dynamic Query Vs CustomSql
September 11, 2013 12:18 AM
Answer

Ahmed Hasan

Rank: Expert

Posts: 304

Join Date: April 13, 2007

Recent Posts

Hi Priyanka,

It is a good question. I have explained these differences well in Chapter no.7 of my Free eBook on Liferay portlet development. You can download a free copy and refer it there. I'll surely incorporate the differences mentioned by David as well. If you still have any questions you can ask.

Yours truly,
Ahamed Hasan
Author, Liferay Portlet Cookbook
Priyanka Dhingra
RE: Dynamic Query Vs CustomSql
September 11, 2013 9:11 PM
Answer

Priyanka Dhingra

Rank: Liferay Master

Posts: 501

Join Date: December 19, 2011

Recent Posts

Got it..Exception occured because I had been using same package name for more than one service classes.