Foren

Velocity template using 'type' in dynamic query

thumbnail
Bart Simpson, geändert vor 11 Jahren.

Velocity template using 'type' in dynamic query

Liferay Master Beiträge: 522 Beitrittsdatum: 29.08.11 Neueste Beiträge
When I try to use the 'type' in velocity template for making a dynamic query I get an exception.
The code I am using:
#set ($void = $query.add($propertyFactoryUtil.forName("type").eq("news")))


Exception:
ERROR [http-bio-8080-exec-56][LiferayMethodExceptionEventHandler:33] java.lang.ClassNotFoundException: type

Is there another way to pass this string value? any ideas?
thumbnail
Bart Simpson, geändert vor 11 Jahren.

RE: Velocity template using 'type' in dynamic query

Liferay Master Beiträge: 522 Beitrittsdatum: 29.08.11 Neueste Beiträge
has anyone encountered this one?
Update: checked with similar code inside the portlet's java class, works as it's supposed to be. There is a way to pass this so that the exception isn't raised, but not sure may be by reflection on String class.
Harsh Kanakhara, geändert vor 6 Jahren.

RE: Velocity template using 'type' in dynamic query

Junior Member Beiträge: 74 Beitrittsdatum: 06.04.17 Neueste Beiträge
Dear Bart Simpson,

Did you get your solution ? Please provide your response here.

How to run Dynamic Query in ADT ?