getting blog entry by using user id


Here we are passing the user id of the user to reterive the blog

int userId = Integer.parseInt(renderRequest.getParameter("userId"));

List list = new ArrayList();

int count1 =BlogsEntryLocalServiceUtil.getBlogsEntriesCount(); //Getting the total blogs

List blogsList= BlogsEntryLocalServiceUtil.getBlogsEntries(0, count1);

for(BlogsEntry blogsEntry :blogsList){   //Iterating the blogs

if(blogsEntry.getUserId()==userId)    //Checking the users

list.add(blogsEntry); //Adding the particlular user in the list


Comments

Popular posts from this blog

How to know which liferay version we are using

Viewing the SQL Query in liferay : debugging the SQL Query in Hibernate

Executing the BackGround Task