What is Service Builder ?
Service Builder is a model-driven code generation tool built by Liferay that allows developers to define custom object models called entities.
Service Builder generates a service layer through object-relational mapping (ORM) technology that provides a clean separation between your object model and code for the underlying database.
Service Builder add the necessary business logic for your application.
Service Builder takes an XML file as input and generates the necessary model, persistence, and service layers for your application.

Service layer is set of java classes and interfaces which implement the database interaction logic.
Service Builder uses the spring and hibernate integration Data Access Objects implementation mechanism in short we can call it as DAO implementation.
Service Builder Tool will use the spring and hibernate technology to develop service layer to Plugin portlet.
Important operation that Service Builder perform ?
Service Builder is a model-driven code generation tool built by Liferay that allows developers to define custom object models called entities.
Service Builder generates a service layer through object-relational mapping (ORM) technology that provides a clean separation between your object model and code for the underlying database.
Service Builder add the necessary business logic for your application.
Service Builder takes an XML file as input and generates the necessary model, persistence, and service layers for your application.

Service layer is set of java classes and interfaces which implement the database interaction logic.
Service Builder uses the spring and hibernate integration Data Access Objects implementation mechanism in short we can call it as DAO implementation.
Service Builder Tool will use the spring and hibernate technology to develop service layer to Plugin portlet.
Important operation that Service Builder perform ?
- Automatically generated model, persistence, and service layers
- Automatically generated local and remote services
- Automatically generated Hibernate and Spring configurations
- Support for generating finder methods for entities and finder methods that account for permissions
- Built-in entity caching support
- Support for custom SQL queries and dynamic queries
- Saved development time
How Service Builder Works ?
To generate a basic service layer, you only need to create a
service.xml
file and run Service Builder. This generates a new service .jar
file for your project. The generated service .jar
file includes a model layer, a persistence layer, a service layer, and related infrastructure.
Service Builder reads a single file called
service.xml
that’s used for defining entities. Once you create the file, you can then define your entities.- To define a custom entity, follow these steps:
- Create the
service.xml
file in your project’sdocroot/WEB-INF
folder, if one does not already exist there. - Define global information for the service.
- Define service entities.
- Define the columns (attributes) for each service entity.
- Define relationships between entities.
- Define a default order for the entity instances to be retrieved from the database.
- Define finder methods that retrieve objects from the database based on specified parameters. Let’s examine these steps in detail, starting with creating a
service.xml
file.
Comments
Post a Comment