With Generato it is possible to add your own individual source code to the generated infrastructure code. This is possible with Protected Areas in the generated source code.

Since not all of the programming languages allow commenting, only these which allow setting these protected areas
   

A Sample Code might look like this:

import com.enumerations.*;
import com.features.content.*;


/* << content-manager-imports    */

-> ... add your protected code here ...

/*    content-manager-imports >> */


@Entity
@Table(name="contentManagers")
public class ContentManager {

...

To archieve this the following syntax is used:

"TEMPLATE: model.java":

<< #{model.name | hyphen }#-imports >>
"RESULT: model.java":


/* << content-manager-imports    */

-> ... add your protected code here ...

/*    content-manager-imports >> */


Into the /* <<  and  >> */  you might put your own code to. After regenerating your Code the content of the brackets stays in its place.


If you need some Protected Areas at your preferenced Positions, go ahead and duplicate the relevant bundle. You can edit the Templates in our Editor and add the Areas wherever you need them. After that select your new bundle or new template (after you deselected the old one). 


To change the parenthesis used for these protected areas use the following:

<< [!!] #{model.name | hyphen }#-imports [!!] >>


results in:


!! << content-manager-imports    !!

-> ... add your protected code here ...

!!    content-manager-imports >> !!


Learn more about it here

Did this answer your question?