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/java/org/apache/torque/engine/database/transform XmlToAppData.java
Date Fri, 18 Jul 2003 20:24:38 GMT
mpoeschl    2003/07/18 13:24:38

  Modified:    src/generator/src/java/org/apache/torque/engine/database/transform
                        XmlToAppData.java
  Log:
  fix indentation
  
  Revision  Changes    Path
  1.3       +71 -71    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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XmlToAppData.java	26 Jun 2003 06:59:56 -0000	1.2
  +++ XmlToAppData.java	18 Jul 2003 20:24:38 -0000	1.3
  @@ -241,88 +241,88 @@
       {
           try
           {
  -                if (rawName.equals("database"))
  +            if (rawName.equals("database"))
  +            {
  +                if (isExternalSchema)
                   {
  -                    if (isExternalSchema)
  +                    currentPackage = attributes.getValue("package");
  +                    if (currentPackage == null)
                       {
  -                        currentPackage = attributes.getValue("package");
  -                        if (currentPackage == null)
  -                        {
  -                            currentPackage = defaultPackage;
  -                        }
  +                        currentPackage = defaultPackage;
                       }
  -                    else
  -                    {
  -                        currDB = app.addDatabase(attributes);
  -                        if (currDB.getPackage() == null)
  -                        {
  -                            currDB.setPackage(defaultPackage);
  -                        }
  -                    }
  -                }
  -                else if (rawName.equals("external-schema"))
  -                {
  -                    String xmlFile = attributes.getValue("filename");
  -                    if (xmlFile.charAt(0) != '/')
  -                    {
  -                        File f = new File(currentXmlFile);
  -                        xmlFile = new File(f.getParent(), xmlFile).getPath();
  -                    }
  -
  -                    // put current state onto the stack
  -                    ParseStackElement.pushState(this);
  -
  -                    isExternalSchema = true;
  -
  -                    parseFile(xmlFile);
  -                    // get the last state from the stack
  -                    ParseStackElement.popState(this);
                   }
  -                else if (rawName.equals("table"))
  +                else
                   {
  -                    currTable = currDB.addTable(attributes);
  -                    if (isExternalSchema)
  +                    currDB = app.addDatabase(attributes);
  +                    if (currDB.getPackage() == null)
                       {
  -                        currTable.setForReferenceOnly(true);
  -                        currTable.setPackage(currentPackage);
  +                        currDB.setPackage(defaultPackage);
                       }
                   }
  -                else if (rawName.equals("column"))
  -                {
  -                    currColumn = currTable.addColumn(attributes);
  -                }
  -                else if (rawName.equals("inheritance"))
  -                {
  -                    currColumn.addInheritance(attributes);
  -                }
  -                else if (rawName.equals("foreign-key"))
  -                {
  -                    currFK = currTable.addForeignKey(attributes);
  -                }
  -                else if (rawName.equals("reference"))
  -                {
  -                    currFK.addReference(attributes);
  -                }
  -                else if (rawName.equals("index"))
  -                {
  -                    currIndex = currTable.addIndex(attributes);
  -                }
  -                else if (rawName.equals("index-column"))
  -                {
  -                    currIndex.addColumn(attributes);
  -                }
  -                else if (rawName.equals("unique"))
  +            }
  +            else if (rawName.equals("external-schema"))
  +            {
  +                String xmlFile = attributes.getValue("filename");
  +                if (xmlFile.charAt(0) != '/')
                   {
  -                    currUnique = currTable.addUnique(attributes);
  -                }
  -                else if (rawName.equals("unique-column"))
  -                {
  -                    currUnique.addColumn(attributes);
  -                }
  -                else if (rawName.equals("id-method-parameter"))
  -                {
  -                    currTable.addIdMethodParameter(attributes);
  +                    File f = new File(currentXmlFile);
  +                    xmlFile = new File(f.getParent(), xmlFile).getPath();
                   }
  +
  +                // put current state onto the stack
  +                ParseStackElement.pushState(this);
  +
  +                isExternalSchema = true;
  +
  +                parseFile(xmlFile);
  +                // get the last state from the stack
  +                ParseStackElement.popState(this);
  +            }
  +            else if (rawName.equals("table"))
  +            {
  +                currTable = currDB.addTable(attributes);
  +                if (isExternalSchema)
  +                {
  +                    currTable.setForReferenceOnly(true);
  +                    currTable.setPackage(currentPackage);
  +                }
  +            }
  +            else if (rawName.equals("column"))
  +            {
  +                currColumn = currTable.addColumn(attributes);
  +            }
  +            else if (rawName.equals("inheritance"))
  +            {
  +                currColumn.addInheritance(attributes);
  +            }
  +            else if (rawName.equals("foreign-key"))
  +            {
  +                currFK = currTable.addForeignKey(attributes);
  +            }
  +            else if (rawName.equals("reference"))
  +            {
  +                currFK.addReference(attributes);
  +            }
  +            else if (rawName.equals("index"))
  +            {
  +                currIndex = currTable.addIndex(attributes);
  +            }
  +            else if (rawName.equals("index-column"))
  +            {
  +                currIndex.addColumn(attributes);
  +            }
  +            else if (rawName.equals("unique"))
  +            {
  +                currUnique = currTable.addUnique(attributes);
  +            }
  +            else if (rawName.equals("unique-column"))
  +            {
  +                currUnique.addColumn(attributes);
  +            }
  +            else if (rawName.equals("id-method-parameter"))
  +            {
  +                currTable.addIdMethodParameter(attributes);
  +            }
           }
           catch (Exception e)
           {
  
  
  

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