db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henn...@apache.org
Subject cvs commit: db-torque/xdocs/tutorial step2.xml
Date Mon, 17 May 2004 13:03:54 GMT
henning     2004/05/17 06:03:54

  Modified:    .        Tag: TORQUE_3_1_HENNING default.properties
                        maven.xml project.xml
               src/generator/src/schema Tag: TORQUE_3_1_HENNING
                        id-table-schema.xml
               src/generator/src/templates/sql/id-table Tag:
                        TORQUE_3_1_HENNING idtable.axion idtable.cloudscape
                        idtable.db2 idtable.db2400 idtable.hypersonic
                        idtable.interbase idtable.mssql idtable.mysql
                        idtable.oracle idtable.postgresql idtable.sapdb
                        idtable.sybase
               src/java/org/apache/torque Tag: TORQUE_3_1_HENNING
                        TorqueInstance.java
               src/java/org/apache/torque/oid Tag: TORQUE_3_1_HENNING
                        IDBroker.java
               src/rttest Tag: TORQUE_3_1_HENNING id-table-schema.xml
               xdocs    Tag: TORQUE_3_1_HENNING release-changes.xml
                        user-guide.xml
               xdocs/tutorial Tag: TORQUE_3_1_HENNING step2.xml
  Added:       src/schema Tag: TORQUE_3_1_HENNING id-table-schema.xml
  Removed:     proposals/henning/idtable-peer Tag: TORQUE_3_1_HENNING
                        README idtable-peer.patch
  Log:
  Added the idtable-peer proposal to the TORQUE_3_1_HENNING branch.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.58.4.1  +27 -0     db-torque/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/db-torque/default.properties,v
  retrieving revision 1.58
  retrieving revision 1.58.4.1
  diff -u -r1.58 -r1.58.4.1
  --- default.properties	18 Aug 2003 15:21:03 -0000	1.58
  +++ default.properties	17 May 2004 13:03:52 -0000	1.58.4.1
  @@ -16,6 +16,33 @@
   rttest.dir = ${src.dir}/rttest
   
   # -------------------------------------------------------------------
  +# Torque Plugin Properties
  +# -------------------------------------------------------------------
  +basePrefix = Base
  +addIntakeRetrievable = false
  +torque.saveException = TorqueException
  +torque.project       = default
  +#
  +# Dummy value. Is not actually used in the om generation but must
  +# be present and a valid database.
  +torque.database      = mysql
  +#
  +torque.java.dir   = target/src
  +torque.sql.dir    = target/sql
  +torque.output.dir = target/sql
  +torque.schema.dir = target/xml
  +torque.contextProperties = default.properties
  +#
  +torque.schema.om.includes = *-schema.xml
  +torque.schema.om.excludes = 
  +
  +# -------------------------------------------------------------------
  +# Default database name and package for the id-table peer and objects
  +# -------------------------------------------------------------------
  +idtable.database.name    = ${torque.project}
  +idtable.database.package = org.apache.torque.oid.om
  +
  +# -------------------------------------------------------------------
   # Standard Torque build file references used for testing.
   # -------------------------------------------------------------------
   torque.distDir = ${build.test}/rttest
  
  
  
  1.20.4.1  +61 -0     db-torque/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/db-torque/maven.xml,v
  retrieving revision 1.20
  retrieving revision 1.20.4.1
  diff -u -r1.20 -r1.20.4.1
  --- maven.xml	18 Aug 2003 15:20:09 -0000	1.20
  +++ maven.xml	17 May 2004 13:03:52 -0000	1.20.4.1
  @@ -1,5 +1,16 @@
  +<?xml version="1.0" encoding="ISO-8859-1"?>
  +
  +<!-- ======================================================================== -->
  +<!--                                                                          -->
  +<!--  maven Buildfile                                                         -->
  +<!--                                                                          -->
  +<!-- $Id$ -->
  +<!--                                                                          -->
  +<!-- ======================================================================== -->
  +
   <project
     default="java:jar"
  +  xmlns:j="jelly:core"
     xmlns:deploy="deploy">
   
     <!-- Allow any user specific values to override the defaults -->
  @@ -8,6 +19,56 @@
     <property file="build.properties" />
     <!-- Set default values for the build -->
     <property file="default.properties" />
  +
  +  <!-- ================================================================== -->
  +  <!-- J A V A : C O M P I L E   P R E   G O A L                          -->
  +  <!-- ================================================================== -->
  +  <!-- copy the source to target/src so we can add the generated peers    -->
  +  <!-- for the id table                                                   -->
  +  <!-- ================================================================== -->
  +   <preGoal name="java:compile">
  +
  +    <!-- Did you happen to see the most sucking buildtool in the world... -->
  +    <j:if test="${pom.id == 'torque:torquex'}"> 
  +    <!-- ...and if you saw it, was it crashing? 
  +                             (With apologies to Charlie Rich) -->
  +      <copy todir="target/src">
  +        <fileset dir="src/java"/>
  +      </copy>
  +
  +      <path id="maven.compile.src.set">
  +        <pathelement location="${pom.build.SourceDirectory}"/>
  +      </path>
  +
  +      <j:if test="${omGenerated != 'true'}">
  +        <echo>Generating sources ...</echo>
  +        <attainGoal name="torquex:om"/>
  +      </j:if>
  +
  +      <property name="sourcesPresent" value="true"/>
  +    </j:if>
  +  </preGoal>
  +
  +  <!-- ================================================== -->
  +  <!-- Create the Peers for the ID Table                  -->
  +  <!-- ================================================== -->
  +
  +  <preGoal name="torquex:init">
  +    <attainGoal name="copy-om"/>
  +  </preGoal>
  +
  +  <!-- ================================================== -->
  +  <!-- Prepare the OM Sources for Torque                  -->
  +  <!-- ================================================== -->
  +
  +  <goal name="copy-om">
  +    <filter token="DATABASE_DEFAULT" value="${idtable.database.name}"/>
  +    <filter token="DATABASE_PACKAGE" value="${idtable.database.package}"/>
  +    <copy
  +      file="src/schema/id-table-schema.xml"
  +      tofile="${torque.schema.dir}/id-table-schema.xml"
  +      filtering="yes"/>
  +  </goal>
   
     <!-- ================================================================== -->
     <!-- D I S T : B U I L D _ B I N   P R E   G O A L                      -->
  
  
  
  1.103.2.6.2.2 +1 -1      db-torque/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/db-torque/project.xml,v
  retrieving revision 1.103.2.6.2.1
  retrieving revision 1.103.2.6.2.2
  diff -u -r1.103.2.6.2.1 -r1.103.2.6.2.2
  --- project.xml	17 May 2004 12:31:20 -0000	1.103.2.6.2.1
  +++ project.xml	17 May 2004 13:03:52 -0000	1.103.2.6.2.2
  @@ -284,7 +284,7 @@
   
     <build>
       <nagEmailAddress>torque-dev@db.apache.org</nagEmailAddress>
  -    <sourceDirectory>src/java</sourceDirectory>
  +    <sourceDirectory>target/src</sourceDirectory>
       <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
       <aspectSourceDirectory></aspectSourceDirectory>
   
  
  
  
  No                   revision
  No                   revision
  1.2.4.1   +6 -6      db-torque/src/generator/src/schema/id-table-schema.xml
  
  Index: id-table-schema.xml
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/schema/id-table-schema.xml,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- id-table-schema.xml	24 Jul 2003 12:40:41 -0000	1.2
  +++ id-table-schema.xml	17 May 2004 13:03:52 -0000	1.2.4.1
  @@ -15,13 +15,13 @@
   
   <database name="@DATABASE_DEFAULT@">
     <table name="ID_TABLE" idMethod="idbroker">
  -    <column name="ID_TABLE_ID" required="true" primaryKey="true" type="INTEGER"/>
  -    <column name="TABLE_NAME" required="true" size="255" type="VARCHAR"/>
  -    <column name="NEXT_ID" type="INTEGER"/>
  -    <column name="QUANTITY" type="INTEGER"/>
  +    <column name="ID_TABLE_ID" required="true" primaryKey="true" type="INTEGER" javaName="IdTableId"/>
  +    <column name="ID_TABLE_TABLE_NAME" required="true" size="255" type="VARCHAR" javaName="TableName"/>
  +    <column name="ID_TABLE_NEXT_ID" required="true" type="INTEGER" javaName="NextId"/>
  +    <column name="ID_TABLE_QUANTITY" required="true" type="INTEGER" javaName="Quantity"/>
   
       <unique>
  -      <unique-column name="TABLE_NAME"/>
  +      <unique-column name="ID_TABLE_TABLE_NAME"/>
       </unique>
   
     </table>
  
  
  
  No                   revision
  No                   revision
  1.2.4.1   +1 -1      db-torque/src/generator/src/templates/sql/id-table/idtable.axion
  
  Index: idtable.axion
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/id-table/idtable.axion,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- idtable.axion	16 Jul 2003 09:47:33 -0000	1.2
  +++ idtable.axion	17 May 2004 13:03:52 -0000	1.2.4.1
  @@ -1,4 +1,4 @@
   #foreach ($tbl in $tables)
  -insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES ($initialID, '$tbl.Name',
$initialIDValue, $initialIDStep);
  +insert into ID_TABLE (id_table_id, id_table_table_name, id_table_next_id, id_table_quantity)
VALUES ($initialID, '$tbl.Name', $initialIDValue, $initialIDStep);
   #set ( $initialID = $initialID + 1 )
   #end
  
  
  
  1.3.4.1   +1 -1      db-torque/src/generator/src/templates/sql/id-table/idtable.cloudscape
  
  Index: idtable.cloudscape
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/id-table/idtable.cloudscape,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- idtable.cloudscape	16 Jul 2003 09:47:33 -0000	1.3
  +++ idtable.cloudscape	17 May 2004 13:03:52 -0000	1.3.4.1
  @@ -1,4 +1,4 @@
   #foreach ($tbl in $tables)
  -insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES ($initialID, '$tbl.Name',
$initialIDValue, $initialIDStep);
  +insert into ID_TABLE (id_table_id, id_table_table_name, id_table_next_id, id_table_quantity)
VALUES ($initialID, '$tbl.Name', $initialIDValue, $initialIDStep);
   #set ( $initialID = $initialID + 1 )
   #end
  
  
  
  1.2.4.1   +1 -1      db-torque/src/generator/src/templates/sql/id-table/idtable.db2
  
  Index: idtable.db2
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/id-table/idtable.db2,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- idtable.db2	16 Jul 2003 09:47:33 -0000	1.2
  +++ idtable.db2	17 May 2004 13:03:52 -0000	1.2.4.1
  @@ -1,4 +1,4 @@
   #foreach ($tbl in $tables)
  -insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES ($initialID, '$tbl.Name',
$initialIDValue, $initialIDStep);
  +insert into ID_TABLE (id_table_id, id_table_table_name, id_table_next_id, id_table_quantity)
VALUES ($initialID, '$tbl.Name', $initialIDValue, $initialIDStep);
   #set ( $initialID = $initialID + 1 )
   #end
  
  
  
  1.2.4.1   +1 -1      db-torque/src/generator/src/templates/sql/id-table/idtable.db2400
  
  Index: idtable.db2400
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/id-table/idtable.db2400,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- idtable.db2400	16 Jul 2003 09:47:33 -0000	1.2
  +++ idtable.db2400	17 May 2004 13:03:52 -0000	1.2.4.1
  @@ -1,5 +1,5 @@
   #foreach ($tbl in $tables)
  -insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES ($initialID, '$tbl.Name',
$initialIDValue, $initialIDStep);
  +insert into ID_TABLE (id_table_id, id_table_table_name, id_table_next_id, id_table_quantity)
VALUES ($initialID, '$tbl.Name', $initialIDValue, $initialIDStep);
   #set ( $initialID = $initialID + 1 )
   #end
   
  
  
  
  1.2.4.1   +1 -1      db-torque/src/generator/src/templates/sql/id-table/idtable.hypersonic
  
  Index: idtable.hypersonic
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/id-table/idtable.hypersonic,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- idtable.hypersonic	16 Jul 2003 09:47:33 -0000	1.2
  +++ idtable.hypersonic	17 May 2004 13:03:52 -0000	1.2.4.1
  @@ -1,4 +1,4 @@
   #foreach ($tbl in $tables)
  -insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES ($initialID, '$tbl.Name',
$initialIDValue, $initialIDStep);
  +insert into ID_TABLE (id_table_id, id_table_table_name, id_table_next_id, id_table_quantity)
VALUES ($initialID, '$tbl.Name', $initialIDValue, $initialIDStep);
   #set ( $initialID = $initialID + 1 )
   #end
  
  
  
  1.2.4.1   +1 -1      db-torque/src/generator/src/templates/sql/id-table/idtable.interbase
  
  Index: idtable.interbase
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/id-table/idtable.interbase,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- idtable.interbase	16 Jul 2003 09:47:33 -0000	1.2
  +++ idtable.interbase	17 May 2004 13:03:52 -0000	1.2.4.1
  @@ -1,4 +1,4 @@
   #foreach ($tbl in $tables)
  -insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES ($initialID, '$tbl.Name',
$initialIDValue, $initialIDStep);
  +insert into ID_TABLE (id_table_id, id_table_table_name, id_table_next_id, id_table_quantity)
VALUES ($initialID, '$tbl.Name', $initialIDValue, $initialIDStep);
   #set ( $initialID = $initialID + 1 )
   #end
  
  
  
  1.2.4.1   +1 -1      db-torque/src/generator/src/templates/sql/id-table/idtable.mssql
  
  Index: idtable.mssql
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/id-table/idtable.mssql,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- idtable.mssql	16 Jul 2003 09:47:33 -0000	1.2
  +++ idtable.mssql	17 May 2004 13:03:53 -0000	1.2.4.1
  @@ -1,4 +1,4 @@
   #foreach ($tbl in $tables)
  -insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES ($initialID, '$tbl.Name',
$initialIDValue, $initialIDStep);
  +insert into ID_TABLE (id_table_id, id_table_table_name, id_table_next_id, id_table_quantity)
VALUES ($initialID, '$tbl.Name', $initialIDValue, $initialIDStep);
   #set ( $initialID = $initialID + 1 )
   #end
  
  
  
  1.2.4.1   +1 -1      db-torque/src/generator/src/templates/sql/id-table/idtable.mysql
  
  Index: idtable.mysql
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/id-table/idtable.mysql,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- idtable.mysql	16 Jul 2003 09:47:33 -0000	1.2
  +++ idtable.mysql	17 May 2004 13:03:53 -0000	1.2.4.1
  @@ -1,4 +1,4 @@
   #foreach ($tbl in $tables)
  -insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES ($initialID, '$tbl.Name',
$initialIDValue, $initialIDStep);
  +insert into ID_TABLE (id_table_id, id_table_table_name, id_table_next_id, id_table_quantity)
VALUES ($initialID, '$tbl.Name', $initialIDValue, $initialIDStep);
   #set ( $initialID = $initialID + 1 )
   #end
  
  
  
  1.2.4.1   +1 -1      db-torque/src/generator/src/templates/sql/id-table/idtable.oracle
  
  Index: idtable.oracle
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/id-table/idtable.oracle,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- idtable.oracle	16 Jul 2003 09:47:33 -0000	1.2
  +++ idtable.oracle	17 May 2004 13:03:53 -0000	1.2.4.1
  @@ -1,4 +1,4 @@
   #foreach ($tbl in $tables)
  -insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES ($initialID, '$tbl.Name',
$initialIDValue, $initialIDStep);
  +insert into ID_TABLE (id_table_id, id_table_table_name, id_table_next_id, id_table_quantity)
VALUES ($initialID, '$tbl.Name', $initialIDValue, $initialIDStep);
   #set ( $initialID = $initialID + 1 )
   #end
  
  
  
  1.2.4.1   +1 -1      db-torque/src/generator/src/templates/sql/id-table/idtable.postgresql
  
  Index: idtable.postgresql
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/id-table/idtable.postgresql,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- idtable.postgresql	16 Jul 2003 09:47:33 -0000	1.2
  +++ idtable.postgresql	17 May 2004 13:03:53 -0000	1.2.4.1
  @@ -1,4 +1,4 @@
   #foreach ($tbl in $tables)
  -insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES ($initialID, '$tbl.Name',
$initialIDValue, $initialIDStep);
  +insert into ID_TABLE (id_table_id, id_table_table_name, id_table_next_id, id_table_quantity)
VALUES ($initialID, '$tbl.Name', $initialIDValue, $initialIDStep);
   #set ( $initialID = $initialID + 1 )
   #end
  
  
  
  1.2.4.1   +1 -1      db-torque/src/generator/src/templates/sql/id-table/idtable.sapdb
  
  Index: idtable.sapdb
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/id-table/idtable.sapdb,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- idtable.sapdb	16 Jul 2003 09:47:33 -0000	1.2
  +++ idtable.sapdb	17 May 2004 13:03:53 -0000	1.2.4.1
  @@ -1,5 +1,5 @@
   #foreach ($tbl in $tables)
  -insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES ($initialID, '$tbl.Name',
$initialIDValue, $initialIDStep);
  +insert into ID_TABLE (id_table_id, id_table_table_name, id_table_next_id, id_table_quantity)
VALUES ($initialID, '$tbl.Name', $initialIDValue, $initialIDStep);
   #set ( $initialID = $initialID + 1 )
   #end
   
  
  
  
  1.2.4.1   +1 -1      db-torque/src/generator/src/templates/sql/id-table/idtable.sybase
  
  Index: idtable.sybase
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/id-table/idtable.sybase,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- idtable.sybase	16 Jul 2003 09:47:33 -0000	1.2
  +++ idtable.sybase	17 May 2004 13:03:53 -0000	1.2.4.1
  @@ -1,4 +1,4 @@
   #foreach ($tbl in $tables)
  -insert into ID_TABLE (ID_TABLE_ID, TABLE_NAME, NEXT_ID, QUANTITY) VALUES ($initialID, '$tbl.Name',
$initialIDValue, $initialIDStep); 
  +insert into ID_TABLE (ID_TABLE_ID, ID_TABLE_TABLE_NAME, ID_TABLE_NEXT_ID, ID_TABLE_QUANTITY)
VALUES ($initialID, '$tbl.Name', $initialIDValue, $initialIDStep); 
   #set ( $initialID = $initialID + 1 )
   #end
  
  
  
  No                   revision
  No                   revision
  1.5.2.1.2.2 +6 -6      db-torque/src/java/org/apache/torque/TorqueInstance.java
  
  Index: TorqueInstance.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/java/org/apache/torque/TorqueInstance.java,v
  retrieving revision 1.5.2.1.2.1
  retrieving revision 1.5.2.1.2.2
  diff -u -r1.5.2.1.2.1 -r1.5.2.1.2.2
  --- TorqueInstance.java	17 May 2004 12:49:19 -0000	1.5.2.1.2.1
  +++ TorqueInstance.java	17 May 2004 13:03:53 -0000	1.5.2.1.2.2
  @@ -659,12 +659,12 @@
        */
       private final void setupIdTable(DatabaseMap map)
       {
  -        map.setIdTable("ID_TABLE");
  +        map.setIdTable(IDBroker.ID_TABLE);
           TableMap tMap = map.getIdTable();
  -        tMap.addPrimaryKeyWithJavaName("ID_TABLE_ID", "IdTableId", new Integer(0));
  -        tMap.addColumnWithJavaName("TABLE_NAME", "TableName", "");
  -        tMap.addColumnWithJavaName("NEXT_ID", "NextId", new Integer(0));
  -        tMap.addColumnWithJavaName("QUANTITY", "Quantity", new Integer(0));
  +        tMap.addPrimaryKeyWithJavaName(IDBroker.COL_TABLE_ID,  "IdTableId", new Integer(0));
  +        tMap.addColumnWithJavaName(IDBroker.COL_TABLE_NAME,    "TableName", "");
  +        tMap.addColumnWithJavaName(IDBroker.COL_NEXT_ID, "NextId", new Integer(0));
  +        tMap.addColumnWithJavaName(IDBroker.COL_QUANTITY,      "Quantity", new Integer(0));
       }
   
       /**
  
  
  
  No                   revision
  No                   revision
  1.27.2.2.2.1 +12 -12    db-torque/src/java/org/apache/torque/oid/IDBroker.java
  
  Index: IDBroker.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/java/org/apache/torque/oid/IDBroker.java,v
  retrieving revision 1.27.2.2
  retrieving revision 1.27.2.2.2.1
  diff -u -r1.27.2.2 -r1.27.2.2.2.1
  --- IDBroker.java	29 Feb 2004 23:14:13 -0000	1.27.2.2
  +++ IDBroker.java	17 May 2004 13:03:53 -0000	1.27.2.2.2.1
  @@ -52,17 +52,17 @@
    * follows:<br>
    *
    * ID_TABLE_ID - The PK for this row (any unique int).<br>
  - * TABLE_NAME - The name of the table you want ids for.<br>
  - * NEXT_ID - The next id returned by IDBroker when it queries the
  + * ID_TABLE_TABLE_NAME - The name of the table you want ids for.<br>
  + * ID_TABLE_NEXT_ID - The next id returned by IDBroker when it queries the
    *           database (not when it returns an id from memory).<br>
  - * QUANTITY - The number of ids that IDBroker will cache in memory.<br>
  + * ID_TABLE_QUANTITY - The number of ids that IDBroker will cache in memory.<br>
    * <p>
    * Use this class like this:
    * <pre>
  - * int id = dbMap.getIDBroker().getNextIdAsInt(null, "TABLE_NAME");
  + * int id = dbMap.getIDBroker().getIdAsInt(null, "YOUR_TABLE");
    *  - or -
    * BigDecimal[] ids = ((IDBroker)dbMap.getIDBroker())
  - *     .getNextIds("TABLE_NAME", numOfIdsToReturn);
  + *     .getNextIds("YOUR_TABLE", numOfIdsToReturn);
    * </pre>
    *
    * NOTE: When the ID_TABLE must be updated we must ensure that
  @@ -79,7 +79,7 @@
       public static final String ID_TABLE = "ID_TABLE";
   
       /** Table_Name column name */
  -    public static final String COL_TABLE_NAME = "TABLE_NAME";
  +    public static final String COL_TABLE_NAME = "ID_TABLE_TABLE_NAME";
   
       /** Fully qualified Table_Name column name */
       public static final String TABLE_NAME = ID_TABLE + "." + COL_TABLE_NAME;
  @@ -91,13 +91,13 @@
       public static final String TABLE_ID = ID_TABLE + "." + COL_TABLE_ID;
   
       /** Next_ID column name */
  -    public static final String COL_NEXT_ID = "NEXT_ID";
  +    public static final String COL_NEXT_ID = "ID_TABLE_NEXT_ID";
   
       /** Fully qualified Next_ID column name */
       public static final String NEXT_ID = ID_TABLE + "." + COL_NEXT_ID;
   
       /** Quantity column name */
  -    public static final String COL_QUANTITY = "QUANTITY";
  +    public static final String COL_QUANTITY = "ID_TABLE_QUANTITY";
   
       /** Fully qualified Quantity column name */
       public static final String QUANTITY = ID_TABLE + "." + COL_QUANTITY;
  @@ -646,7 +646,7 @@
   
               // Read the next starting ID from the ID_TABLE.
               BigDecimal[] results = selectRow(connection, tableName);
  -            nextId = results[0]; // NEXT_ID column
  +            nextId = results[0]; // ID_TABLE_NEXT_ID column
   
               // Update the row based on the quantity in the
               // ID_TABLE.
  @@ -687,7 +687,7 @@
       /**
        * This method allows you to get the number of ids that are to be
        * cached in memory.  This is either stored in quantityStore or
  -     * read from the db. (ie the value in ID_TABLE.QUANTITY).
  +     * read from the db. (ie the value in ID_TABLE.ID_TABLE_QUANTITY).
        *
        * Though this method returns a BigDecimal for the quantity, it is
        * unlikey the system could withstand whatever conditions would lead
  @@ -728,7 +728,7 @@
                   // Read the row from the ID_TABLE.
                   BigDecimal[] results = selectRow(dbCon, tableName);
   
  -                // QUANTITY column.
  +                // ID_TABLE_QUANTITY column.
                   quantity = results[1];
                   quantityStore.put(tableName, quantity);
               }
  
  
  
  No                   revision
  No                   revision
  1.4.4.1   +5 -5      db-torque/src/rttest/id-table-schema.xml
  
  Index: id-table-schema.xml
  ===================================================================
  RCS file: /home/cvs/db-torque/src/rttest/id-table-schema.xml,v
  retrieving revision 1.4
  retrieving revision 1.4.4.1
  diff -u -r1.4 -r1.4.4.1
  --- id-table-schema.xml	20 Jun 2003 18:50:01 -0000	1.4
  +++ id-table-schema.xml	17 May 2004 13:03:53 -0000	1.4.4.1
  @@ -16,12 +16,12 @@
   <database name="@DATABASE_DEFAULT@">
     <table name="ID_TABLE" idMethod="idbroker">
       <column name="ID_TABLE_ID" required="true" primaryKey="true" type="INTEGER"/>
  -    <column name="TABLE_NAME" required="true" size="255" type="VARCHAR"/>
  -    <column name="NEXT_ID" type="INTEGER"/>
  -    <column name="QUANTITY" type="INTEGER"/>
  +    <column name="ID_TABLE_TABLE_NAME" required="true" size="255" type="VARCHAR"/>
  +    <column name="ID_TABLE_NEXT_ID" type="INTEGER"/>
  +    <column name="ID_TABLE_QUANTITY" type="INTEGER"/>
       
       <unique>
  -      <unique-column name="TABLE_NAME"/>
  +      <unique-column name="ID_TABLE_TABLE_NAME"/>
       </unique>        
       
     </table>
  
  
  
  No                   revision
  No                   revision
  1.8.2.1   +12 -8     db-torque/src/schema/Attic/id-table-schema.xml
  
  
  
  
  No                   revision
  No                   revision
  1.3.2.5.2.4 +62 -0     db-torque/xdocs/release-changes.xml
  
  Index: release-changes.xml
  ===================================================================
  RCS file: /home/cvs/db-torque/xdocs/release-changes.xml,v
  retrieving revision 1.3.2.5.2.3
  retrieving revision 1.3.2.5.2.4
  diff -u -r1.3.2.5.2.3 -r1.3.2.5.2.4
  --- release-changes.xml	17 May 2004 12:49:19 -0000	1.3.2.5.2.3
  +++ release-changes.xml	17 May 2004 13:03:54 -0000	1.3.2.5.2.4
  @@ -53,6 +53,68 @@
   method signature errors!<br/>
   </p>
   </subsection>
  +
  +<subsection name="ID-Table Peer Patch">
  +<p>
  +Did you actually know that there are no peer and object classes for
  +the ID_TABLE used by the IDBroker of Torque?<br/>
  +
  +Do you want to know the reason why? You can't build them! Try it. If
  +you do, you will notice that there is a clash between the constant for
  +the <code>TABLE_NAME</code> column (which is called <code>IdTablePeer.TABLE_NAME</code>)
and the
  +<code>TABLE_NAME</code> constant which contains the Name of the table (IdTable).<br/>
  +
  +This patch does two things:<br/>
  +<ul>
  +<li>It prefixes all the columns from the ID_TABLE with &quot;ID_TABLE_&quot;.
So TABLE_NAME
  +    becomes ID_TABLE_TABLE_NAME and NEXT_ID becomes TABLE_NAME_NEXT_ID.</li>
  +
  +<li>It adds (besides reworking the build process and removing a few bugs)
  +    torque generated peer classes and a mapper to the torque.jar. These are
  +    in <code>org.apache.torque.oid.om</code>. If you actually want to <b>use</b>
the Peer, 
  +    you must make sure that it registers correctly with your database map
  +    (it has database <code>default</code> hard coded) so you won't get any
clashes
  +    (Torque itself patches up some sort of &quot;virtual aka hacked&quot> table
map
  +    for the <code>ID_TABLE</code> of each database, which then in turn contains
the 
  +    right database name instead of being hardcoded on &quot;default&quot;. This
wants
  +    more testing!
  +</li>
  +</ul>
  +
  +  This change is as breaking for current Torque applications as it can be. You must actually
rebuild your
  +  database SQL files and if you want to use an existing database, you must rename the columns
in your <code>ID_TABLE</code>!<br/>
  +
  +  If you happen to use <a href="http://www.postgresql.org/">PostgreSQL</a>,
lucky you! You can simply use the
  +  following script to change the column names of your database.<br/>
  +<source><![CDATA[
  +-- ------------------------------------------------------------------------
  +-- Simple script to migrate a postgresql id_table from the
  +-- old column names to the new ones, prefixed with id_table
  +-- ------------------------------------------------------------------------
  +-- Usage: psql <options> yourdatabase < migration-postgresql.sql
  +-- ------------------------------------------------------------------------
  +-- @Author:  Henning P. Schmiedehausen <hps@intermeta.de>
  +-- @Version: $Header$
  +-- ------------------------------------------------------------------------
  +
  +alter table id_table add column id_table_table_name varchar(255);
  +alter table id_table add column id_table_next_id integer;        
  +alter table id_table add column id_table_quantity integer;
  +
  +update id_table set id_table_table_name = table_name;
  +update id_table set id_table_next_id = next_id;      
  +update id_table set id_table_quantity = quantity;
  +
  +alter table id_table alter column id_table_table_name set not null;
  +alter table id_table alter column id_table_next_id set not null;
  +alter table id_table alter column id_table_quantity set not null;
  +
  +alter table id_table drop table_name;                            
  +alter table id_table drop next_id;   
  +alter table id_table drop quantity;
  +]]></source>
  +</p>
  +</subsection>
   </section>
   
   <section name="Torque 3.1.1.">
  
  
  
  1.12.4.1  +10 -10    db-torque/xdocs/user-guide.xml
  
  Index: user-guide.xml
  ===================================================================
  RCS file: /home/cvs/db-torque/xdocs/user-guide.xml,v
  retrieving revision 1.12
  retrieving revision 1.12.4.1
  diff -u -r1.12 -r1.12.4.1
  --- user-guide.xml	8 Jan 2003 16:05:27 -0000	1.12
  +++ user-guide.xml	17 May 2004 13:03:54 -0000	1.12.4.1
  @@ -147,9 +147,9 @@
   
     <table name="ID_TABLE">
       <column name="ID_TABLE_ID" required="true" primaryKey="true" type="INTEGER"/>
  -    <column name="TABLE_NAME" required="true" size="255" type="VARCHAR"/>
  -    <column name="NEXT_ID" type="INTEGER"/>
  -    <column name="QUANTITY" type="INTEGER"/>
  +    <column name="ID_TABLE_TABLE_NAME" required="true" size="255" type="VARCHAR"/>
  +    <column name="ID_TABLE_NEXT_ID" type="INTEGER"/>
  +    <column name="ID_TABLE_QUANTITY" type="INTEGER"/>
   
       <unique>
         <unique-column name="TABLE_NAME"/>
  @@ -202,11 +202,11 @@
   CREATE TABLE ID_TABLE
   (
       ID_TABLE_ID integer NOT NULL,
  -    TABLE_NAME varchar(255) NOT NULL,
  -    NEXT_ID integer,
  -    QUANTITY integer,
  +    ID_TABLE_TABLE_NAME varchar(255) NOT NULL,
  +    ID_TABLE_NEXT_ID integer,
  +    ID_TABLE_QUANTITY integer,
       PRIMARY KEY(ID_TABLE_ID),
  -    UNIQUE(TABLE_NAME)
  +    UNIQUE(ID_TABLE_TABLE_NAME)
   );
   
   drop table if exists Jobentry;
  @@ -276,13 +276,13 @@
       <td>ID_TABLE_ID</td><td >INTEGER</td><td>&#160;</td>
     </tr>
     <tr>
  -    <td>TABLE_NAME</td><td >VARCHAR</td><td >255&#160;</td>
  +    <td>ID_TABLE_TABLE_NAME</td><td >VARCHAR</td><td >255&#160;</td>
     </tr>
     <tr>
  -    <td>NEXT_ID</td><td >INTEGER</td><td >&#160;</td>
  +    <td>ID_TABLE_NEXT_ID</td><td >INTEGER</td><td >&#160;</td>
     </tr>
     <tr>
  -    <td>QUANTITY</td><td >INTEGER</td><td >&#160;</td>
  +    <td>ID_TABLE_QUANTITY</td><td >INTEGER</td><td >&#160;</td>
     </tr>
   
   </table>
  
  
  
  No                   revision
  No                   revision
  1.6.2.1.2.1 +3 -3      db-torque/xdocs/tutorial/step2.xml
  
  Index: step2.xml
  ===================================================================
  RCS file: /home/cvs/db-torque/xdocs/tutorial/step2.xml,v
  retrieving revision 1.6.2.1
  retrieving revision 1.6.2.1.2.1
  diff -u -r1.6.2.1 -r1.6.2.1.2.1
  --- step2.xml	5 Jan 2004 00:32:58 -0000	1.6.2.1
  +++ step2.xml	17 May 2004 13:03:54 -0000	1.6.2.1.2.1
  @@ -396,15 +396,15 @@
         primaryKey="true"
         type="INTEGER"/>
       <column
  -      name="TABLE_NAME"
  +      name="ID_TABLE_TABLE_NAME"
         required="true"
         size="255"
         type="VARCHAR"/>
       <column
  -      name="NEXT_ID"
  +      name="ID_TABLE_NEXT_ID"
         type="INTEGER"/>
       <column
  -      name="QUANTITY"
  +      name="ID_TABLE_QUANTITY"
         type="INTEGER"/>
       <unique>
         <unique-column name="TABLE_NAME"/>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message