4 | | `<entity name="Example" decorator="decorators.ExampleDecorator">`[[BR]][[BR]]This will put a template decorator '!ExampleDecorator.java' in a package 'decorators' in your Java source folder. If you open this file, you will notice three functions:[[BR]][[BR]]`public int add(List<E> entities)` |
5 | | |
6 | | `public int update(List<E> entities)` |
7 | | |
8 | | `public int remove(List<E> entities)`[[BR]][[BR]]Each of these functions can be customized with new pre-, post- and database action behaviour, in a sequential layout:[[BR]][[BR]]`// add your pre-processing here// here we call the standard 'add'int count = super.add(entities);// add your post-processing here// if you throw an exception the previous add will be rolled back` |
| 4 | `<entity name="Example" decorator="decorators.ExampleDecorator">`[[BR]][[BR]]This will put a template decorator '!ExampleDecorator.java' in a package 'decorators' in your Java source folder. If you open this file, you will notice three functions:[[BR]][[BR]]`public int add(List<E> entities)public int update(List<E> entities)public int remove(List<E> entities)`[[BR]][[BR]]Each of these functions can be customized with new pre-, post- and database action behaviour, in a sequential layout:[[BR]][[BR]]`// add your pre-processing here// here we call the standard 'add'int count = super.add(entities);// add your post-processing here// if you throw an exception the previous add will be rolled back` |