
deleteBook(bookId)Īll these methods will be created by default.Īll the 4 operations are written in portlet class. This class contains all the methods to perform CRUD operations in liferay portlet. After building the service along with other files BookLocalServiceUtil.java will be generated. We just need to call the correct methods.

#Simpleedit liferay update#
If the build service is successful then all the service methods will be created for all the operations like Create, Read, Update and Delete. We can also run build service by running ant build-service.Ĥ.Identify 4 methods for all the operations If you properly configured your liferay with Liferay IDE then build the service as shown in below. The type of the column is defined by typeattribute. Note 5: Columnrepresents simply columns of the table. The methods of BookLocalServiceImpl.java can be called only from local machine and on the other hand methods of BookServiceImpl.java can be called remotely. However we can write our own custom methods in those files. This means that BookLocalServiceImpl.java and BookServiceImpl.java files will be generated after building our service. Note 4: local-service and remote-service are set true. Note 3: id-type="increment" means that each time we create a new row of book, one incremented primary key will be generated. Note 2: table="CRUD_BOOK_PORTLET" means that book information will be saved in CRUD_BOOK_PORTLET table. Step 2:- Under work space project create module project.
#Simpleedit liferay how to#
Here, in this post we see how to add record in database using Liferay 7 and how to fetch all records from database and display them on jsp using SearchContainer and also using jquerydata table in liferay 7. All the setter and getter methods will be generated like setBookName, getBookName, setDescription, getDescriptionetc. Liferay7 CRUD operation with Search Container and JqueryDataTable. For example Book.java, BookLocalServiceImpl.java, BookServiceImpl.java etc. Once service is generated, lots of code will be generated based entity name. Create a service.xml file under WEB-INF as shown in the above. Consider that our portlet project name is crud-example-portletĢ.

We are not going to explain how to create a portlet.

However for experienced liferay developer this article would be helpful with respect to security concern.At the end of this article we will understand how to perform Create, Read, Updateand DeleteOperations on Liferay Entity.Īt first we need a basic portlet project. So this article will be helpful for them. Many new comers find difficulty to use liferay service builder tool to perform CRUD Operations in Liferay portlet. We will also explain the how to use service builder tool to perform all the operations one by one. Older versions are available on Docker Hub and GitHub. Note: We recommend using Liferay's published Docker Image. In this article we will explain how to perform CRUD Operations in Liferay Custom Portlet. Liferay POrtal 7.4 ga44 Liferay Commerce 4.0 GA44 September 30, 2022.
