Foros de discusión

Unable to Execute Dynamic Query ln liferay 5.2.3

thumbnail
vipin bardia, modificado hace 12 años.

Unable to Execute Dynamic Query ln liferay 5.2.3

Regular Member Mensajes: 162 Fecha de incorporación: 28/02/11 Mensajes recientes
Java Code----
DynamicQuery dynamicQuery =DynamicQueryFactoryUtil.forClass(Custom.class);
dynamicQuery = dynamicQuery.add(PropertyFactoryUtil.forName("framework").eq(frmWork));

In above code Custom.class is our custom class and framework is our respective field.
As we add the filter to dynamicQuery It gives the below Error.

Error-------

Java.lang.ClassCastException: $Proxy304 cannot be cast to com.liferay.portal.dao.orm.hibernate.SessionImpl

Thanks & Regards
VIpin Bardia
CIGNEXian
thumbnail
vipin bardia, modificado hace 12 años.

RE: Unable to Execute Dynamic Query ln liferay 5.2.3

Regular Member Mensajes: 162 Fecha de incorporación: 28/02/11 Mensajes recientes
Hi All,

I am stucked with this error,
Please, If some one can help.

Thanks & Regards
Vipin Bardia
thumbnail
Apoorva Prakash, modificado hace 12 años.

RE: Unable to Execute Dynamic Query ln liferay 5.2.3

Liferay Master Mensajes: 658 Fecha de incorporación: 15/06/10 Mensajes recientes
Hi Vipin,

Go through this link... Its quite helpful...
Are you using Plugin environment ? there was an issue in it... see this link
Hope this will help...

Thanks and Regards,
Apoorva Prakash
thumbnail
vipin bardia, modificado hace 12 años.

RE: Unable to Execute Dynamic Query ln liferay 5.2.3

Regular Member Mensajes: 162 Fecha de incorporación: 28/02/11 Mensajes recientes
Hi Apoorva,

First of all, i am really sorry for late reply.

We tried in that way mentioned in those link.
But still would not able to come out.

Now we are doing through simple jdbc.

Thanks for your reply.

Regards
Vipin Bardia
CIGNEXians
thumbnail
Apoorva Prakash, modificado hace 12 años.

RE: Unable to Execute Dynamic Query ln liferay 5.2.3

Liferay Master Mensajes: 658 Fecha de incorporación: 15/06/10 Mensajes recientes
Hello Vipin,
Dynamic query is implemented in exactly the very same fashion... Mine works...
And its almost impossible to point out the exact problem that you are facing...
There must be some minor issue...

Keep trying...

Thanks and regards
Apoorva Prakash
thumbnail
Jignesh Vachhani, modificado hace 12 años.

RE: Unable to Execute Dynamic Query ln liferay 5.2.3

Liferay Master Mensajes: 803 Fecha de incorporación: 10/03/08 Mensajes recientes
Hi Vipin,

i think in your case you must need to create new portlet and just build service again after putting your code in newly created portlet this will resolve your problem.
As the link suggested by apoorva is correct and we can definitely run the code properly.