Skip to content

Instantly share code, notes, and snippets.

@rotty3000
Created October 4, 2011 19:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rotty3000/1262555 to your computer and use it in GitHub Desktop.
get all RatingsEntry by user and asset type
long classNameId = PortalUtil.getClassNameId(className);
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(RatingsEntry.class, PortalClassLoaderUtil.getClassLoader());
dynamicQuery.add(RestrictionsFactoryUtil.eq("userId", userId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("classNameId", classNameId));
List<RatingsEntry> ratings = (List<RatingsEntry>)RatingsEntryLocalServiceUtil.dynamicQuery(dynamicQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment