henning 2003/07/28 04:47:21
Modified: src/generator/src/java/org/apache/torque/engine/database/model
Column.java
Log:
Let our model know, which columns need ticks around its value. In an
ideal world, we would be able to ask the database adapter, but Torque
isn't that good. Use the same heuristics as in the data load templates.
Revision Changes Path
1.4 +16 -1
db-torque/src/generator/src/java/org/apache/torque/engine/database/model/Column.java
Index: Column.java
===================================================================
RCS file:
/home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/database/model/Column.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Column.java 26 Jun 2003 17:40:05 -0000 1.3
+++ Column.java 28 Jul 2003 11:47:21 -0000 1.4
@@ -587,6 +587,21 @@
}
/**
+ * Utility method to return the value as an element to be usable
+ * in an SQL insert statement. This is used from the SQL loader task
+ */
+ public boolean needEscapedValue()
+ {
+ return (torqueType != null) &&
+ ( torqueType.equals("VARCHAR")
+ || torqueType.equals("LONGVARCHAR")
+ || torqueType.equals("DATE")
+ || torqueType.equals("DATETIME")
+ || torqueType.equals("TIMESTAMP")
+ || torqueType.equals("CHAR"));
+ }
+
+ /**
* String representation of the column. This is an xml representation.
*
* @return string representation in xml
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]