From: <hib...@li...> - 2006-04-23 18:55:42
|
Author: max...@jb... Date: 2006-04-23 14:55:33 -0400 (Sun, 23 Apr 2006) New Revision: 9779 Modified: trunk/HibernateExt/tools/doc/reference/en/images/codegenexporters.gif trunk/HibernateExt/tools/doc/reference/en/master.xml trunk/HibernateExt/tools/doc/reference/en/modules/ant.xml trunk/HibernateExt/tools/doc/reference/en/modules/plugins.xml trunk/HibernateExt/tools/doc/reference/en/modules/reverseengineering.xml Log: more docs Modified: trunk/HibernateExt/tools/doc/reference/en/images/codegenexporters.gif =================================================================== (Binary files differ) Modified: trunk/HibernateExt/tools/doc/reference/en/master.xml =================================================================== --- trunk/HibernateExt/tools/doc/reference/en/master.xml 2006-04-21 19:10:39 UTC (rev 9778) +++ trunk/HibernateExt/tools/doc/reference/en/master.xml 2006-04-23 18:55:33 UTC (rev 9779) @@ -14,7 +14,7 @@ <subtitle>Reference Guide</subtitle> - <releaseinfo>3.1.0.beta4</releaseinfo> + <releaseinfo>3.1.0.beta5</releaseinfo> <mediaobject> <imageobject> Modified: trunk/HibernateExt/tools/doc/reference/en/modules/ant.xml =================================================================== --- trunk/HibernateExt/tools/doc/reference/en/modules/ant.xml 2006-04-21 19:10:39 UTC (rev 9778) +++ trunk/HibernateExt/tools/doc/reference/en/modules/ant.xml 2006-04-23 18:55:33 UTC (rev 9779) @@ -349,11 +349,11 @@ <para><programlistingco> <areaspec> - <area coords="4 57" id="cfg1" /> + <area coords="4 57" id="xcfg1" /> - <area coords="5 57" id="cfg2" /> + <area coords="5 57" id="xcfg2" /> - <area coords="6 57" id="cfg3" /> + <area coords="6 57" id="xcfg3" /> </areaspec> @@ -367,18 +367,18 @@ </jdbcconfiguration>]]></programlisting> <calloutlist> - <callout arearefs="cfg1"> + <callout arearefs="xcfg1"> <para>packagename (optional): The default package name to use when mappings for classes is created</para> </callout> - <callout arearefs="cfg2"> + <callout arearefs="xcfg2"> <para><literal>revengfile</literal> (optional): name of reveng.xml that allows you to control varios aspects of the reverse engineering.</para> </callout> - <callout arearefs="cfg3"> + <callout arearefs="xcfg3"> <para><literal>reversestrategy</literal> (optional): name of a class that implements <literal>org.hibernate.cfg.reveng.ReverseEngineeringStrategy</literal>. @@ -432,19 +432,19 @@ <para><programlistingco> <areaspec> - <area coords="2 55" id="cfg1" /> + <area coords="2 55" id="ycfg1" /> - <area coords="3 55" id="cfg2" /> + <area coords="3 55" id="ycfg2" /> - <area coords="4 55" id="cfg3" /> + <area coords="4 55" id="ycfg3" /> - <area coords="5 55" id="cfg4" /> + <area coords="5 55" id="ycfg4" /> - <area coords="6 55" id="cfg6" /> + <area coords="6 55" id="ycfg5" /> - <area coords="7 55" id="cfg7" /> + <area coords="7 55" id="ycfg6" /> - <area coords="8 55" id="cfg8" /> + <area coords="8 55" id="ycfg7" /> </areaspec> <programlisting><![CDATA[<hbm2ddl @@ -458,12 +458,12 @@ >]]></programlisting> <calloutlist> - <callout arearefs="cfg1"> + <callout arearefs="ycfg1"> <para>export (default: true): Execute the generated statements against the database</para> </callout> - <callout arearefs="cfg2"> + <callout arearefs="ycfg2"> <para>update(default: false): Try and create an update script representing the "delta" between what is in the database and what the mappings specify. Ignores create/update attributes. @@ -473,27 +473,27 @@ operations</emphasis>)</para> </callout> - <callout arearefs="cfg3"> + <callout arearefs="ycfg3"> <para>drop (default: false): Output will contain drop statements for the tables, indices & constraints</para> </callout> - <callout arearefs="cfg4"> + <callout arearefs="ycfg4"> <para>create (default: true): Output will contain create statements for the tables, indices & constraints</para> </callout> - <callout arearefs="cfg5"> + <callout arearefs="ycfg5"> <para>outputfilename (Optional): If specified the statements will be dumped to this file.</para> </callout> - <callout arearefs="cfg6"> + <callout arearefs="ycfg6"> <para>delimiter (default: ";"): What delimter to use to separate statements</para> </callout> - <callout arearefs="cfg7"> + <callout arearefs="ycfg7"> <para>format (default: false): Apply basic formatting to the statements.</para> </callout> @@ -524,9 +524,9 @@ <para><programlistingco> <areaspec> - <area coords="2 55" id="cfg1" /> + <area coords="2 55" id="zcfg1" /> - <area coords="3 55" id="cfg2" /> + <area coords="3 55" id="zcfg2" /> </areaspec> <programlisting><![CDATA[<hbm2java @@ -535,12 +535,12 @@ >]]></programlisting> <calloutlist> - <callout arearefs="cfg1"> + <callout arearefs="zcfg1"> <para>jdk (default: false): Code will contain JDK 5 constructs such as generics and static imports</para> </callout> - <callout arearefs="cfg2"> + <callout arearefs="zcfg2"> <para>ejb3 (default: false): Code will contain EJB 3 features, e.g. using annotations from javax.persistence and org.hibernate.annotations</para> @@ -611,7 +611,7 @@ <para><programlistingco> <areaspec> - <area coords="2 55" id="cfg1" /> + <area coords="2 55" id="qcfg1" /> </areaspec> <programlisting><![CDATA[<hbm2cfgxml @@ -620,7 +620,7 @@ ]]></programlisting> <calloutlist> - <callout arearefs="cfg1"> + <callout arearefs="qcfg1"> <para>ejb3 (default: false): the generated cfg.xml will have <mapping class=".."/>, opposed to <mapping resource="..."/> for each mapping.</para> Modified: trunk/HibernateExt/tools/doc/reference/en/modules/plugins.xml =================================================================== --- trunk/HibernateExt/tools/doc/reference/en/modules/plugins.xml 2006-04-21 19:10:39 UTC (rev 9778) +++ trunk/HibernateExt/tools/doc/reference/en/modules/plugins.xml 2006-04-23 18:55:33 UTC (rev 9779) @@ -499,7 +499,7 @@ <tbody> <row> - <entry><para>Generate domain code</para></entry> + <entry><para>Domain code</para></entry> <entry><para>Generates POJO's for all the persistent classes and components found in the given Hibernate @@ -521,22 +521,21 @@ </row> <row> - <entry><para>Generate DAO code</para></entry> + <entry><para>DAO code</para></entry> <entry><para>Generates a set of DAO's for each entity found.</para></entry> </row> <row> - <entry><para>Generate Mappings</para></entry> + <entry><para>Hibernate XML Mappings</para></entry> <entry><para>Generate mapping (hbm.xml) files for each entity</para></entry> </row> <row> - <entry><para>Generate hibernate configuration - file</para></entry> + <entry><para>Hibernate XML Configuration</para></entry> <entry><para>Generate a hibernate.cfg.xml file. Used to keep the hibernate.cfg.xml uptodate with any new found mapping @@ -544,15 +543,14 @@ </row> <row> - <entry><para>Generate schema html-documentation</para></entry> + <entry><para>Schema Documentation (.html)</para></entry> <entry><para>Generates set of html pages that documents the database schema and some of the mappings.</para></entry> </row> <row> - <entry><para>Generate JBoss Seam skeleton app - (beta)</para></entry> + <entry><para>Generate JBoss Seam skeleton app [Beta]</para></entry> <entry><para>Generates a complete JBoss Seam skeleton app. The generation will include annotated POJO's, Seam controller beans @@ -698,8 +696,8 @@ <para>Note that not all the features of the .reveng.xml file is exposed or fully implemented in the editor, but the main functionallity is there. To - understand the full flexibility of the reveng.xml, please see <xlink - linkend="hibernaterevengxmlfile" /></para> + understand the full flexibility of the reveng.xml, please see <xref + linkend="hibernaterevengxmlfile"/></para> <para>The editor is activated as soon as an .reveng.xml file is opened. To get an initial reveng.xml file the reveng.xml wizard can be started via @@ -812,19 +810,22 @@ <title>Class Diagram</title> <para>A class diagram is available in the view named "Hibernate Entity - Model". It will show the model for any slected hibernate console - configuration.</para> + Model". It will show the model when the Configuration node in a Hibernate Console + Configuration is selected.</para> <mediaobject> <imageobject role="fo"> - <imagedata fileref="images/entitymodel_zoomout.png" /> + <imagedata fileref="images/entitymodel.gif" /> </imageobject> <imageobject role="html"> <imagedata align="center" - fileref="../shared/images/entitymodel_zoomout.png" /> + fileref="../shared/images/entitymodel.gif" /> </imageobject> </mediaobject> + + <para>This view supports zoom in/out and can also be printed. Zooming is done via the toolbar buttons in the view + and printing is done by selecting the view and choose File/Print or use the Print Icon.</para> </section> Modified: trunk/HibernateExt/tools/doc/reference/en/modules/reverseengineering.xml =================================================================== --- trunk/HibernateExt/tools/doc/reference/en/modules/reverseengineering.xml 2006-04-21 19:10:39 UTC (rev 9778) +++ trunk/HibernateExt/tools/doc/reference/en/modules/reverseengineering.xml 2006-04-23 18:55:33 UTC (rev 9779) @@ -45,6 +45,7 @@ <hibernate-reverse-engineering> +<schema-selection <type-mapping> <!-- jdbc-type is name fom java.sql.Types --> <sql-type jdbc-type="VARCHAR" length='20' hibernate-type="SomeUserType" /> @@ -69,12 +70,18 @@ are done for a specific table --> <table name="ORDERS"> <primary-key> + <!-- setting up a specific id generator for a table --> <generator class="sequence"> <param name="table">seq_table</param> </generator> - <column name="CUSTID" foreign-table="CUSTOMER" foreign-column="CUSTID" /> + <column name="CUSTID"/> </primary-key> <column name="NAME" property="orderName" type="string" /> + <!-- control many-to-one and set names for a specific named foreign key constraint --> + <foreign-key constraint-name="ORDER_CUST"> + <many-to-one property="customer"/> + <set property="orders"/> + </foreign-key> </table> </hibernate-reverse-engineering>]]></programlisting> @@ -82,6 +89,52 @@ <para></para> <section> + <title>Schema Selection (<schema-selection>)</title> + + <para><literal><schema-selection></literal> is used to drive which + schema's the reverse engineering will try and process.</para> + + <para>By default the reverse engineering will read all schemas and then + use <literal><table-filter></literal> to decide which tables get + reverse engineered and which do not; this makes it easy to get started + but can be inefficient on databases with many schemas.</para> + + <para>With <literal><schema-selection></literal> it is thus + possible to limit the actual processed schemas and thus significantly + speed-up the reverse engineering. + <literal><table-filter></literal> is still used to then decide + which tables will be included/excluded.</para> + + <para>Note: If no <literal><schema-selection></literal> is + specified, the reverse engineering works as if all schemas should be + processed. This is equal to:</para> + + <programlisting><![CDATA[<schema-selection/>]]></programlisting> + + <para>which in turn is equal to:</para> + + <programlisting><![CDATA[<schema-selection match-catalog=".*" match-schema=".*" match-table=".*"/>]]></programlisting> + + <section> + <title>Examples</title> + + <para>The following will process all tables from MY_SCHEMA.</para> + + <programlisting><![CDATA[<schema-selection match-schema="MY_SCHEMA"/>]]></programlisting> + + <para>It is possible to have multiple + <literal>schema-selection</literal>'s to support multi-schema reading + or simply to limit the processing to very specific tables. The + following example process all tables in MY_SCHEMA, a specific CITY + table plus all tables that starts with CODES_ in COMMON_SCHEMA.</para> + + <programlisting><![CDATA[<schema-selection match-schema="MY_SCHEMA"/> +<schema-selection match-schema="COMMON_SCHEMA" match-table="CITY"/> +<schema-selection match-schema="COMMON_SCHEMA" match-table="CODES_.*"/>]]></programlisting> + </section> + </section> + + <section> <title>Type mappings (<type-mapping>)</title> <para>The <literal><type-mapping></literal> section specifies how @@ -97,7 +150,8 @@ length="a numeric value" precision="a numeric value" scale="a numeric value" - not-null="true|false" + not-null="true|false" + hibernate-type="hibernate type name" /> </type-mapping>]]></programlisting> @@ -128,10 +182,10 @@ named CUSTOMER:</para> <table frame="topbot"> - <title>Supported meta tags</title> + <title>sql-type examples</title> <tgroup cols="7"> - <colspec colwidth="0.5*" /> + <colspec colwidth="0.5*" /> <colspec colwidth="0.5*" /> @@ -283,13 +337,54 @@ exclude specific tables based on the schema or even a specifc prefix.</para> - <programlisting><![CDATA[<table-filter + <programlistingco> + <areaspec> + <area coords="2 55" id="tablefilter-matchcatalog" /> + + <area coords="3 55" id="tablefilter-matchschema" /> + + <area coords="4 55" id="tablefilter-matchname" /> + + <area coords="5 55" id="tablefilter-exclude" /> + + <area coords="6 55" id="tablefilter-package" /> + </areaspec> + + <programlisting><![CDATA[<table-filter match-catalog="catalog_matching_rule" match-schema="schema_matching_rule" match-name="table_matching_rule" exclude="true|false" package="package.name" />]]></programlisting> + + <calloutlist> + <callout arearefs="tablefilter-matchcatalog"> + <para>match-catalog (default: .*): Pattern for matching catalog + part of the table</para> + </callout> + + <callout arearefs="tablefilter-matchschema"> + <para>match-schema (default: .*): Pattern for matching schema part + of the table</para> + </callout> + + <callout arearefs="tablefilter-matchname"> + <para>match-table (default: .*): Pattern for matching table part + of the table</para> + </callout> + + <callout arearefs="tablefilter-exclude"> + <para>exclude (default: false): if true the table will not be part + of the reverse engineering</para> + </callout> + + <callout arearefs="tablefilter-package"> + <para>package (default: ""): The default package name to use for + classes based on tables matched by this table-filter</para> + </callout> + </calloutlist> + </programlistingco> </section> <section> @@ -299,9 +394,23 @@ configuration on how a table should be reverse engineered. Amongst other things it allow control over the naming of a class for the table, specify which identifier generator should be used for the primary key - etc.</para> + etc. Note: many databases is case-sensitive with their names and thus if + you cannot make the table match and you are sure it is not excluded by a + <table-filter> then check if the case matches; most databases + stores table names in uppercase.</para> - <programlisting><![CDATA[<table + <programlistingco> + <areaspec> + <area coords="2 55" id="table-catalog" /> + + <area coords="3 55" id="table-schema" /> + + <area coords="4 55" id="table-name" /> + + <area coords="5 55" id="table-class" /> + </areaspec> + + <programlisting><![CDATA[<table catalog="catalog_name" schema="schema_name" name="table_name" @@ -312,6 +421,26 @@ <foreign-key...> </table>]]></programlisting> + <calloutlist> + <callout arearefs="tablefilter-matchcatalog"> + <para>catalog (Optional): Catalog name for table</para> + </callout> + + <callout arearefs="tablefilter-matchschema"> + <para>schema (Optionl): Schema name for table</para> + </callout> + + <callout arearefs="tablefilter-matchname"> + <para>name (Required): Name for table</para> + </callout> + + <callout arearefs="tablefilter-exclude"> + <para>clase (Optional): The class name for table. Default name is + camelcase version of the table name. </para> + </callout> + </calloutlist> + </programlistingco> + <section> <title><primary-key></title> @@ -321,7 +450,7 @@ <generator class="generatorname"> <param name="param_name">parameter value</param> </generator> - <column...> + <key-column...> </primary-key>]]></programlisting> </section> @@ -336,10 +465,6 @@ type="hibernate_type" property="propertyName" exclude="true|false" - foreign-catalog="catalogName" - foreign-schema="schemaName" - foreign-table="tableName" - foreign-column="columnName" />]]></programlisting> </section> @@ -349,7 +474,7 @@ <para></para> <programlisting><![CDATA[<foreign-key - name="foreignKeyName" + constraint-name="foreignKeyName" foreign-catalog="catalogName" foreign-schema="schemaName" foreign-table="tableName" @@ -389,4 +514,24 @@ } }]]></programlisting> </section> + + <section> + <title>Custom Database Metadata</title> + + <para>By default the reverse engineering is performed by reading using the + JDBC database metadata API. This is done via the class + <literal>org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect</literal> + which is an implementation of + <literal>org.hibernate.cfg.reveng.dialect.MetaDataDialect</literal>.</para> + + <para>The default implementation can be replaced with an alternative + implementation by setting the property + <literal>hibernatetool.metadatadialect</literal> to a fully qualified + classname for a class that implements + <literal>JDBCMetaDataDialect</literal>.</para> + + <para>This can be used to provide database specific optimized metadata + reading. If you create an optimized/better metadata reading for your + database it will be a very welcome contribution.</para> + </section> </chapter> \ No newline at end of file |