cvillegas    2005/02/06 02:41:33

  Modified:    src/stores/org/apache/slide/store/ojb/tools
                        DDLGeneratorTask.java
  Log:
  Substitute length (n) when found on type specifier. Needed to handle DB2.
  Pass dquot and quot to velocity context for convenience.
  
  Revision  Changes    Path
  1.2       +7 -3      
jakarta-slide/src/stores/org/apache/slide/store/ojb/tools/DDLGeneratorTask.java
  
  Index: DDLGeneratorTask.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/stores/org/apache/slide/store/ojb/tools/DDLGeneratorTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DDLGeneratorTask.java     23 Jan 2005 14:13:48 -0000      1.1
  +++ DDLGeneratorTask.java     6 Feb 2005 10:41:33 -0000       1.2
  @@ -177,6 +177,8 @@
                       } catch (Exception e) {
                       }
                       col.type = 
props.getProperty(elemCol.getAttributeValue("type"));
  +                    int varlen = col.size > 0 ? col.size : 250;
  +                    col.type = StringUtils.replace(col.type, "(n)", "(" + 
varlen + ")");
                       col.isNotNull = 
Boolean.valueOf(elemCol.getAttributeValue("required"));
                       table.columns.add(col);
                   }
  @@ -210,6 +212,8 @@
               }
               VelocityContext context = new VelocityContext();
               context.put("eol", System.getProperty("line.separator"));
  +            context.put("dquot", "\"");
  +            context.put("quot", "'");
               context.put("strings", new Strings());
               context.put("tables", tables);
               context.put("props", props);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to