Author: tfischer
Date: Sat Aug 5 04:46:23 2006
New Revision: 428988
URL: http://svn.apache.org/viewvc?rev=428988&view=rev
Log:
It was not possible until now to find out the Torque Type (aka schema type) of
a column during the runtime.
This is now possible.
Improves upon TORQUE-22.
Modified:
db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java
db/torque/templates/trunk/src/templates/om/MapBuilder.vm
Modified: db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java
URL:
http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java?rev=428988&r1=428987&r2=428988&view=diff
==============================================================================
--- db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java
(original)
+++ db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java Sat
Aug 5 04:46:23 2006
@@ -38,9 +38,12 @@
/** The serialVersionUID for this class. */
private static final long serialVersionUID = -5971184507395399165L;
- /** Type of the column. */
+ /** A sample object having the same java Type as the column. */
private Object type = null;
+ /** The name of the Torque Type of the column. */
+ private String torqueType = null;
+
/** Should object type be converted to primitive. */
private boolean usePrimitive = true;
@@ -184,6 +187,16 @@
}
/**
+ * Set the Torque type of this column.
+ *
+ * @param torqueType the Torque type of the column.
+ */
+ public void setTorqueType(String torqueType)
+ {
+ this.torqueType = torqueType;
+ }
+
+ /**
* Set the size of this column.
*
* @param size An int specifying the size.
@@ -265,6 +278,16 @@
public Object getType()
{
return type;
+ }
+
+ /**
+ * Get the name of the Torque type of this column.
+ *
+ * @return The name of the Torque type of this column.
+ */
+ public String getTorqueType()
+ {
+ return torqueType;
}
/**
Modified: db/torque/templates/trunk/src/templates/om/MapBuilder.vm
URL:
http://svn.apache.org/viewvc/db/torque/templates/trunk/src/templates/om/MapBuilder.vm?rev=428988&r1=428987&r2=428988&view=diff
==============================================================================
--- db/torque/templates/trunk/src/templates/om/MapBuilder.vm (original)
+++ db/torque/templates/trunk/src/templates/om/MapBuilder.vm Sat Aug 5
04:46:23 2006
@@ -136,6 +136,7 @@
// ------------- Column: $cup --------------------
cMap = new ColumnMap( "$cnm", tMap);
cMap.setType( $col.JavaObject );
+ cMap.setTorqueType( "$col.Domain.Type.Name" );
cMap.setUsePrimitive($col.UsePrimitive);
cMap.setPrimaryKey($col.isPrimaryKey());
cMap.setNotNull($col.isNotNull());
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]