db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From florianbruck...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/tools/mapping/reversedb DBSchema.java
Date Sat, 21 Jun 2003 10:34:02 GMT
florianbruckner    2003/06/21 03:34:01

  Modified:    src/java/org/apache/ojb/tools/mapping/reversedb
                        DBSchema.java
  Log:
  implement XML generation with PrintWriter; getXML() still works and uses writeXML(java.io.PrintWriter)
  
  Revision  Changes    Path
  1.7       +18 -9     db-ojb/src/java/org/apache/ojb/tools/mapping/reversedb/DBSchema.java
  
  Index: DBSchema.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/tools/mapping/reversedb/DBSchema.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DBSchema.java	7 Jun 2003 10:10:04 -0000	1.6
  +++ DBSchema.java	21 Jun 2003 10:34:01 -0000	1.7
  @@ -122,7 +122,7 @@
         String strTableName = rs.getString("TABLE_NAME");
         String strTableType = rs.getString("TABLE_TYPE");
         // Pointbase returns the catalog name in uppercase here and in mixed
  -      // case in getCatalogs(). Therefore we have to user toUpper().
  +      // case in getCatalogs(). Therefore we have to use toUpper().
         if (   
                (strTableCat == null && this.getDBCatalog().getCatalogName() == null
|| strTableCat.equals(this.getDBCatalog().getCatalogName().toUpperCase()))
              &&(strSchemaName == null && this.getSchemaName() == null ||
strSchemaName.equals(this.getSchemaName()))
  @@ -243,13 +243,18 @@
     
     public String getXML()
     {
  -    String strReturn = "";
  -    Iterator i = this.tmTables.values().iterator();
  -    while (i.hasNext())
  -    {
  -      strReturn += ((DBTable)i.next()).getXML() + System.getProperty("line.separator");
  -    }
  -    return strReturn;
  +      java.io.StringWriter swr = new java.io.StringWriter();
  +      writeXML(new java.io.PrintWriter(swr));
  +      return swr.getBuffer().toString();
  +  }
  +
  +  public void writeXML(java.io.PrintWriter pw) 
  +  {
  +      Iterator i = this.tmTables.values().iterator();
  +      while (i.hasNext())
  +      {
  +        ((DBTable)i.next()).writeXML(pw);
  +      }      
     }
     
     public void generateJava (java.io.File aFile, String strHeader, String strFooter) throws
java.io.IOException, java.io.FileNotFoundException
  @@ -270,10 +275,14 @@
       while (it.hasNext()) ((DBTable)it.next()).disableClassesWithRegex(aRegexp);       

     }
       
  +  
   }
   
   /***************************** Changelog *****************************
   // $Log$
  +// Revision 1.7  2003/06/21 10:34:01  florianbruckner
  +// implement XML generation with PrintWriter; getXML() still works and uses writeXML(java.io.PrintWriter)
  +//
   // Revision 1.6  2003/06/07 10:10:04  brj
   // some style fixes
   //
  
  
  

Mime
View raw message