APPENDIX B n HIBERNATE TOOLS 287 n HIBERNATE TOOLS 287 : Mapping relationships are generated from the EJB 3 and Hibernate 3 annotations in conjunction with a *.cfg.xml or *.properties file. Identical to . : Mapping relationships are generated from the schema metadata obtained over a JDBC connection. The connection details are configured from a properties file. All those from , plus the following: packagename: The name of the package that entities should belong to. reversestrategy: The fully qualified name of a class implementing the org. hibernate.cfg.reveng.ReverseEngineeringStrategy interface. This is the programmatic equivalent of the reveng.xmlfile approach. revengfile: The name of a reverse engineering file to use when processing metadata information. See the discussion later in this section. : Mapping relationships are generated from the EJB 3 and Hibernate 3 annotations in conjunction with an EJB 3 compliant persistence.xml file. entityresolver: The name of the SAX EntityResolver to use when resolving external XML entities. namingstrategy: A naming strategy to use (see Chapter 3) to establish table names from entity names. The element also allows you to specify a standard Ant of *.hbm.xml mapping files. If you use this in conjunction with a *.cfg.xml configuration file, you must not permit any mapping resources to be duplicated, as this will result in duplicate import mapping exceptions. Your choice of configuration element will be driven by the data sources that you have available to you. For example, if you have created your XML mapping files, you will want to use the standard configuration element, but if you have only a normalized database, you will want to generate the mapping information from this using the JDBC configuration (although you may well choose to create a reverse engineering file to control this). Once you have correctly configured an annotation object, however, you can generate any of the other resources that you might need using one or more exporter elements. These are listed in Table B-2. Table B-2. The Available Exporter Elements Element Description Generates tables from the metamodel Generates a *.cfg.xml configuration file from the metamodel Generates entity POJOs from the metamodel Generates Hibernate *.hbm.xml mapping files from the metamodel Continued
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.
This entry was posted
on Friday, September 28th, 2007 at 1:02 pm and is filed under tomcat.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.