This section explains the structure of the service generation file orm.generation.xml.
This file will contain the specification and the structure of the service layer for the ORM generation. This layer organizes the incoming data from the DB in a service logic fashion and specifies the DAOs.
This is the root tag for the generation file.
Example:
<model></model>
This tag defines the service and the contributions of DAOs or services that can exist for a given service.
Example:
<service name="ServiceName"></service>
This tag specifies a contribution for the service. Each contribution must either be a service or a DAO.
Example:
<uses dao="DAOname"/> <uses service="ServiceName"/>
Here's an example of an orm.generation.xml file as well as the file output from the plugin.
The example depicts a set of three services that define several DAOs. There's service hierarchy, being Services the top-level service. Another service, Programs is used by the top-level service, and uses a Messages service. Each service defines a set of DAOs for itself.
<model> <service name="Messages"> <uses dao="Messages"/> <uses dao="Messagetranslations"/> <uses dao="Languages"/> </service> <service name="Programs"> <uses dao="Programs"/> <uses dao="Programsapplications"/> <uses dao="Providers"/> <uses dao="Medias"/> <uses dao="Applications"/> <uses dao="Applicationsmedias"/> <uses service="Messages"/> </service> <service name="Services"> <uses dao="Services"/> <uses dao="Serviceconfigurations"/> <uses dao="Stages"/> <uses dao="Stagemessages"/> <uses service="Messages"/> <uses service="Programs"/> </service> </model>
In this case the service generation will generate five service files :
All DAO and Data classes will also be generated.
Getters for each DAO and each service link will be created on each service.