Hibernate is used to generate the POJOs coresponding to the database objects. From ther, a 'scenario.xml' is built.


Adichatz proposes default scenarios for generating your application.

Scenario

Each scenario contains the way to generate an XML file from input.

By convention, generated XML files use the '.axml“' extension.


For example, the scenario org.adichatz.scenario.impl.EntityScenario class can take a Film POJO as input to build a file called 'FilmMMGENERATED.axml'.
In the same vein, org.adichatz.scenario.impl.DetailScenario class, takes the FilmMM java class as input to build the 'FilmDIGENERATED.axml' file.

Later, 'XML' file will be used as input by the set of generators to build JAVA classes.


You can create your own scenario classes or select a specific scenario class by entity and type:

  • Open the './resources/xml/Scenario.xml' file with Scenario Editor.
  • Select Generation page.
  • Open branch called 'PluginEntity: adi://myproject/model.actor/ActorMM'.
  • Select item: GenerationUnit: ActorTI - TABLE.
  • In the Outline part, focus on scenarioClassName field and select available table scenarios (CTL-Space).

Select scenario for generation


The name of a file generated by scenarios ends by 'GENERATED.axml'. If you want to customize an XML file (see example) and you do not want that the result will be affected by the generation process, you just have to remove the 'GENERATED' from file name: For example, if you rename file from 'FilmDIGENERATED.axml' to 'FilmDI.axml', a new 'FilmDIGENERATED.axml' will be created when relaunching scenario process but generator will take the 'FilmDI.axml' file as input to generate java classes.

tutorial/scenario.txt · Last modified: 2015/10/05 17:52 (external edit)