db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpoes...@apache.org
Subject cvs commit: db-torque/src/generator/src/templates/data/dump Control.vm
Date Sun, 05 Oct 2003 14:14:04 GMT
mpoeschl    2003/10/05 07:14:04

  Modified:    src/generator/src/java/org/apache/torque/engine/database/model
                        Database.java
               src/generator/src/test/org/apache/torque/engine/database/model
                        NameFactoryTest.java TableTest.java
               src/generator/src/templates/om Control.vm
               src/generator/src/templates/doc/html datamodel.vm
               src/generator/src/java/org/apache/torque/engine/database/transform
                        XmlToAppData.java SQLToAppData.java
               src/generator/src/java/org/apache/torque/task
                        TorqueSQLTask.java TorqueDataSQLTask.java
                        TorqueDataModelTask.java
                        TorqueSQLTransformTask.java
               src/generator/src/test/org/apache/torque/engine/database
                        TestPackageHandling.java
               src/generator/src/templates/doc/anakia datamodel.vm
               src/generator/src/templates/sql/id-table Control.vm
               src/generator/src/templates/data Control.vm
               src/generator/src/templates/doc Control.vm
               src/generator/src/templates/sql/base Control.vm
               src/generator/src/templates/data/dump Control.vm
  Removed:     src/generator/src/java/org/apache/torque/engine/database/model
                        AppData.java
  Log:
  model refactoring
  - remove AppData
  - add fileName attribute to Database
  - SQLToAppData and XmlToAppData now return Database
  - refactor Tasks to match new model structure
  - refactor templates to match new model structure
  
  Revision  Changes    Path
  1.8       +23 -22    db-torque/src/generator/src/java/org/apache/torque/engine/database/model/Database.java
  
  Index: Database.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/database/model/Database.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Database.java	27 Sep 2003 11:13:48 -0000	1.7
  +++ Database.java	5 Oct 2003 14:14:03 -0000	1.8
  @@ -87,12 +87,23 @@
       private String defaultIdMethod;
       private String defaultJavaType;
       private String defaultJavaNamingMethod;
  -    private AppData dbParent;
       private Hashtable tablesByName = new Hashtable();
       private Hashtable tablesByJavaName = new Hashtable();
       private boolean heavyIndexing;
  +    /** the name of the definition file */
  +    private String fileName;
   
       /**
  +     * Creates a new instance for the specified database type.
  +     *
  +     * @param databaseType The default type for this database.
  +     */
  +    public Database(String databaseType)
  +    {
  +        this.databaseType = databaseType;
  +    }
  +    
  +    /**
        * Load the database object from an xml tag.
        *
        * @param attrib the xml attributes
  @@ -134,6 +145,16 @@
   //        this.name = (name == null ? Torque.getDefaultDB() : name);
           this.name = (name == null ? "default" : name);
       }
  +    
  +    public String getFileName()
  +    {
  +        return fileName;
  +    }
  +    
  +    public void setFileName(String name)
  +    {
  +        this.fileName = name;
  +    }
   
       /**
        * Get the value of package.
  @@ -328,26 +349,6 @@
           tablesByName.put(tbl.getName(), tbl);
           tablesByJavaName.put(tbl.getJavaName(), tbl);
           tbl.setPackage(getPackage());
  -    }
  -
  -    /**
  -     * Set the parent of the database
  -     *
  -     * @param parent the parent
  -     */
  -    public void setAppData(AppData parent)
  -    {
  -        dbParent = parent;
  -    }
  -
  -    /**
  -     * Get the parent of the table
  -     *
  -     * @return the parent
  -     */
  -    public AppData getAppData()
  -    {
  -        return dbParent;
       }
   
       protected String getDatabaseType()
  
  
  
  1.3       +2 -4      db-torque/src/generator/src/test/org/apache/torque/engine/database/model/NameFactoryTest.java
  
  Index: NameFactoryTest.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/test/org/apache/torque/engine/database/model/NameFactoryTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NameFactoryTest.java	27 Sep 2003 11:13:48 -0000	1.2
  +++ NameFactoryTest.java	5 Oct 2003 14:14:03 -0000	1.3
  @@ -160,10 +160,8 @@
       /** Sets up the Torque model. */
       public void setUp()
       {
  -        AppData appData = new AppData(DATABASE_TYPE);
  -        database = new Database();
  +        database = new Database(DATABASE_TYPE);
           database.setDatabaseType(DATABASE_TYPE);
  -        appData.addDatabase(database);
       }
   
       /**
  
  
  
  1.6       +3 -11     db-torque/src/generator/src/test/org/apache/torque/engine/database/model/TableTest.java
  
  Index: TableTest.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/test/org/apache/torque/engine/database/model/TableTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TableTest.java	5 Oct 2003 13:50:34 -0000	1.5
  +++ TableTest.java	5 Oct 2003 14:14:03 -0000	1.6
  @@ -69,7 +69,7 @@
   public class TableTest extends TestCase
   {
       private XmlToAppData xmlToAppData = null;
  -    private AppData appData = null;
  +    private Database db = null;
   
       public TableTest(String name)
       {
  @@ -80,7 +80,7 @@
       {
           super.setUp();
           xmlToAppData = new XmlToAppData("mysql", "defaultpackage");
  -        appData = xmlToAppData.parseFile(
  +        db = xmlToAppData.parseFile(
               "src/test/org/apache/torque/engine/database/model/tabletest-schema.xml");
       }
   
  @@ -95,7 +95,6 @@
        */
       public void testIdMethodHandling() throws Exception
       {
  -        Database db = appData.getDatabase("iddb");
           assertEquals(IDMethod.ID_BROKER, db.getDefaultIdMethod());
           Table table = db.getTable("table_idbroker");
           assertEquals(IDMethod.ID_BROKER, table.getIdMethod());
  @@ -105,7 +104,6 @@
       
       public void testNoPk() throws Exception
       {
  -        Database db = appData.getDatabase("iddb");
           Table table = db.getTable("nopk");
           assertFalse(table.hasPrimaryKey());
           List pks = table.getPrimaryKey();
  @@ -114,7 +112,6 @@
       
       public void testSinglePk() throws Exception
       {
  -        Database db = appData.getDatabase("iddb");
           Table table = db.getTable("singlepk");
           assertTrue(table.hasPrimaryKey());
           List pks = table.getPrimaryKey();
  @@ -125,7 +122,6 @@
       
       public void testMultiPk() throws Exception
       {
  -        Database db = appData.getDatabase("iddb");
           Table table = db.getTable("multipk");
           assertTrue(table.hasPrimaryKey());
           List pks = table.getPrimaryKey();
  @@ -139,7 +135,6 @@
    
       public void testSingleFk() throws Exception
       {
  -        Database db = appData.getDatabase("iddb");
           Table table = db.getTable("singlefk");
           ForeignKey[] fks = table.getForeignKeys();
           assertTrue(fks.length == 1);
  @@ -150,7 +145,6 @@
   
       public void testMultiFk() throws Exception
       {
  -        Database db = appData.getDatabase("iddb");
           Table table = db.getTable("multifk");
           ForeignKey[] fks = table.getForeignKeys();
           assertTrue(fks.length == 1);
  @@ -161,7 +155,6 @@
       
       public void testReferrers() throws Exception
       {
  -        Database db = appData.getDatabase("iddb");
           Table table = db.getTable("singlepk");
           List refs = table.getReferrers();
           assertTrue(refs.size() == 1);
  @@ -171,7 +164,6 @@
       
       public void testUnique() throws Exception
       {
  -        Database db = appData.getDatabase("iddb");
           Table table = db.getTable("unique_test");
           Unique[] unices = table.getUnices();
           assertTrue(unices.length == 1);
  
  
  
  1.5       +1 -3      db-torque/src/generator/src/templates/om/Control.vm
  
  Index: Control.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/om/Control.vm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Control.vm	7 Aug 2003 13:13:00 -0000	1.4
  +++ Control.vm	5 Oct 2003 14:14:03 -0000	1.5
  @@ -5,8 +5,7 @@
   dbprops.idMethod = $dbprops.get("idMethod")
   #include ( "sql/base/$targetDatabase/db.props" )
   
  -#foreach ($dataModel in $dataModels)
  -  #foreach ($database in $dataModel.Databases)
  +#foreach ($database in $dataModels)
   
       #if ($database.Package)
         #set ($package = $database.Package)
  @@ -107,5 +106,4 @@
           #end
         #end
       #end
  -  #end
   #end
  
  
  
  1.2       +1 -1      db-torque/src/generator/src/templates/doc/html/datamodel.vm
  
  Index: datamodel.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/doc/html/datamodel.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- datamodel.vm	10 Feb 2003 13:18:50 -0000	1.1
  +++ datamodel.vm	5 Oct 2003 14:14:03 -0000	1.2
  @@ -1,4 +1,4 @@
  -#set ( $database = $dataModel.database )
  +#set ( $database = $dataModel )
   <html>
   <header>
     <title>$dataModel.name</title>
  
  
  
  1.10      +22 -12    db-torque/src/generator/src/java/org/apache/torque/engine/database/transform/XmlToAppData.java
  
  Index: XmlToAppData.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/database/transform/XmlToAppData.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XmlToAppData.java	27 Sep 2003 11:13:49 -0000	1.9
  +++ XmlToAppData.java	5 Oct 2003 14:14:03 -0000	1.10
  @@ -67,7 +67,6 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.apache.torque.engine.EngineException;
  -import org.apache.torque.engine.database.model.AppData;
   import org.apache.torque.engine.database.model.Column;
   import org.apache.torque.engine.database.model.Database;
   import org.apache.torque.engine.database.model.ForeignKey;
  @@ -94,8 +93,7 @@
       /** Logging class from commons.logging */
       private static Log log = LogFactory.getLog(XmlToAppData.class);
   
  -    private AppData app;
  -    private Database currDB;
  +    private Database database;
       private Table currTable;
       private Column currColumn;
       private ForeignKey currFK;
  @@ -126,11 +124,22 @@
        * Creates a new instance for the specified database type.
        *
        * @param databaseType The type of database for the application.
  +     */
  +    public XmlToAppData(String databaseType)
  +    {
  +        database = new Database(databaseType);
  +        firstPass = true;
  +    }
  +
  +    /**
  +     * Creates a new instance for the specified database type.
  +     *
  +     * @param databaseType The type of database for the application.
        * @param defaultPackage the default java package used for the om
        */
       public XmlToAppData(String databaseType, String defaultPackage)
       {
  -        app = new AppData(databaseType);
  +        database = new Database(databaseType);
           this.defaultPackage = defaultPackage;
           firstPass = true;
       }
  @@ -142,7 +151,7 @@
        * @param xmlFile The input file to parse.
        * @return AppData populated by <code>xmlFile</code>.
        */
  -    public AppData parseFile(String xmlFile)
  +    public Database parseFile(String xmlFile)
               throws EngineException
       {
           try
  @@ -156,7 +165,7 @@
               if ((alreadyReadFiles != null)
                       && alreadyReadFiles.contains(xmlFile))
               {
  -                return app;
  +                return database;
               }
               else if (alreadyReadFiles == null)
               {
  @@ -201,7 +210,8 @@
           {
               firstPass = false;
           }
  -        return app;
  +        database.doFinalInitialization();
  +        return database;
       }
       
       /**
  @@ -253,10 +263,10 @@
                   }
                   else
                   {
  -                    currDB = app.addDatabase(attributes);
  -                    if (currDB.getPackage() == null)
  +                    database.loadFromXML(attributes);
  +                    if (database.getPackage() == null)
                       {
  -                        currDB.setPackage(defaultPackage);
  +                        database.setPackage(defaultPackage);
                       }
                   }
               }
  @@ -280,7 +290,7 @@
               }
               else if (rawName.equals("table"))
               {
  -                currTable = currDB.addTable(attributes);
  +                currTable = database.addTable(attributes);
                   if (isExternalSchema)
                   {
                       currTable.setForReferenceOnly(true);
  
  
  
  1.4       +4 -21     db-torque/src/generator/src/java/org/apache/torque/engine/database/transform/SQLToAppData.java
  
  Index: SQLToAppData.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/database/transform/SQLToAppData.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SQLToAppData.java	27 Sep 2003 11:13:49 -0000	1.3
  +++ SQLToAppData.java	5 Oct 2003 14:14:03 -0000	1.4
  @@ -59,7 +59,6 @@
   import java.io.IOException;
   import java.util.ArrayList;
   import java.util.List;
  -import org.apache.torque.engine.database.model.AppData;
   import org.apache.torque.engine.database.model.Column;
   import org.apache.torque.engine.database.model.Database;
   import org.apache.torque.engine.database.model.ForeignKey;
  @@ -84,7 +83,6 @@
       private String sqlFile;
       private List tokens;
       private Token token;
  -    private AppData appData;
       private Database appDataDB;
       private int count;
       private String databaseType;
  @@ -566,12 +564,10 @@
        * @throws IOException If an I/O error occurs
        * @throws ParseException error parsing the input file
        */
  -    public AppData execute() throws IOException, ParseException
  +    public Database execute() throws IOException, ParseException
       {
           count = 0;
  -        appData = new AppData(databaseType);
  -        appDataDB = new Database();
  -        appData.addDatabase(appDataDB);
  +        appDataDB = new Database(databaseType);
   
           FileReader fr = new FileReader(sqlFile);
           BufferedReader br = new BufferedReader(fr);
  @@ -597,19 +593,6 @@
                   next();
               }
           }
  -        return appData;
  -    }
  -
  -    /**
  -     * Just 4 testing.
  -     *
  -     * @param args commandline args
  -     * @throws Exception an exception
  -     */
  -    public static void main(String args[]) throws Exception
  -    {
  -        SQLToAppData s2a = new SQLToAppData(args[0]);
  -        AppData ad = s2a.execute();
  -        System.out.println(ad);
  +        return appDataDB;
       }
   }
  
  
  
  1.4       +4 -3      db-torque/src/generator/src/java/org/apache/torque/task/TorqueSQLTask.java
  
  Index: TorqueSQLTask.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/task/TorqueSQLTask.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TorqueSQLTask.java	27 Sep 2003 11:13:49 -0000	1.3
  +++ TorqueSQLTask.java	5 Oct 2003 14:14:03 -0000	1.4
  @@ -61,13 +61,14 @@
   import java.util.Iterator;
   import java.util.Properties;
   
  +import org.apache.commons.lang.StringUtils;
   import org.apache.tools.ant.BuildException;
   
   import org.apache.velocity.context.Context;
   
   import org.apache.torque.engine.EngineException;
   import org.apache.torque.engine.database.transform.XmlToAppData;
  -import org.apache.torque.engine.database.model.AppData;
  +import org.apache.torque.engine.database.model.Database;
   
   
   /**
  @@ -208,7 +209,7 @@
           // Transform the XML database schema into
           // data model object.
           XmlToAppData xmlParser = new XmlToAppData(getTargetDatabase(), null);
  -        AppData ad = xmlParser.parseFile(getIdTableXMLFile());
  +        Database ad = xmlParser.parseFile(getIdTableXMLFile());
   
           ad.setName("idmodel");
           context.put("idmodel", ad);
  
  
  
  1.6       +3 -5      db-torque/src/generator/src/java/org/apache/torque/task/TorqueDataSQLTask.java
  
  Index: TorqueDataSQLTask.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/task/TorqueDataSQLTask.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TorqueDataSQLTask.java	28 Jul 2003 09:11:36 -0000	1.5
  +++ TorqueDataSQLTask.java	5 Oct 2003 14:14:03 -0000	1.6
  @@ -72,7 +72,6 @@
   import org.xml.sax.SAXException;
   
   import org.apache.torque.engine.EngineException;
  -import org.apache.torque.engine.database.model.AppData;
   import org.apache.torque.engine.database.model.Database;
   import org.apache.torque.engine.database.transform.XmlToData;
   
  @@ -177,8 +176,7 @@
   
           try
           {
  -            AppData app = (AppData) getDataModels().get(0);
  -            Database db = app.getDatabase();
  +            Database db = (Database) getDataModels().get(0);
               
               List data;
               
  @@ -217,7 +215,7 @@
               context.put("data", data);
   
               // Place our model in the context.
  -            context.put("appData", app);
  +            context.put("appData", db);
   
               // Place the target database in the context.
               context.put("targetDatabase", targetDatabase);
  
  
  
  1.4       +6 -8      db-torque/src/generator/src/java/org/apache/torque/task/TorqueDataModelTask.java
  
  Index: TorqueDataModelTask.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/task/TorqueDataModelTask.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TorqueDataModelTask.java	27 Sep 2003 11:13:49 -0000	1.3
  +++ TorqueDataModelTask.java	5 Oct 2003 14:14:03 -0000	1.4
  @@ -68,7 +68,6 @@
   import org.apache.tools.ant.types.FileSet;
   
   import org.apache.torque.engine.EngineException;
  -import org.apache.torque.engine.database.model.AppData;
   import org.apache.torque.engine.database.model.Database;
   import org.apache.torque.engine.database.transform.XmlToAppData;
   
  @@ -316,8 +315,8 @@
                   // data model object.
                   xmlParser = new XmlToAppData(getTargetDatabase(),
                           getTargetPackage());
  -                AppData ad = xmlParser.parseFile(xmlFile);
  -                ad.setName(grokName(xmlFile));
  +                Database ad = xmlParser.parseFile(xmlFile);
  +                ad.setFileName(grokName(xmlFile));
                   dataModels.add(ad);
               }
               else
  @@ -337,8 +336,8 @@
                           File f = new File(srcDir, dataModelFiles[j]);
                           xmlParser = new XmlToAppData(getTargetDatabase(),
                                   getTargetPackage());
  -                        AppData ad = xmlParser.parseFile(f.toString());
  -                        ad.setName(grokName(f.toString()));
  +                        Database ad = xmlParser.parseFile(f.toString());
  +                        ad.setFileName(grokName(f.toString()));
                           dataModels.add(ad);
                       }
                   }
  @@ -352,10 +351,9 @@
               // names, we just want the unique names of databases.
               while (i.hasNext())
               {
  -                AppData ad = (AppData) i.next();
  -                Database database = ad.getDatabase();
  +                Database database = (Database) i.next();
                   databaseNames.put(database.getName(), database.getName());
  -                dataModelDbMap.put(ad.getName(), database.getName());
  +                dataModelDbMap.put(database.getFileName(), database.getName());
               }
           }
           catch (EngineException ee)
  
  
  
  1.4       +3 -3      db-torque/src/generator/src/java/org/apache/torque/task/TorqueSQLTransformTask.java
  
  Index: TorqueSQLTransformTask.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/task/TorqueSQLTransformTask.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TorqueSQLTransformTask.java	5 Aug 2003 16:53:01 -0000	1.3
  +++ TorqueSQLTransformTask.java	5 Oct 2003 14:14:03 -0000	1.4
  @@ -61,7 +61,7 @@
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.Task;
   
  -import org.apache.torque.engine.database.model.AppData;
  +import org.apache.torque.engine.database.model.Database;
   import org.apache.torque.engine.database.transform.SQLToAppData;
   
   /**
  @@ -134,7 +134,7 @@
               log("Parsing SQL Schema", Project.MSG_INFO);
   
               SQLToAppData sqlParser = new SQLToAppData(inputFile);
  -            AppData app = sqlParser.execute();
  +            Database app = sqlParser.execute();
   
               log("Preparing to write xml schema", Project.MSG_INFO);
               FileWriter fr = new FileWriter(outputFile);
  
  
  
  1.5       +8 -11     db-torque/src/generator/src/test/org/apache/torque/engine/database/TestPackageHandling.java
  
  Index: TestPackageHandling.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/test/org/apache/torque/engine/database/TestPackageHandling.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestPackageHandling.java	27 Sep 2003 11:13:48 -0000	1.4
  +++ TestPackageHandling.java	5 Oct 2003 14:14:03 -0000	1.5
  @@ -56,7 +56,6 @@
   
   import junit.framework.TestCase;
   
  -import org.apache.torque.engine.database.model.AppData;
   import org.apache.torque.engine.database.model.Database;
   import org.apache.torque.engine.database.model.Table;
   import org.apache.torque.engine.database.transform.XmlToAppData;
  @@ -70,7 +69,7 @@
   public class TestPackageHandling extends TestCase
   {
       private XmlToAppData xmlToAppData = null;
  -    private AppData appData = null;
  +    private Database database = null;
   
       public TestPackageHandling(String name)
       {
  @@ -95,11 +94,10 @@
               throws Exception
       {
           xmlToAppData = new XmlToAppData("mysql", "defaultpackage");
  -        appData = xmlToAppData.parseFile(
  +        database = xmlToAppData.parseFile(
               "src/test/org/apache/torque/engine/database/package-schema.xml");
  -        Database db = appData.getDatabase("packagedb");
  -        assertEquals("defaultpackage", db.getPackage());
  -        Table table = db.getTable("table_a");
  +        assertEquals("defaultpackage", database.getPackage());
  +        Table table = database.getTable("table_a");
           assertEquals("defaultpackage", table.getPackage());
       }
   
  @@ -110,11 +108,10 @@
               throws Exception
       {
           xmlToAppData = new XmlToAppData("mysql", "defaultpackage");
  -        appData = xmlToAppData.parseFile(
  +        database = xmlToAppData.parseFile(
               "src/test/org/apache/torque/engine/database/package2-schema.xml");
  -        Database db = appData.getDatabase("packagedb2");
  -        assertEquals("packagefromdb", db.getPackage());
  -        Table table = db.getTable("table_a");
  +        assertEquals("packagefromdb", database.getPackage());
  +        Table table = database.getTable("table_a");
           assertEquals("packagefromdb", table.getPackage());
       }
   
  
  
  
  1.2       +1 -1      db-torque/src/generator/src/templates/doc/anakia/datamodel.vm
  
  Index: datamodel.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/doc/anakia/datamodel.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- datamodel.vm	10 Feb 2003 13:18:50 -0000	1.1
  +++ datamodel.vm	5 Oct 2003 14:14:03 -0000	1.2
  @@ -1,4 +1,4 @@
  -#set ( $database = $dataModel.database )
  +#set ( $database = $dataModel )
   <?xml version="1.0"?>
   
   <document>
  
  
  
  1.2       +2 -2      db-torque/src/generator/src/templates/sql/id-table/Control.vm
  
  Index: Control.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/id-table/Control.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Control.vm	10 Feb 2003 13:18:46 -0000	1.1
  +++ Control.vm	5 Oct 2003 14:14:03 -0000	1.2
  @@ -1,6 +1,6 @@
   #set ( $fname = "sql/id-table/idtable.$targetDatabase" )
   #foreach ($dataModel in $dataModels)
  -#set ( $outFile = "${dataModel.name}-idtable-init.sql" )
  -$generator.parse($fname,"$outFile","tables",$dataModel.database.tables)
  +#set ( $outFile = "${dataModel.FileName}-idtable-init.sql" )
  +$generator.parse($fname,"$outFile","tables",$dataModel.tables)
   #set ( $initialID = $initialID + 1000 )
   #end
  
  
  
  1.2       +1 -3      db-torque/src/generator/src/templates/data/Control.vm
  
  Index: Control.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/data/Control.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Control.vm	10 Feb 2003 13:18:50 -0000	1.1
  +++ Control.vm	5 Oct 2003 14:14:04 -0000	1.2
  @@ -1,8 +1,7 @@
   #set ( $hfname= "data/dataset.vm" )
   #set ( $fname= "data/table.vm" )
   
  -#foreach ($dataModel in $dataModels)
  -#foreach ($database in $dataModel.Databases)
  +#foreach ($database in $dataModels)
       #if ($project)
           #if ($dataModel.MultipleDatabases)
               #set ( $outFile = "${project}-${database.Name}-data.dtd" )
  @@ -18,5 +17,4 @@
               $generator.parse($fname,"","table",$tbl)
           #end
       #end
  -#end
   #end
  
  
  
  1.2       +2 -2      db-torque/src/generator/src/templates/doc/Control.vm
  
  Index: Control.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/doc/Control.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Control.vm	10 Feb 2003 13:18:51 -0000	1.1
  +++ Control.vm	5 Oct 2003 14:14:04 -0000	1.2
  @@ -3,9 +3,9 @@
   #foreach ($dataModel in $dataModels)
   
     #if ($outputFormat=="html")
  -    #set ( $outFile = "${dataModel.name}.html" )
  +    #set ( $outFile = "${dataModel.FileName}.html" )
     #else
  -    #set ( $outFile = "${dataModel.name}.xml" )
  +    #set ( $outFile = "${dataModel.FileName}.xml" )
     #end
   
     File to be created: $outFile
  
  
  
  1.2       +3 -4      db-torque/src/generator/src/templates/sql/base/Control.vm
  
  Index: Control.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/Control.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Control.vm	10 Feb 2003 13:18:51 -0000	1.1
  +++ Control.vm	5 Oct 2003 14:14:04 -0000	1.2
  @@ -4,13 +4,12 @@
   #set ( $fnamekeys= "sql/base/$targetDatabase/tablefk.vm" )
   #set ( $idname = "sql/id-table/idtable.$targetDatabase" )
   
  -#foreach ($dataModel in $dataModels)
  +#foreach ($database in $dataModels)
           
  -  #set ( $outFile = "${dataModel.name}.sql" )
  +  #set ( $outFile = "${database.FileName}.sql" )
   
     File to be created: $outFile
     
  -  #set ( $database = $dataModel.database )
     #foreach ($tbl in $database.tables)
       Primary Key:#if ($tbl.hasPrimaryKey()) Yes #else No #end
       #if (!$tbl.isSkipSql())
  @@ -28,7 +27,7 @@
   
       Creating id-table
   
  -    #set ($tbl = $idmodel.database.getTable("ID_TABLE"))
  +    #set ($tbl = $idmodel.getTable("ID_TABLE"))
       $generator.parse($fname,$outFile,"table",$tbl)
    
       ## Generate inserts into ID-TABLE for initial ids.
  
  
  
  1.3       +1 -3      db-torque/src/generator/src/templates/data/dump/Control.vm
  
  Index: Control.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/data/dump/Control.vm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Control.vm	3 Aug 2003 13:42:40 -0000	1.2
  +++ Control.vm	5 Oct 2003 14:14:04 -0000	1.3
  @@ -3,8 +3,7 @@
   #set ( $bfname= "data/dump/bottom.vm" )
   #set ($q = '"')
   
  -#foreach ($dataModel in $dataModels)
  -#foreach ($database in $dataModel.Databases)
  +#foreach ($database in $dataModels)
   
   #if ($project)
       #if ($database.Name)
  @@ -33,5 +32,4 @@
   #end
   $generator.parse($bfname,$outFile,"tables",$database.Tables)
   
  -#end
   #end
  
  
  

---------------------------------------------------------------------
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