Sunday, July 25, 2010

JDeveloper Extension for Generating Hibernate Units.


I am working on the JDeveloper Extension project to make hibernate development work a little bit easier. I have creating Extension for JDeveloper that will create following file:
  • Entity Class (Which will be serialized to the database).
  • DTO Class (which will interact with the user)
  • Manager Class (This class will contain all the operation that can we performed on entity)
  • HBM File (This file will contain the all the mapping from java object to the table fields in the data base)
  • Hibernate Configuration file (This will contain mapping of all generated HBM file).
  • Database Configuration file (Contain all the Database details on which these files are generated.)
These all file will be created on the table selected from database
These are the steps to generate all these files:
Welcome Screen:





This is the connection screen in that screen you can define new Connection or can use exiting Connection. To select existing connection remove check for create new connection.



You can also save the connection details for the future use by selecting the save connection check box.
A Combo box will appear at place of input text for connection, you can select the existing Connections from the Combo box.




Click on the text connection button if success full connection established with database then next button will appear. Click on the next button. It will bring new screen which will have list of schema available to the connected database. Select the appropriate schema. Below the schema
Combo box there is a filter for table name you can find your table there or just can click on fetch button it will display the entire table list in the available Units:




Select the table on which you want to generate the hibernate units. Add table to the select units list by clicking on the shuttle button.



Once you click on the next button it will bring the new screen which will have database column to the java fields. On this screen you can select the Key fields, select the data type for java class fields.




Once you finished with the mapping just click on the validate mapping this will validated all mapping and enable the next button.
On this screen it will ask for the unit you want to generate from this extension.



On this screen it will ask for:
Folder Location: This is the location where you want to keep all generated unit.
Default Package: This is the package structure inside the folder location where all file will be placed.
Default File Name: This the default file name for all units create by default it will filled with the table you selected if you want to change the File name you can change here.


Once you click on Generate file button all file will be generate on specified location.
Click to finished button to complete the wizard.

Please find the first release of extension on HibernateUnitGenerator let me know if anything is incorrect in that  








7 comments:

  1. Extension is still in development i will share with you as soon as I complete it.

    ReplyDelete
  2. I think it's a great idea and very useful.
    Have you completed your development?
    If possible, I would be interested in trying.
    Thanks.

    ReplyDelete
  3. hi, amit, I am also researchig on JDEVELOPER and ADF framework. i want a complete material on building a banking application in jdeveloper with ADF and hibernate. i want complete documentation. can you help me.

    ReplyDelete
  4. Amit,

    I am trying to use your extension. Downloaded and loaded, and see it using help->about->extensions. But not able to see your extension anywhere else in Jdeveloper. Can you please let me know how to use your extension?

    Thanks lot
    Krihs

    ReplyDelete
    Replies
    1. Extension will under view menu with name "Hibernate Unit Generator"

      Delete

Thanks for your valuable comment. You comment will go live soon.