Preferences

To edit the preferences for Hibernate Synchronizer, click workspace > Hibernate Synchronizer.

Templates

Templates can be defined so you have the ability to cause the own generation of any resources or class files that you define. The templates are generated with the Velocity language which you will be able to use to reference the mapping object model. You will be able to define objects for each project that you will be able to reference in your template.
By default, you have access to these parameters:

  • now: the current time as a java.util.Date object
  • class: the object structure representing the mapping file class. (see API)
  • stringUtil: the Velocity StringUtil object to perform common functions. (see API)
For each class that is synchronized, all of the templates that are defined in your project will be executed. To enable template generation, you must create the template in the workspace preferences and add that template to your project which we will see how to do later.

This is a list of the templates that have been defined for your workspace.
Use this button to create a new template in your workspace.
Use this button to edit a template that you have already created in your workspace. Click on the row that you would like to select to enable the edit button.
Use this button to delete a template that you have already created in your workspace. Click on the row that you would like to select to enable the edit button.
To import one or many previously exported templates into your workspace, click this button to select the zip file that represents the exported templates.
Use the checkbox to select all the templates to be exported and click this button. All the selected templates will be compressed to a single zip file.
This button will select the checkbox on every row.
This button will deselect the checkbox on every row.
If this checkbox is selected any templates you define in your workspace and project will be executed when your classes are synchronized. Otherwise, no templates will be executed.

Snippets

Snippets are individual sections of code with which the templates are comprised of. Using the snippets, you have the ability to modify the default behavior of the code generation. You also have the ability to create new templates that you can reference in templates that you create. Any snippet can be referenced by $snippet.[snippet name] in your template. For example, if a snippet named foo was created, the Velocity variable $snippet.foo can be used to paste in the snippet code. All velocity variables and functionality are available in the snippets.

This is a list of the snippets that have been defined. There are many that are used by the plugin templates but you can define more of your own to reference.
Use this button to edit the selected template. If you edit a template supplied by the plugin, you will always have the ability to reset to the supplied functionality if you need to.
Use this button to edit the selected template.
Use this button to reset the selected template to the functionality it had when it was initially downloaded. This button will not be enabled for user defined snippets.
Use this button to delete the selected template. This button will not be enabled for snippets required by the plugin.