Message Boards

How to create dynamic query with alias in Liferay 7.2

Ronak Parekh, modified 3 Years ago.

How to create dynamic query with alias in Liferay 7.2

New Member Posts: 10 Join Date: 11/5/20 Recent Posts

Hello Team,

I want to create dynamic query of JournalArticle model with alias in Liferay DXP 7.2.

I have tired using following way:

DynamicQueryFactoryUtil.forClass(class,alias,classLoader);

It throws classNotFound JournalArticleImpl exception.

So I have tried to create using model localserviceutil like following way:

JournalArticleLocalServiceUtil.dynamicQuery();

It doen't throw any error but how can I use alias while creating dynamic query from localserviceutil?

I have to use alias because without it I will not get desire result.

Please help me if any one has face this type of requirement.

Thank You!