APPENDIX B n HIBERNATE TOOLS 283 n HIBERNATE (X web hosting)

APPENDIX B n HIBERNATE TOOLS 283 n HIBERNATE TOOLS 283 In Figure B-23, we have selected all the tables anyway. Once you click Finish, the reverse engineering file will be generated, and an editor will be opened for it. This is a tabbed view of the XML file (the last tab shows the XML source code). This allows you to change the default mappings between the database and Hibernate types, to alter the table and column details, and to apply additional filters to the file itself that dictate which details will be ignored when generating output from the reverse engineering file. We would not recommend trying to get to grips too closely with the reverse engineering tool until you have some experience in creating mappings manually the various settings will seem quite opaque when taken out of context. Once you have created a few simple entity models from scratch, however, the need for the various options should become clearer. In order to actually generate output from the tool, you will need to create a Hibernate code generation configuration by selecting the option in the toolbar of either perspective, as shown in Figure B-24. Figure B-24. Selecting the Hibernate Code Generation configuration tool nNote At the time of writing, the Hibernate Code Generation icon does not seem to be added to the Eclipse toolbar when you install the plug-in. This will probably be fixed by the time you read this book, but if not, you may have to use the JBoss IDE download or an Ant task if you want to take advantage of these features. The Code Generation tool allows you to create various different configurations for generating files based upon your reverse engineering XML file(s). The tool can output the following: Ordinary POJOs POJOs using generics POJOs using EJB 3 annotations (with or without generics) DAO objects XML mapping files Hibernate configuration files HTML documentation of the database schema It also permits you to create a JBoss Seam skeleton application, but this functionality lies well outside the scope of this book.
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

Leave a Reply