Author: tfischer
Date: Wed May 9 12:21:05 2012
New Revision: 1336130
URL: http://svn.apache.org/viewvc?rev=1336130&view=rev
Log:
TORQUE-199: update docs for schema configuration
Modified:
db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/initialisation-configuration.xml
db/torque/torque4/trunk/torque-site/src/site/xdoc/version-specific/other-howtos/schema-howto.xml
Modified:
db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/initialisation-configuration.xml
URL:
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/initialisation-configuration.xml?rev=1336130&r1=1336129&r2=1336130&view=diff
==============================================================================
---
db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/initialisation-configuration.xml
(original)
+++
db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/initialisation-configuration.xml
Wed May 9 12:21:05 2012
@@ -376,6 +376,54 @@ torque.dsfactory.bookstore.jndi.path=jdb
</section>
+ <section name="Using Database Schemas (Namespaces)">
+
+ <subsection name="Configuring Schema Names at Runtime">
+ <p>
+ You can configure the default database schema (mysql-speak: "database")
+ which is prepended to table names in the runtime either per database
+ or as a global setting.
+ (The old way of configuring a schema per-datasource still works
+ but is deprecated and will be removed in the future).
+ Defining a schema allows e.g. in oracle to access another
+ database schema than the one of the user which connects to the
database.
+ <br/>
+ To configure a schema, add the following statements to the
+ <code>torque.properties</code> file:
+ </p>
+
+ <source><![CDATA[
+ ##
+ ## Selecting a database schema for all data sources:
+ ##
+
+ # All data sources use the public schema unless overridden
+ torque.defaults.schema = public
+
+ ##
+ ## Selecting the schema 'foo' for the database "bar"
+
+ # use the foo database
+ torque.database.bar.schema = foo
+ ]]>
+ </source>
+
+ <p>
+ If no schema is configured in the torque properties or in other places,
+ Torque will not qualify its table names.
+ </p>
+
+ </subsection>
+
+ <subsection name="Other Means to Control schemas">
+ <p>
+ See the
+ <a
href="../../../../version-specific/other-howtos/schema-howto.html">Schema
Howto</a>
+ for other ways to control the used schema.
+ </p>
+ </subsection>
+ </section>
+
<section name="Examples">
<p>
Modified:
db/torque/torque4/trunk/torque-site/src/site/xdoc/version-specific/other-howtos/schema-howto.xml
URL:
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/version-specific/other-howtos/schema-howto.xml?rev=1336130&r1=1336129&r2=1336130&view=diff
==============================================================================
---
db/torque/torque4/trunk/torque-site/src/site/xdoc/version-specific/other-howtos/schema-howto.xml
(original)
+++
db/torque/torque4/trunk/torque-site/src/site/xdoc/version-specific/other-howtos/schema-howto.xml
Wed May 9 12:21:05 2012
@@ -48,31 +48,10 @@ in the runtime.
<section name="Configuring Schema Names at Runtime">
<p>
-Schema support happens "per-DataSourceFactory". This might
-look counter-intuitive to you but is actually the easiest way to get
-this done. In the <code>torque.properties</code> file you can add use
-the following statements:
-</p>
-
-<source><![CDATA[
-##
-## Selecting a database schema for all data sources:
-##
-
-# All data sources use the public schema unless overridden
-torque.defaults.schema = public
-
-##
-## Selecting the schema 'foo' for the datasource "bar"
-
-# use the foo datasource
-torque.dsfactory.bar.schema = foo
-]]>
-</source>
-
-<p>
-If no schema is configured in the torque properties, Torque will not
-qualify its table names.
+See the
+<a
href="../../documentation/modules/runtime/reference/initialisation-configuration.html#Using_Database_Schemas_Namespaces">initialisation
part</a>
+of the runtime documentation for configuring schema names
+in the runtime configuration.
</p>
</section>
@@ -80,7 +59,7 @@ qualify its table names.
<section name="Changing the current Schema on the fly">
<p>
-The schema support happens per-Datasource. However, the schema name is
+The schema support happens per-Database. However, the schema name is
queried dynamically whenever a Torque command accesses the database
and can be changed (if you have the same table layout on multiple
schemas, you can reuse your Peer classes thus reducing the number of
@@ -89,16 +68,16 @@ classes used).
<source><![CDATA[
-/* Set the schema name for datasource "bar" to "foo" */
+/* Set the schema name for database "bar" to "foo" */
Torque.setSchema("bar", "foo");
/* Reset the schema names (no longer qualify
- * accesses to the tables of the "bar" datasource
+ * accesses to the tables of the "bar" database
*/
Torque.setSchema("bar", null);
-/* Get the current schema for the "bar" data source */
+/* Get the current schema for the "bar" database */
String barSchema = Torque.getSchema("bar");
]]>
</source>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]