From jbosstools-commits at lists.jboss.org Mon Jan 14 02:55:17 2008 Content-Type: multipart/mixed; boundary="===============0194915093647385018==" MIME-Version: 1.0 From: jbosstools-commits at lists.jboss.org To: jbosstools-commits at lists.jboss.org Subject: [jbosstools-commits] JBoss Tools SVN: r5660 - trunk/hibernatetools/docs/reference/en/modules. Date: Mon, 14 Jan 2008 02:55:17 -0500 Message-ID: --===============0194915093647385018== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ochikvina Date: 2008-01-14 02:55:17 -0500 (Mon, 14 Jan 2008) New Revision: 5660 Modified: trunk/hibernatetools/docs/reference/en/modules/ant.xml trunk/hibernatetools/docs/reference/en/modules/reverseengineering.xml Log: http://jira.jboss.com/jira/browse/JBDS-238 - updating the end of four and t= he beginning of the five chapters Modified: trunk/hibernatetools/docs/reference/en/modules/ant.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/hibernatetools/docs/reference/en/modules/ant.xml 2008-01-13 15:10= :49 UTC (rev 5659) +++ trunk/hibernatetools/docs/reference/en/modules/ant.xml 2008-01-14 07:55= :17 UTC (rev 5660) @@ -744,7 +744,7 @@ hibernate.cfg.xml . Intended to be used together with a <jdbcconfiguration> - when performing reverse engineering, but can be used w= ith any kind of + when performing reverse engineering, but it can be use= d with any kind of configuration. The <hbm2cfgxml> will contain the properties used and adds mapping entr= ies for each mapped class. @@ -786,8 +786,8 @@ = <query> - is used to execute a HQL query statements and optional= ly send the output to a - file. Can be used for verifying the mappings and for basic data ex= traction. + is used to execute a HQL query statements and optional= ly sends the output to a + file. It can be used for verifying the mappings and for basic data= extraction. = @@ -797,14 +797,14 @@ = Currently one session is opened and used for all queries and t= he query is executed via the list() method. In the future more options might become availab= le, like performing - executeUpdate(), use named queries etc. + executeUpdate(), use named queries and etc. = =
Examples = - Simplest usage of + The simplest usage of <query> will just execute the query without dumping to a fil= e. This can be used to verify that queries can actually be performed. @@ -839,7 +839,7 @@
Generic Hibernate metamodel exporter (<literal><hbmtemplat= e></literal>) = - Generic exporter that can be controlled by an user provided te= mplate or class. + Generic exporter that can be controlled by an user provides a = template or class. = The following is an example of reverse engineering via <jdbcconfiguration> - and use a custom Exporter via the + and usage of a custom Exporter via the <hbmtemplate> . = @@ -916,17 +916,17 @@ <propertyset> - . The functionality of + that is used for grouping a set of properties. More ab= out the functionality of <propertyset> - is explained in detail in the Ant task manual. + is explained in detail in the Ant manual.
=
Getting access to user specific classes = - If the templates need to access some user class it is possible= by specifying a + If the templates need to access some user class it becomes pos= sible by specifying a "toolclass" in the properties. = Modified: trunk/hibernatetools/docs/reference/en/modules/reverseengineering= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/hibernatetools/docs/reference/en/modules/reverseengineering.xml 2= 008-01-13 15:10:49 UTC (rev 5659) +++ trunk/hibernatetools/docs/reference/en/modules/reverseengineering.xml 2= 008-01-14 07:55:17 UTC (rev 5660) @@ -3,52 +3,52 @@ Controlling reverse engineering = When using the - <jdbcconfiguration> the ant task= will read the - database metadata and from that perform a reverse engineering of the - database schema into a normal Hibernate Configuration. It is from this - object e.g. - <hbm2java>can generate other art= ifacts such as - .java, - - .hbm.xml etc. + <jdbcconfiguration> + the ant task will read the database metadata and from that= will perform a reverse + engineering of the database schema into a normal Hibernate Configurati= on. It is from this object + e.g. + <hbm2java> + can generate other artifacts such as + .java + , + .hbm.xml + etc. = - To govern this process Hibernate uses a rever= se engineering strategy. - A reverse engineering strategy is mainly called to provide more java like - names for tables, column and foreignkeys into classes, properties and - associations. It also used to provide mappings from SQL types to Hibernate - types. The strategy can be customized by the user. The user can even pro= vide - its own custom reverse engineering strategy if the provided strategy is = not - enough, or simply just provide a small part of the strategy and delegate= the - rest to the default strategy. + To govern this process Hibernate uses a rever= se engineering strategy. A + reverse engineering strategy is mainly called to provide more java lik= e names for tables, column + and foreignkeys into classes, properties and associations. It also use= d to provide mappings from + SQL types to Hibernate types. The strategy can be= customized by a user. The + user can even provide its own custom reverse engineering strategy if t= he provided strategy is + not enough, or simply just provide a small part of the strategy and de= legate the rest to the + default strategy. =
Default reverse engineering strategy = - The default strategy uses some rules for mapping JDBC artifact n= ames - to java artifact names. It also provide basic typemappings from JDBC t= ypes - to = - Hibernate - types. It is the default strategy that uses the packagename - attribute to convert a table name to a fully qualified classname. + The default strategy uses some rules for mapping JDBC artifact n= ames to java artifact + names. It also provide basic typemappings from JDBC types to Hibernate + types. It is the default strategy that uses the packagename attribut= e to convert a table name + to a fully qualified classname.
=
hibernate.reveng.xml file = To have fine control over the process a - hibernate.reveng.xml file - can be provided. In this file you can specify type mappings and table - filtering. This file can be created by hand (its just basic XML) or you - can use the Hibernate plugins which have a specialized editor. + hibernate.reveng.xml + file can be provided. In this file you can specify type = mappings and table + filtering. This file can be created by hand (it's just basic XM= L) or you can use the + Hibernate plugins which have a specialized editor. = - Many databases are case-sensitive with their names and thu= s if - you cannot make some table match and you are sure it is not excluded b= y a - <table-filter>then check if the case matches; most databases sto= res - table names in uppercase. + + Many databases are case-sensitive with their names and thus if= you cannot make some + table match and you are sure it is not excluded by a <table-fil= ter>then check + if the case matches; most databases stores table names in uppercas= e. + = The following is an example of a - reveng.xml. Following the example - is more details about the format. + reveng.xml + . Following the example gives you more details about the = format. = ]]> = - = +
Schema Selection (<schema-selection>) = - <schema-selection> is used t= o drive which - schema's the reverse engineering will try and process. + <schema-selection> + is used to drive which schema's the reverse engin= eering will try and + process. = - By default the reverse engineering will read all schemas and t= hen - use - <table-filter> to decide w= hich tables get - reverse engineered and which do not; this makes it easy to get start= ed - but can be inefficient on databases with many schemas. + By default the reverse engineering will read all schemas and t= hen use + <table-filter> + to decide which tables get reverse engineered and whic= h do not; this makes it + easy to get started but can be inefficient on databases with many = schemas. = With - <schema-selection> it is thus - possible to limit the actual processed schemas and thus significantly - speed-up the reverse engineering. - - <table-filter> is still us= ed to then decide - which tables will be included/excluded. + <schema-selection> + it is thus possible to limit the actual processed sche= mas and thus significantly + speed-up the reverse engineering. + <table-filter> + is still used to then decide which tables will be incl= uded/excluded. = - If no <schema-selection> is - specified, the reverse engineering works as if all schemas should be - processed. - = - = - = - This is equal to: + + If no <schema-selection> is specifi= ed, the reverse + engineering works as if all schemas should be processed. This is= equal to: + ]]>. Which in turn is equal + to: + ]]> + = - ]]> - - Which in turn is equal to: - - ]]> -
Examples = The following will process all tables from - "MY_SCHEMA". + "MY_SCHEMA" + . = ]]> = - It is possible to have multiple - schema-selection's to support multi-schema read= ing - or simply to limit the processing to very specific tables. The - following example process all tables in - "MY_SCHEMA", a specifi= c - "CITY" - table plus all tables that starts with - "CODES_" in - COMMON_SCHEMA". + It is possible to have multiple schema-selection's to support + multi-schema reading or simply to limit the processing to very s= pecific tables. The + following example processes all tables in + "MY_SCHEMA" + , a specific + "CITY" + table plus all tables that starts with + "CODES_" + in + COMMON_SCHEMA" + . = @@ -160,12 +156,11 @@ Type mappings (<type-mapping>) = The - <type-mapping> section speci= fies how - the JDBC types found in the database should be mapped to Hibernate - types. e.g. java.sql.Types.VARCHAR with a length of 1 should be mapp= ed - to the Hibernate type yes_no or - java.sql.Types.NUMERIC should generally just be converted to the - Hibernate type long. + <type-mapping> + section specifies how the JDBC types found in the data= base should be mapped to + Hibernate types. e.g. java.sql.Types.VARCHAR with a length of 1 sh= ould be mapped to the + Hibernate type yes_no or java.sql.Types.NUMERIC= should generally just be + converted to the Hibernate type long. = ]]> = - The number of attributes specified and the sequence of the - sql-type's is important. Meaning that Hibernate will - search for the most specific first, and if no specific match is foun= d it - will seek from top to bottom when trying to resolve a type - mapping. + The number of attributes specified and the sequence of the sql-type's + is important. Meaning that Hibernate will sea= rch for the most specific + first, and if no specific match is found it will seek from top to = bottom when trying to + resolve a type mapping. =
Example = - The following is an example of a type-mapping which shows the - flexibility and the importance of ordering of the type - mappings. + The following is an example of a type-mapping which shows th= e flexibility and the + importance of ordering of the type mappings. = @@ -201,26 +194,25 @@ ]]> = - The following table shows how this affects an example table - named CUSTOMER: + The following table shows how this affects an example table = named CUSTOMER: = sql-type examples = - + = - + = - + = - + = - + = - + = - + = @@ -246,7 +238,7 @@ = INTEGER = - + = 10 = @@ -254,8 +246,7 @@ = int = - Nothing defined for INTEGER. Falling back to default - behavior. + Nothing is defined for INTEGER. Falling back to def= ault behavior. = @@ -265,15 +256,15 @@ = 30 = - + = false = your.package.TrimStringUserType = - No type-mapping matches length=3D30 and not-null=3D= false, - but type-mapping matches the 2 mappings which only specifi= es - VARCHAR. The type-mapping that comes first is chosen. + No type-mapping matches length=3D30 and not-null=3D= false, but type-mapping + matches the 2 mappings which only specifies VARCHAR. The= type-mapping that comes + first is chosen. = @@ -283,16 +274,16 @@ = 1 = - + = false = char = - Even though there is a generic match for VARCHAR, t= he - more specific type-mapping for VARCHAR with not-null=3D"fa= lse" is - chosen. The first VARCHAR sql-type matches in length but h= as - no value for not-null and thus is not considered. + Even though there is a generic match for VARCHAR, t= he more specific + type-mapping for VARCHAR with not-null=3D"false" is chos= en. The first VARCHAR + sql-type matches in length but has no value for not-null= and thus is not + considered. = @@ -302,14 +293,13 @@ = 1 = - + = true = java.lang.Character = - The most specific VARCHAR with not-null=3D"true" is - selected + The most specific VARCHAR with not-null=3D"true" is= selected = @@ -317,7 +307,7 @@ = NUMERIC = - + = 15 = @@ -325,8 +315,7 @@ = big_decimal = - There is a precise match for NUMERIC with precision - 15 + There is a precise match for NUMERIC with precision= 15 = @@ -334,7 +323,7 @@ = NUMERIC = - + = 3 = @@ -348,7 +337,7 @@
= - +
= @@ -356,22 +345,22 @@ Table filters (<table-filter>) = The - <table-filter> let you speci= fy matching rules for - performing general filtering/setup for tables, e.g. let you include = or - exclude specific tables based on the schema or even a specific - prefix. + <table-filter> + let you specify matching rules for performing general = filtering/setup for + tables, e.g. let you include or exclude specific tables based on t= he schema or even a + specific prefix. = - + = - + = - + = - + = - + = - match-catalog (default: .*): Pattern for matching catalog - part of the table + match-catalog (default: .*): Pattern for matching catalo= g part of the table = - match-schema (default: .*): Pattern for matching schema = part - of the table + match-schema (default: .*): Pattern for matching schema = part of the table = - match-table (default: .*): Pattern for matching table pa= rt - of the table + match-table (default: .*): Pattern for matching table pa= rt of the table = - exclude (default: false): if true the table will not be = part - of the reverse engineering + exclude (default: false): if true the table will not be = part of the reverse + engineering = - package (default: ""): The default package name to use f= or - classes based on tables matched by this table-filter + package (default: ""): The default package name to use f= or classes based on tables + matched by this table-filter @@ -415,21 +401,20 @@ Specific table configuration (<table>) = - <table> allows you to provid= e explicit - configuration on how a table should be reverse engineered. Amongst o= ther - 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. + <table> + allows you to provide explicit configuration on how a = table should be reverse + engineered. Amongst other things it allows controlling over the na= ming of a class for the table, + specifying which identifier generator should be used for the prima= ry key etc. = - + = - + = - + = - + = - catalog (Optional): Catalog name for table. Has to be sp= ecified if you are reverse engineering multiple catalogs or if it is not eq= ual to hiberante.default_catalog. + catalog (Optional): Catalog name for a table. It has to = be specified if you are reverse + engineering multiple catalogs or if it is not equal to + hiberante.default_catalog. = - schema (Optional): Schema name for table. Has to be spec= ified if you are reverse engineering multiple schemas or if it is not equal= to hiberante.default_schema. + schema (Optional): Schema name for a table. It has to be= specified if you are reverse + engineering multiple schemas or if it is not equal to + hiberante.default_schema. = - name (Required): Name for table + name (Required): Name for a table = - clase (Optional): The class name for table. Default name= is - camelcase version of the table name. + clase (Optional): The class name for a table. Default na= me is a camelcase version of + the table name. @@ -467,19 +456,18 @@ <primary-key> = A - <primary-key> allows you t= o define a - primary-key for tables that does not have such defined in the - database, and probably more importantly it allows you to define wh= ich - identifier strategy that should be used (even for already existing - primary-key's). + <primary-key> + allows you to define a primary-key for tables that d= on't have such defined + in the database, and probably more importantly it allows you to = define which identifier + strategy should be used (even for already existing primary-key's= ). = - + = - + = - + = - generator/class (Optional): defines which identifier - generator should be used. The class name is any hibernate sh= ort - hand name or fully qualified class name for an identifier - strategy. + generator/class (Optional): defines which identifier g= enerator should be used. + The class name is any hibernate short hand name or fully q= ualified class name for an + identifier strategy. = - generator/param (Optional): Allows to specify which - parameter with name and value should be passed to the identi= fier - generator + generator/param (Optional): Allows to specify which pa= rameter with a name and + value should be passed to the identifier generator = - key-column (Optional): Specifies which column(s ) the - primary-key consists of. A key-column is same as column, but - does not have the exclude property. + key-column (Optional): Specifies which column(s ) the = primary-key consists of. A + key-column is same as column, but does not have the exclud= e property. @@ -516,22 +501,23 @@ <column> = With a - <column> it is possible to= explicitly name the - resulting property for a column. It is also possible to redefine w= hat - jdbc and/or Hibernate type a column should be processed and finall= y it - is possible to completely exclude a column from processing. + <column> + it is possible to explicitly name the resulting prop= erty for a column. It is + also possible to redefine what jdbc and/or Hibernate type a colu= mn should be processed as and + finally it is possible to completely exclude a column from proce= ssing. = - + + - + = - + = - + = - + = - + = = - jdbc-type (Optional): Which jdbc-type this column sh= ould - be processed as. A value from java.sql.Types, either numer= ical - (93) or the constant name (TIMESTAMP). + jdbc-type (Optional): Which jdbc-type this column sh= ould be processed as. A + value from java.sql.Types, either numerical (93) or the = constant name + (TIMESTAMP). = - type (Optional): Which hibernate-type to use for this - specific column + type (Optional): Which hibernate-type to use for thi= s specific column = - property (Optional): What property name will be - generated for this column + property (Optional): What property name will be gene= rated for this + column = - exclude (default: false): set to true if this column - should be ignored + exclude (default: false): set to true if this column= should be ignored - + +
=
<foreign-key> = The - <foreign-key> has two purp= oses. One for allowing to - define foreign-keys in databases that does not support them or does - not have them defined in their schema. Secondly, to allow defining= the - name of the resulting properties (many-to-one and - one-to-many's). + <foreign-key> + has two purposes. One for allowing to define foreign= -keys in databases that + does not support them or does not have them defined in their sch= ema. Secondly, to allow + defining the name of the resulting properties (many-to-one and o= ne-to-many's). = Note: = - + + - + = - + = - + = - + = - + = - + = - + = - constraint-name (Required): Name of the foreign key - constraint. Important when naming many-to-one and set. It = is - the constraint-name that is used to link the processed - foreign-keys with the resulting property names. + constraint-name (Required): Name of the foreign key = constraint. Important when + naming many-to-one and set. It is the constraint-name th= at is used to link the + processed foreign-keys with the resulting property names= . = - foreign-catalog (Optional): Name of the foreign tabl= e's - catalog. (Only relevant if you want to explicitly define a - foreign key). + foreign-catalog (Optional): Name of the foreign tabl= e's catalog. (Only + relevant if you want to explicitly define a foreign key)= . = - foreign-schema (Optional): Name of the foreign table= 's - schema. (Only relevant if you want to explicitly define a - foreign key). + foreign-schema (Optional): Name of the foreign table= 's schema. (Only relevant + if you want to explicitly define a foreign key). = - foreign-table (Optional): Name of the foreign table. - (Only relevant if you want to explicitly define a foreign - key). + foreign-table (Optional): Name of the foreign table.= (Only relevant if you + want to explicitly define a foreign key). = - column-ref (Optional): Defines that the foreign-key - constraint between a local-column and foreign-column name. - (Only relevant if you want to explicitly define a foreign - key). + column-ref (Optional): Defines that the foreign-key = constraint between a + local-column and foreign-column name. (Only relevant if = you want to explicitly + define a foreign key). = - many-to-one (Optional): Defines that a many-to-one - should be created and the property attribute specifies the - name of the resulting property. Exclude can be used to - explicitly define that it should be created or not. + many-to-one (Optional): Defines that a many-to-one s= hould be created and the + property attribute specifies the name of the resulting p= roperty. Exclude can be + used to explicitly define that it should be created or n= ot. = - set (Optional): Defines that a set should be created - based on this foreign-key and the property attribute speci= fies - the name of the resulting (set) property. Exclude can be u= sed - to explicitly define that it should be created or not. + set (Optional): Defines that a set should be created= based on this foreign-key + and the property attribute specifies the name of the res= ulting (set) property. + Exclude can be used to explicitly define that it should = be created or not. - + +
@@ -670,17 +649,17 @@
Custom strategy = - It is possible to implement an user strategy. Such strategy must - implement - org.hibernate.cfg.reveng.ReverseEngineeringStrategy. It is - recommended that one uses the DelegatingReverseEngineeringSt= rategy and - provide a public constructor which takes another - ReverseEngineeringStrategy as argument. This w= ill allow you to only - implement the relevant methods and provide a fallback strategy. Exampl= e of - custom delegating strategy which converts all column names that ends w= ith - - "PK" into a property nam= ed - "id". + It is possible to implement an user strategy. Such strategy must= implement + org.hibernate.cfg.reveng.ReverseEngineeringStrategy + . It is recommended that one uses the + DelegatingReverseEngineeringStrategy and prov= ide a public constructor + which takes another ReverseEngineeringStrategy = as argument. This will + allow you to only implement the relevant methods and provide a fallb= ack strategy. Example of + custom delegating strategy which converts all column names that ends= with + "PK" + into a property named + "id" + . = Custom Database Metadata = - By default the reverse engineering is performed by reading using= the - JDBC database metadata API. This is done via the class - - org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect - which is an implementation of - - org.hibernate.cfg.reveng.dialect.MetaDataDialect. + By default the reverse engineering is performed by reading using= the JDBC database + metadata API. This is done via the class + org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect + which is an implementation of + org.hibernate.cfg.reveng.dialect.MetaDataDialect + . = - The default implementation can be replaced with an alternative - implementation by setting the property - - hibernatetool.metadatadialect to a= fully qualified - classname for a class that implements - JDBCMetaDataDialect. + The default implementation can be replaced with an alternative i= mplementation by setting + the property + hibernatetool.metadatadialect + to a fully qualified classname for a class that implemen= ts + JDBCMetaDataDialect. = - 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. + 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 ver= y welcome + contribution.
- \ No newline at end of file + --===============0194915093647385018==--