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. 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. They had a simple goal: to create useful technology that. was formed by a few software engineers, a stay-at-home mom, and a to-be attorney surrounded by the mismatched, donated furniture in a local church. The type of the column is defined by typeattribute. We started as a group of young, nerdy entrepreneurs hoping to build a for-profit tech company that could be a vehicle for good. 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. All the setter and getter methods will be generated like setBookName, getBookName, setDescription, getDescriptionetc. 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. In this article we will explain how to perform CRUD Operations in Liferay Custom Portlet.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |