We already know how to write dynamic query in Liferay. If we create Dynamic Query object in same portlet in which our service are then we can use :-
But if we use this code in another portlet ie Services in one portlet and our portlet is different then we get error on our console:-
[DynamicQueryFactoryImpl:96] Unable find model com.liferay.sample.model.impl.EmployeeImpl
java.lang.ClassNotFoundException: com.liferay.sample.model.impl.EmployeeImpl
Solution:-
In this case you can create Dynamic Query Object as:-
Explanation:-
The only difference is the way how we use the Class Loader.
The only difference is the way how we use the Class Loader.
Hope this will Help....
Related Post:-
No comments:
Post a Comment