Java Emitter Templates and the New SQLJ File wizard
The New SQLJ File wizard can use a template that is produced by the Java Emitter Templates (JET) tool to generate the code in a new SQLJ file.
The New SQLJ File wizard can either create an SQLJ file that is a simple class skeleton file, or it can use one of the following predefined templates to generate the content of the SQLJ file:
- SQLJ template
- Generates a class that directly accesses the result set.
- SQLJ cached template
- Generates a class that caches the result set.
These predefined templates were generated by the JET tool. If the functionality in the classes that the two templates generate does not meet your needs, you can use the JET tool to create your own templates.
The SQLJ template interfaces are provided in the sqlj.jar file of the SQLJ plug-in (com.ibm.etools.sqlj). By using the methods and classes in the interfaces, your template can access the information that you or another user specifies on the pages of the New SQLJ File wizard. You can then include code in your template to generate an SQLJ file that uses this information. You can define as many templates as you need, and make all of them available for selection through the New SQLJ File wizard.
Related reference
Model with the Eclipse Modeling Framework, Part 2 - Generate code with Eclipse's Java Emitter Templates