Setting Up a Custom POJO Renderer
In order to set up a custom POJO renderer, we first need to create an extension point. An extension point is the mechanism by which one plug-in can add to the functionality of another.
-
First you have to create a plug-in project.Open the plugin.xml manifest file and switch to the Dependencies page. Here you have to add the dependencies next:

Switch to the Extensions page. The page lists all extension points used by this plug-in.
Press the "Add" button and select the extension "com.exadel.orm2.core.codeRenderers"
-
You should now see the com.exadel.orm2.core.codeRenderers extension point listed in your Extensions page.
Right-click on it and select New->code_renderer
Doing so creates an object under the extension with a default name like com.exadel.orm2.sample.code_renderer2
Set the name and change the id in the properties for this object.
-
Select the class property and click the Selection button to bring up the Java Class Selection dialog. Click Finish, and then press Ctrl-S to save.
-
Switch to the Extensions page. You then need to select the package that contains this class.

-
After that you have to deploy this plug-in. Select File-> Export, and then select the "Deployable plug-ins and fragments" item in the Export dialog. You can deploy plug-ins as either .jar or .zip files. Here, we'll deploy both plug-ins in a .zip file. Enter the fully qualified name of the .zip file and unzip that file in the Eclipse distribution directory.
- You don't have to implement all interface methods. You can use the default implementation and override only certain methods. To do this just make the generated class a descendant of
com.exadel.orm2.core.CodeRendererServiceand change the generated import:

Now you can safely delete all methods, that you are not going to override, in fact, you must. Imagine that you want to generate persistent classes to be instances of theComparableinterface. No problem! Here is the code that'll do that task for you:
ThecreateTypemethod is overridden here to addComparableto the array of interfaces to implement (only for primary types, but not for inner ones), then the default implementation is invoked bysuper.createTypecall. Exadel Studio automatically generates all the necessary method stubs for implemented interfaces.
-
After that you can use this created extension point for a custom POJO renderer. If you create a new Java project and after that you add "Hibernate Capabilities", you can then select your created class.