Web server extensions - APPENDIX B n HIBERNATE TOOLS 289 n HIBERNATE

APPENDIX B n HIBERNATE TOOLS 289 n HIBERNATE TOOLS 289 The task shown in Listing B-2, which completes the simple example that we ve been building up in this section, creates a schema generation script from the annotation-based mappings referenced in the project s hibernate.cfg.xml file. Listing B-2. A Complete Hibernate Mapping Target The element generates a Hibernate XML configuration file from the metamodel information. Table B-4 shows the attributes that can be supplied. Table B-4. The Attributes Available to the Element Property Default Description destdir If set, overrides, for this exporter only, the destination directory specified on the tools task. ejb3 false By default, causes entities to be mapped using entries in the configuration file. If set to true, the entities will be mapped using the approach to pick up EJB 3 annotations in the mapped classes. This setting does not cause a persistence.xml file to be generated! Typically, the element is used when the configuration task has been configured from a properties file for example, when using , you would typically start with a normalized database schema and a properties file containing the connection details, and use this exporter to create a hibernate.cfg.xml file containing both the connection details and the details of the mapped entities. The element generates the Java source code for POJOs for each of the entities held in the metamodel. Table B-5 shows the attributes that can be supplied. Table B-5. The Attributes Available to the Element Property Default Description destdir If set, overrides, for this exporter only, the destination directory specified on the tools task ejb3 false If set to true, causes the POJOs to be generated with EJB 3 annotations jdk5 false If set to true, causes the POJOs to be generated with Java 5 constructs (generics, enumerations, etc.)
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.

Leave a Reply