Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
vipin bardia
Unable to Execute Dynamic Query ln liferay 5.2.3
13 de Outubro de 2011 22:54
Resposta

vipin bardia

Ranking: Junior Member

Mensagens: 39

Data de entrada: 27 de Fevereiro de 2011

Mensagens recentes

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
vipin bardia
RE: Unable to Execute Dynamic Query ln liferay 5.2.3
16 de Outubro de 2011 21:41
Resposta

vipin bardia

Ranking: Junior Member

Mensagens: 39

Data de entrada: 27 de Fevereiro de 2011

Mensagens recentes

Hi All,

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

Thanks & Regards
Vipin Bardia
Apoorva Prakash
RE: Unable to Execute Dynamic Query ln liferay 5.2.3
16 de Outubro de 2011 22:09
Resposta

Apoorva Prakash

Ranking: Liferay Master

Mensagens: 594

Data de entrada: 15 de Junho de 2010

Mensagens recentes

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
vipin bardia
RE: Unable to Execute Dynamic Query ln liferay 5.2.3
20 de Outubro de 2011 03:43
Resposta

vipin bardia

Ranking: Junior Member

Mensagens: 39

Data de entrada: 27 de Fevereiro de 2011

Mensagens recentes

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
Apoorva Prakash
RE: Unable to Execute Dynamic Query ln liferay 5.2.3
24 de Outubro de 2011 03:56
Resposta

Apoorva Prakash

Ranking: Liferay Master

Mensagens: 594

Data de entrada: 15 de Junho de 2010

Mensagens recentes

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
Jignesh Vachhani
RE: Unable to Execute Dynamic Query ln liferay 5.2.3
24 de Outubro de 2011 04:51
Resposta

Jignesh Vachhani

Ranking: Liferay Master

Mensagens: 755

Data de entrada: 10 de Março de 2008

Mensagens recentes

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.