Mapping Between Liferay Objects

Add relationship between two or more Liferay Objects.

26 Mar 2024

Low code and no code development are handy for developing a website without a technical background. Liferay came with the Object concept, which is able to generate the persistence and service layers by just defining the required fields from the Liferay control panel. In this blog, here are some essential points from the objects.

Mapping between object definitions

With Liferay Objects we can map two or multiple Objects together, Right now we will map Invoice and Loan object, One Invoice can have a multiple Loans.

Add Object 1 : Invoice

  • Navigate to the Control panel > OBJECT > Objects.
  • Click on Add Object.
  • Give Label, Plural Label, and Object Name
  • Click on save button
  • Now navigate to the new Object and go to the Field section.
  • Add required fields

Add Object 2 : Loan

  • Create one more object for Loan
  • Now navigate to the Loan Object and go to the Field section.
  • Add required fields

Its Time To Map The Objects

As we want to map one Invoice with multiple Loans Mapping will be added in Invoice Object

  • Navigate to the Invoice Object
  • Now navigate to the Relationship Tab
  • Click on Add Relationship button
  • Enter details and save it

Great!! Now publish both objects and that's it.