Liferay DXP ServiceBuilder Tips
- Use for creating DAO / POJOs / SQL scripts based on service.xml.
- Internally uses spring and hibernate .
- Manages Database connection pool internally.
- The basic operations of create, read, update, delete (CRUD) operations
- Service Builder Generate
-api
IT MAINLY CONSISTS OF INTERFACES
-service
IT MAINLY CONSISTS OF implementations
Note: *Util classes are generated for backwards compatibility purposes only. Your module applications should avoid calling the util classes. Use the non-util classes instead–you can reference them using the @Reference annotation.
You can modify any *Impl class Service Builder generates. The most common are *LocalServiceImpl, *ServiceImpl and *Impl. If you modify the other classes, Service Builder overwrites the changes the next time you run it. Whenever you add methods to, remove methods from, or change a method signature of a *LocalServiceImpl class, *ServiceImpl class, or *Impl class, you should run Service Builder again to regenerate the affected interfaces and the service JAR
Remote Service (SET OF CLASSES)(generated for an entity only if an entity’s remote-service attribute is not set to false in service.xml)
[ENTITY_NAME]ServiceImpl(REMOTE SERVICE IMPLEMENTATION): Remote service implementation. This is the only class in the remote service that you should modify manually. Here, you can write code that adds additional security checks and invokes the local services. For any custom methods added here, Service Builder adds corresponding methods to the[ENTITY_NAME]Serviceinterface the next time you run it.
You define model hints in a file called portlet-model-hints.xml. The portlet-model-hints.xml file goes in the service module’s src/main/resources/META-INF folder.
Model hints define two things:
How entities are presented to users
The size of database columns
<field name="name" type="String">
<hint name="max-length">255</hint>
</field>schema.module.build.auto.upgrade in the file [Liferay_Home]/portal-developer.properties.
Comments
Post a Comment