henning 2003/10/21 05:52:39
Modified: proposals/henning/column-javaname Tag: TORQUE_3_1_BRANCH
column-javaname.patch
proposals/henning/idtable-peer Tag: TORQUE_3_1_BRANCH
idtable-peer.patch
Log:
Reworked the column-javaname proposal to be less intrusive (Turbine didn't
work any longer with the agressive signature change).
Cleaned up the idtable-peer proposal to patch against the source code
Revision Changes Path
No revision
No revision
1.1.2.3 +485 -162
db-torque/proposals/henning/column-javaname/column-javaname.patch
Index: column-javaname.patch
===================================================================
RCS file:
/home/cvs/db-torque/proposals/henning/column-javaname/column-javaname.patch,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- column-javaname.patch 17 Oct 2003 12:18:40 -0000 1.1.2.2
+++ column-javaname.patch 21 Oct 2003 12:52:38 -0000 1.1.2.3
@@ -1,58 +1,310 @@
-diff -u -b -r1.3 MapBuilder.vm
---- db-torque/src/generator/src/templates/om/MapBuilder.vm 7 Aug 2003 13:13:00
-0000 1.3
-+++ db-torque/src/generator/src/templates/om/MapBuilder.vm 17 Oct 2003 12:03:34
-0000
-@@ -122,18 +122,18 @@
+diff --exclude=CVS -Nurb
db-torque_BRANCH31.vanilla/proposals/henning/column-javaname/column-javaname.patch
db-torque_BRANCH31.work/proposals/henning/column-javaname/column-javaname.patch
+---
db-torque_BRANCH31.vanilla/proposals/henning/column-javaname/column-javaname.patch
2003-10-17 14:18:40.000000000 +0200
++++ db-torque_BRANCH31.work/proposals/henning/column-javaname/column-javaname.patch
2003-10-21 14:41:47.000000000 +0200
+@@ -1,271 +0,0 @@
+-diff -u -b -r1.3 MapBuilder.vm
+---- db-torque/src/generator/src/templates/om/MapBuilder.vm 7 Aug 2003 13:13:00
-0000 1.3
+-+++ db-torque/src/generator/src/templates/om/MapBuilder.vm 17 Oct 2003 12:03:34
-0000
+-@@ -122,18 +122,18 @@
+- #if($col.isPrimaryKey())
+- #if($col.isForeignKey())
+- tMap.addForeignPrimaryKey(
+-- "${table.Name}.$cup", $col.JavaObject , "$col.RelatedTableName" ,
+-+ "${table.Name}.$cup", "$cfc", $col.JavaObject ,
"$col.RelatedTableName" ,
+- "$col.RelatedColumnName");
+- #else
+-- tMap.addPrimaryKey("${table.Name}.$cup", $col.JavaObject);
+-+ tMap.addPrimaryKey("${table.Name}.$cup", "$cfc", $col.JavaObject);
+- #end
+- #else
+- #if($col.isForeignKey())
+- tMap.addForeignKey(
+-- "${table.Name}.$cup", $col.JavaObject , "$col.RelatedTableName" ,
+-+ "${table.Name}.$cup", "$cfc", $col.JavaObject ,
"$col.RelatedTableName" ,
+- "$col.RelatedColumnName");
+- #else
+-- tMap.addColumn("${table.Name}.$cup", $col.JavaObject);
+-+ tMap.addColumn("${table.Name}.$cup", "$cfc", $col.JavaObject);
+- #end
+- #end
+- #end
+-Index: db-torque/src/java/org/apache/torque/TorqueInstance.java
+-===================================================================
+-RCS file: /home/cvs/db-torque/src/java/org/apache/torque/TorqueInstance.java,v
+-retrieving revision 1.5
+-diff -u -b -r1.5 TorqueInstance.java
+---- db-torque/src/java/org/apache/torque/TorqueInstance.java 5 Aug 2003
18:09:35 -0000 1.5
+-+++ db-torque/src/java/org/apache/torque/TorqueInstance.java 17 Oct 2003
12:03:34 -0000
+-@@ -706,10 +706,10 @@
+- {
+- map.setIdTable("ID_TABLE");
+- TableMap tMap = map.getIdTable();
+-- tMap.addPrimaryKey("ID_TABLE_ID", new Integer(0));
+-- tMap.addColumn("TABLE_NAME", "");
+-- tMap.addColumn("NEXT_ID", new Integer(0));
+-- tMap.addColumn("QUANTITY", new Integer(0));
+-+ tMap.addPrimaryKey("ID_TABLE_ID", "IdTableId", new Integer(0));
+-+ tMap.addColumn("TABLE_NAME", "TableName", "");
+-+ tMap.addColumn("NEXT_ID", "NextId", new Integer(0));
+-+ tMap.addColumn("QUANTITY", "Quantity", new Integer(0));
+- }
+-
+- /**
+-Index: db-torque/src/java/org/apache/torque/map/ColumnMap.java
+-===================================================================
+-RCS file: /home/cvs/db-torque/src/java/org/apache/torque/map/ColumnMap.java,v
+-retrieving revision 1.7
+-diff -u -b -r1.7 ColumnMap.java
+---- db-torque/src/java/org/apache/torque/map/ColumnMap.java 21 Mar 2003 17:31:08
-0000 1.7
+-+++ db-torque/src/java/org/apache/torque/map/ColumnMap.java 17 Oct 2003 12:03:34
-0000
+-@@ -86,6 +86,9 @@
+- /** The name of the column. */
+- private String columnName;
+-
+-+ /** The java name of the column. */
+-+ private String javaName;
+-+
+-
+- /**
+- * Constructor.
+-@@ -107,6 +110,26 @@
+- public String getColumnName()
+- {
+- return columnName;
+-+ }
+-+
+-+ /**
+-+ * Set the java name of this column.
+-+ *
+-+ * @param javaName The name for this property
+-+ */
+-+ public void setJavaName(String javaName)
+-+ {
+-+ this.javaName = javaName;
+-+ }
+-+
+-+ /**
+-+ * Get the java name of a column.
+-+ *
+-+ * @return A String with the column name.
+-+ */
+-+ public String getJavaName()
+-+ {
+-+ return javaName;
+- }
+-
+- /**
+-Index: db-torque/src/java/org/apache/torque/map/TableMap.java
+-===================================================================
+-RCS file: /home/cvs/db-torque/src/java/org/apache/torque/map/TableMap.java,v
+-retrieving revision 1.13
+-diff -u -b -r1.13 TableMap.java
+---- db-torque/src/java/org/apache/torque/map/TableMap.java 23 Aug 2003 13:18:54
-0000 1.13
+-+++ db-torque/src/java/org/apache/torque/map/TableMap.java 17 Oct 2003 12:03:34
-0000
+-@@ -321,120 +321,143 @@
+- * Add a column to this table of a certain type.
+- *
+- * @param columnName A String with the column name.
+-+ * @param javaName A string with the Java property name
+- * @param type An Object specifying the type.
+- */
+-- public void addColumn(String columnName, Object type)
+-+ public void addColumn(String columnName,
+-+ String javaName,
+-+ Object type)
+- {
+-- addColumn(columnName, type, false, null, null, 0);
+-+ addColumn(columnName, javaName, type, false, null, null, 0);
+- }
+-
+- /**
+- * Add a column to this table of a certain type and size.
+- *
+- * @param columnName A String with the column name.
+-+ * @param javaName A string with the Java property name
+- * @param type An Object specifying the type.
+- * @param size An int specifying the size.
+- */
+-- public void addColumn(String columnName, Object type, int size)
+-+ public void addColumn(String columnName,
+-+ String javaName,
+-+ Object type,
+-+ int size)
+- {
+-- addColumn(columnName, type, false, null, null, size);
+-+ addColumn(columnName, javaName, type, false, null, null, size);
+- }
+-
+- /**
+- * Add a primary key column to this Table.
+- *
+- * @param columnName A String with the column name.
+-+ * @param javaName A string with the Java property name
+- * @param type An Object specifying the type.
+- */
+-- public void addPrimaryKey(String columnName, Object type)
+-+ public void addPrimaryKey(String columnName,
+-+ String javaName,
+-+ Object type)
+- {
+-- addColumn(columnName, type, true, null, null, 0);
+-+ addColumn(columnName, javaName, type, true, null, null, 0);
+- }
+-
+- /**
+- * Add a primary key column to this Table.
+- *
+- * @param columnName A String with the column name.
+-+ * @param javaName A string with the Java property name
+- * @param type An Object specifying the type.
+- * @param size An int specifying the size.
+- */
+-- public void addPrimaryKey(String columnName, Object type, int size)
+-+ public void addPrimaryKey(String columnName,
+-+ String javaName,
+-+ Object type,
+-+ int size)
+- {
+-- addColumn(columnName, type, true, null, null, size);
+-+ addColumn(columnName, javaName, type, true, null, null, size);
+- }
+-
+- /**
+- * Add a foreign key column to the table.
+- *
+- * @param columnName A String with the column name.
+-+ * @param javaName A string with the Java property name
+- * @param type An Object specifying the type.
+- * @param fkTable A String with the foreign key table name.
+- * @param fkColumn A String with the foreign key column name.
+- */
+- public void addForeignKey(String columnName,
+-+ String javaName,
+- Object type,
+- String fkTable,
+- String fkColumn)
+- {
+-- addColumn(columnName, type, false, fkTable, fkColumn, 0);
+-+ addColumn(columnName, javaName, type, false, fkTable, fkColumn, 0);
+- }
+-
+- /**
+- * Add a foreign key column to the table.
+- *
+- * @param columnName A String with the column name.
+-+ * @param javaName A string with the Java property name
+- * @param type An Object specifying the type.
+- * @param fkTable A String with the foreign key table name.
+- * @param fkColumn A String with the foreign key column name.
+- * @param size An int specifying the size.
+- */
+- public void addForeignKey(String columnName,
+-+ String javaName,
+- Object type,
+- String fkTable,
+- String fkColumn,
+- int size)
+- {
+-- addColumn(columnName, type, false, fkTable, fkColumn, size);
+-+ addColumn(columnName, javaName, type, false, fkTable, fkColumn, size);
+- }
+-
+- /**
+- * Add a foreign primary key column to the table.
+- *
+- * @param columnName A String with the column name.
+-+ * @param javaName A string with the Java property name
+- * @param type An Object specifying the type.
+- * @param fkTable A String with the foreign key table name.
+- * @param fkColumn A String with the foreign key column name.
+- */
+- public void addForeignPrimaryKey(String columnName,
+-+ String javaName,
+- Object type,
+- String fkTable,
+- String fkColumn)
+- {
+-- addColumn(columnName, type, true, fkTable, fkColumn, 0);
+-+ addColumn(columnName, javaName, type, true, fkTable, fkColumn, 0);
+- }
+-
+- /**
+- * Add a foreign primary key column to the table.
+- *
+- * @param columnName A String with the column name.
+-+ * @param javaName A string with the Java property name
+- * @param type An Object specifying the type.
+- * @param fkTable A String with the foreign key table name.
+- * @param fkColumn A String with the foreign key column name.
+- * @param size An int specifying the size.
+- */
+- public void addForeignPrimaryKey(String columnName,
+-+ String javaName,
+- Object type,
+- String fkTable,
+- String fkColumn,
+- int size)
+- {
+-- addColumn(columnName, type, true, fkTable, fkColumn, size);
+-+ addColumn(columnName, javaName, type, true, fkTable, fkColumn, size);
+- }
+-
+- /**
+- * Add a column to the table.
+- *
+- * @param name A String with the column name.
+-+ * @param javaName A string with the Java property name
+- * @param type An Object specifying the type.
+- * @param pk True if column is a primary key.
+- * @param fkTable A String with the foreign key table name.
+-@@ -442,6 +465,7 @@
+- * @param size An int specifying the size.
+- */
+- private void addColumn(String name,
+-+ String javaName,
+- Object type,
+- boolean pk,
+- String fkTable,
+-@@ -464,6 +488,7 @@
+- }
+- }
+- ColumnMap col = new ColumnMap(name, this);
+-+ col.setJavaName(javaName);
+- col.setType(type);
+- col.setPrimaryKey(pk);
+- col.setForeignKey(fkTable, fkColumn);
+diff --exclude=CVS -Nurb
db-torque_BRANCH31.vanilla/src/generator/src/templates/om/MapBuilder.vm
db-torque_BRANCH31.work/src/generator/src/templates/om/MapBuilder.vm
+--- db-torque_BRANCH31.vanilla/src/generator/src/templates/om/MapBuilder.vm
2003-08-07 15:13:00.000000000 +0200
++++ db-torque_BRANCH31.work/src/generator/src/templates/om/MapBuilder.vm
2003-10-21 14:37:31.000000000 +0200
+@@ -121,19 +121,19 @@
+ #set ( $cup=$col.Name.toUpperCase() )
#if($col.isPrimaryKey())
#if($col.isForeignKey())
- tMap.addForeignPrimaryKey(
+- tMap.addForeignPrimaryKey(
- "${table.Name}.$cup", $col.JavaObject , "$col.RelatedTableName" ,
++ tMap.addForeignPrimaryKeyWithJavaName(
+ "${table.Name}.$cup", "$cfc", $col.JavaObject ,
"$col.RelatedTableName" ,
"$col.RelatedColumnName");
#else
- tMap.addPrimaryKey("${table.Name}.$cup", $col.JavaObject);
-+ tMap.addPrimaryKey("${table.Name}.$cup", "$cfc", $col.JavaObject);
++ tMap.addPrimaryKeyWithJavaName("${table.Name}.$cup", "$cfc",
$col.JavaObject);
#end
#else
#if($col.isForeignKey())
- tMap.addForeignKey(
+- tMap.addForeignKey(
- "${table.Name}.$cup", $col.JavaObject , "$col.RelatedTableName" ,
++ tMap.addForeignKeyWithJavaName(
+ "${table.Name}.$cup", "$cfc", $col.JavaObject ,
"$col.RelatedTableName" ,
"$col.RelatedColumnName");
#else
- tMap.addColumn("${table.Name}.$cup", $col.JavaObject);
-+ tMap.addColumn("${table.Name}.$cup", "$cfc", $col.JavaObject);
++ tMap.addColumnWithJavaName("${table.Name}.$cup", "$cfc", $col.JavaObject);
#end
#end
#end
-Index: db-torque/src/java/org/apache/torque/TorqueInstance.java
-===================================================================
-RCS file: /home/cvs/db-torque/src/java/org/apache/torque/TorqueInstance.java,v
-retrieving revision 1.5
-diff -u -b -r1.5 TorqueInstance.java
---- db-torque/src/java/org/apache/torque/TorqueInstance.java 5 Aug 2003 18:09:35
-0000 1.5
-+++ db-torque/src/java/org/apache/torque/TorqueInstance.java 17 Oct 2003 12:03:34
-0000
-@@ -706,10 +706,10 @@
- {
- map.setIdTable("ID_TABLE");
- TableMap tMap = map.getIdTable();
-- tMap.addPrimaryKey("ID_TABLE_ID", new Integer(0));
-- tMap.addColumn("TABLE_NAME", "");
-- tMap.addColumn("NEXT_ID", new Integer(0));
-- tMap.addColumn("QUANTITY", new Integer(0));
-+ tMap.addPrimaryKey("ID_TABLE_ID", "IdTableId", new Integer(0));
-+ tMap.addColumn("TABLE_NAME", "TableName", "");
-+ tMap.addColumn("NEXT_ID", "NextId", new Integer(0));
-+ tMap.addColumn("QUANTITY", "Quantity", new Integer(0));
- }
-
- /**
-Index: db-torque/src/java/org/apache/torque/map/ColumnMap.java
-===================================================================
-RCS file: /home/cvs/db-torque/src/java/org/apache/torque/map/ColumnMap.java,v
-retrieving revision 1.7
-diff -u -b -r1.7 ColumnMap.java
---- db-torque/src/java/org/apache/torque/map/ColumnMap.java 21 Mar 2003 17:31:08
-0000 1.7
-+++ db-torque/src/java/org/apache/torque/map/ColumnMap.java 17 Oct 2003 12:03:34
-0000
+diff --exclude=CVS -Nurb
db-torque_BRANCH31.vanilla/src/java/org/apache/torque/map/ColumnMap.java
db-torque_BRANCH31.work/src/java/org/apache/torque/map/ColumnMap.java
+--- db-torque_BRANCH31.vanilla/src/java/org/apache/torque/map/ColumnMap.java
2003-03-21 18:31:08.000000000 +0100
++++ db-torque_BRANCH31.work/src/java/org/apache/torque/map/ColumnMap.java
2003-10-21 14:25:12.000000000 +0200
@@ -86,6 +86,9 @@
/** The name of the column. */
private String columnName;
@@ -63,13 +315,10 @@
/**
* Constructor.
-@@ -107,6 +110,26 @@
- public String getColumnName()
- {
- return columnName;
-+ }
-+
-+ /**
+@@ -110,6 +113,26 @@
+ }
+
+ /**
+ * Set the java name of this column.
+ *
+ * @param javaName The name for this property
@@ -87,181 +336,237 @@
+ public String getJavaName()
+ {
+ return javaName;
++ }
++
++ /**
+ * Get the table name + column name.
+ *
+ * @return A String with the full column name.
+diff --exclude=CVS -Nurb
db-torque_BRANCH31.vanilla/src/java/org/apache/torque/map/TableMap.java
db-torque_BRANCH31.work/src/java/org/apache/torque/map/TableMap.java
+--- db-torque_BRANCH31.vanilla/src/java/org/apache/torque/map/TableMap.java
2003-08-23 15:18:54.000000000 +0200
++++ db-torque_BRANCH31.work/src/java/org/apache/torque/map/TableMap.java
2003-10-21 14:40:43.000000000 +0200
+@@ -329,6 +329,20 @@
}
/**
-Index: db-torque/src/java/org/apache/torque/map/TableMap.java
-===================================================================
-RCS file: /home/cvs/db-torque/src/java/org/apache/torque/map/TableMap.java,v
-retrieving revision 1.13
-diff -u -b -r1.13 TableMap.java
---- db-torque/src/java/org/apache/torque/map/TableMap.java 23 Aug 2003 13:18:54
-0000 1.13
-+++ db-torque/src/java/org/apache/torque/map/TableMap.java 17 Oct 2003 12:03:34
-0000
-@@ -321,120 +321,143 @@
- * Add a column to this table of a certain type.
- *
- * @param columnName A String with the column name.
++ * Add a column to this table of a certain type.
++ *
++ * @param columnName A String with the column name.
+ * @param javaName A string with the Java property name
- * @param type An Object specifying the type.
- */
-- public void addColumn(String columnName, Object type)
-+ public void addColumn(String columnName,
++ * @param type An Object specifying the type.
++ */
++ public void addColumnWithJavaName(String columnName,
+ String javaName,
+ Object type)
- {
-- addColumn(columnName, type, false, null, null, 0);
-+ addColumn(columnName, javaName, type, false, null, null, 0);
- }
-
- /**
++ {
++ addColumnWithJavaName(columnName, javaName, type, false, null, null, 0);
++ }
++
++ /**
* Add a column to this table of a certain type and size.
*
* @param columnName A String with the column name.
+@@ -341,6 +355,22 @@
+ }
+
+ /**
++ * Add a column to this table of a certain type and size.
++ *
++ * @param columnName A String with the column name.
+ * @param javaName A string with the Java property name
- * @param type An Object specifying the type.
- * @param size An int specifying the size.
- */
-- public void addColumn(String columnName, Object type, int size)
-+ public void addColumn(String columnName,
++ * @param type An Object specifying the type.
++ * @param size An int specifying the size.
++ */
++ public void addColumnWithJavaName(String columnName,
+ String javaName,
+ Object type,
+ int size)
- {
-- addColumn(columnName, type, false, null, null, size);
-+ addColumn(columnName, javaName, type, false, null, null, size);
- }
-
- /**
++ {
++ addColumnWithJavaName(columnName, javaName, type, false, null, null, size);
++ }
++
++ /**
* Add a primary key column to this Table.
*
* @param columnName A String with the column name.
-+ * @param javaName A string with the Java property name
- * @param type An Object specifying the type.
- */
-- public void addPrimaryKey(String columnName, Object type)
-+ public void addPrimaryKey(String columnName,
-+ String javaName,
-+ Object type)
- {
-- addColumn(columnName, type, true, null, null, 0);
-+ addColumn(columnName, javaName, type, true, null, null, 0);
- }
-
- /**
+@@ -355,6 +385,20 @@
* Add a primary key column to this Table.
*
* @param columnName A String with the column name.
+ * @param javaName A string with the Java property name
++ * @param type An Object specifying the type.
++ */
++ public void addPrimaryKeyWithJavaName(String columnName,
++ String javaName,
++ Object type)
++ {
++ addColumnWithJavaName(columnName, javaName, type, true, null, null, 0);
++ }
++
++ /**
++ * Add a primary key column to this Table.
++ *
++ * @param columnName A String with the column name.
* @param type An Object specifying the type.
* @param size An int specifying the size.
*/
-- public void addPrimaryKey(String columnName, Object type, int size)
-+ public void addPrimaryKey(String columnName,
-+ String javaName,
-+ Object type,
-+ int size)
- {
-- addColumn(columnName, type, true, null, null, size);
-+ addColumn(columnName, javaName, type, true, null, null, size);
+@@ -364,6 +408,22 @@
}
/**
++ * Add a primary key column to this Table.
++ *
++ * @param columnName A String with the column name.
++ * @param javaName A string with the Java property name
++ * @param type An Object specifying the type.
++ * @param size An int specifying the size.
++ */
++ public void addPrimaryKeyWithJavaName(String columnName,
++ String javaName,
++ Object type,
++ int size)
++ {
++ addColumnWithJavaName(columnName, javaName, type, true, null, null, size);
++ }
++
++ /**
* Add a foreign key column to the table.
*
* @param columnName A String with the column name.
-+ * @param javaName A string with the Java property name
- * @param type An Object specifying the type.
- * @param fkTable A String with the foreign key table name.
- * @param fkColumn A String with the foreign key column name.
- */
- public void addForeignKey(String columnName,
-+ String javaName,
- Object type,
- String fkTable,
- String fkColumn)
- {
-- addColumn(columnName, type, false, fkTable, fkColumn, 0);
-+ addColumn(columnName, javaName, type, false, fkTable, fkColumn, 0);
- }
-
- /**
+@@ -383,6 +443,24 @@
* Add a foreign key column to the table.
*
* @param columnName A String with the column name.
+ * @param javaName A string with the Java property name
++ * @param type An Object specifying the type.
++ * @param fkTable A String with the foreign key table name.
++ * @param fkColumn A String with the foreign key column name.
++ */
++ public void addForeignKeyWithJavaName(String columnName,
++ String javaName,
++ Object type,
++ String fkTable,
++ String fkColumn)
++ {
++ addColumnWithJavaName(columnName, javaName, type, false, fkTable,
fkColumn, 0);
++ }
++
++ /**
++ * Add a foreign key column to the table.
++ *
++ * @param columnName A String with the column name.
* @param type An Object specifying the type.
* @param fkTable A String with the foreign key table name.
* @param fkColumn A String with the foreign key column name.
- * @param size An int specifying the size.
- */
- public void addForeignKey(String columnName,
-+ String javaName,
- Object type,
- String fkTable,
- String fkColumn,
- int size)
- {
-- addColumn(columnName, type, false, fkTable, fkColumn, size);
-+ addColumn(columnName, javaName, type, false, fkTable, fkColumn, size);
+@@ -398,6 +476,26 @@
}
/**
++ * Add a foreign key column to the table.
++ *
++ * @param columnName A String with the column name.
++ * @param javaName A string with the Java property name
++ * @param type An Object specifying the type.
++ * @param fkTable A String with the foreign key table name.
++ * @param fkColumn A String with the foreign key column name.
++ * @param size An int specifying the size.
++ */
++ public void addForeignKeyWithJavaName(String columnName,
++ String javaName,
++ Object type,
++ String fkTable,
++ String fkColumn,
++ int size)
++ {
++ addColumnWithJavaName(columnName, javaName, type, false, fkTable,
fkColumn, size);
++ }
++
++ /**
* Add a foreign primary key column to the table.
*
* @param columnName A String with the column name.
-+ * @param javaName A string with the Java property name
- * @param type An Object specifying the type.
- * @param fkTable A String with the foreign key table name.
- * @param fkColumn A String with the foreign key column name.
- */
- public void addForeignPrimaryKey(String columnName,
-+ String javaName,
- Object type,
- String fkTable,
- String fkColumn)
- {
-- addColumn(columnName, type, true, fkTable, fkColumn, 0);
-+ addColumn(columnName, javaName, type, true, fkTable, fkColumn, 0);
- }
-
- /**
+@@ -417,6 +515,24 @@
* Add a foreign primary key column to the table.
*
* @param columnName A String with the column name.
+ * @param javaName A string with the Java property name
++ * @param type An Object specifying the type.
++ * @param fkTable A String with the foreign key table name.
++ * @param fkColumn A String with the foreign key column name.
++ */
++ public void addForeignPrimaryKeyWithJavaName(String columnName,
++ String javaName,
++ Object type,
++ String fkTable,
++ String fkColumn)
++ {
++ addColumnWithJavaName(columnName, javaName, type, true, fkTable, fkColumn,
0);
++ }
++
++ /**
++ * Add a foreign primary key column to the table.
++ *
++ * @param columnName A String with the column name.
* @param type An Object specifying the type.
* @param fkTable A String with the foreign key table name.
* @param fkColumn A String with the foreign key column name.
- * @param size An int specifying the size.
- */
- public void addForeignPrimaryKey(String columnName,
-+ String javaName,
- Object type,
- String fkTable,
- String fkColumn,
- int size)
- {
-- addColumn(columnName, type, true, fkTable, fkColumn, size);
-+ addColumn(columnName, javaName, type, true, fkTable, fkColumn, size);
+@@ -432,6 +548,26 @@
}
/**
++ * Add a foreign primary key column to the table.
++ *
++ * @param columnName A String with the column name.
++ * @param javaName A string with the Java property name
++ * @param type An Object specifying the type.
++ * @param fkTable A String with the foreign key table name.
++ * @param fkColumn A String with the foreign key column name.
++ * @param size An int specifying the size.
++ */
++ public void addForeignPrimaryKeyWithJavaName(String columnName,
++ String javaName,
++ Object type,
++ String fkTable,
++ String fkColumn,
++ int size)
++ {
++ addColumnWithJavaName(columnName, javaName, type, true, fkTable, fkColumn,
size);
++ }
++
++ /**
* Add a column to the table.
*
* @param name A String with the column name.
+@@ -448,6 +584,28 @@
+ String fkColumn,
+ int size)
+ {
++ addColumnWithJavaName(name, name, type, pk, fkTable, fkColumn, size);
++ }
++
++ /**
++ * Add a column to the table.
++ *
++ * @param name A String with the column name.
+ * @param javaName A string with the Java property name
- * @param type An Object specifying the type.
- * @param pk True if column is a primary key.
- * @param fkTable A String with the foreign key table name.
-@@ -442,6 +465,7 @@
- * @param size An int specifying the size.
- */
- private void addColumn(String name,
++ * @param type An Object specifying the type.
++ * @param pk True if column is a primary key.
++ * @param fkTable A String with the foreign key table name.
++ * @param fkColumn A String with the foreign key column name.
++ * @param size An int specifying the size.
++ */
++ private void addColumnWithJavaName(String name,
+ String javaName,
- Object type,
- boolean pk,
- String fkTable,
-@@ -464,6 +488,7 @@
++ Object type,
++ boolean pk,
++ String fkTable,
++ String fkColumn,
++ int size)
++ {
+ // If the tablename is prefixed with the name of the column,
+ // remove it ie: SCARAB_PROJECT.PROJECT_ID remove the
+ // SCARAB_PROJECT.
+@@ -464,6 +622,7 @@
}
}
ColumnMap col = new ColumnMap(name, this);
@@ -269,3 +574,21 @@
col.setType(type);
col.setPrimaryKey(pk);
col.setForeignKey(fkTable, fkColumn);
+diff --exclude=CVS -Nurb
db-torque_BRANCH31.vanilla/src/java/org/apache/torque/TorqueInstance.java
db-torque_BRANCH31.work/src/java/org/apache/torque/TorqueInstance.java
+--- db-torque_BRANCH31.vanilla/src/java/org/apache/torque/TorqueInstance.java
2003-08-05 20:09:35.000000000 +0200
++++ db-torque_BRANCH31.work/src/java/org/apache/torque/TorqueInstance.java
2003-10-21 14:35:08.000000000 +0200
+@@ -706,10 +706,10 @@
+ {
+ map.setIdTable("ID_TABLE");
+ TableMap tMap = map.getIdTable();
+- tMap.addPrimaryKey("ID_TABLE_ID", new Integer(0));
+- tMap.addColumn("TABLE_NAME", "");
+- tMap.addColumn("NEXT_ID", new Integer(0));
+- tMap.addColumn("QUANTITY", new Integer(0));
++ tMap.addPrimaryKeyWithJavaName("ID_TABLE_ID", "IdTableId", new Integer(0));
++ tMap.addColumnWithJavaName("TABLE_NAME", "TableName", "");
++ tMap.addColumnWithJavaName("NEXT_ID", "NextId", new Integer(0));
++ tMap.addColumnWithJavaName("QUANTITY", "Quantity", new Integer(0));
+ }
+
+ /**
No revision
No revision
1.1.2.3 +10 -10 db-torque/proposals/henning/idtable-peer/idtable-peer.patch
Index: idtable-peer.patch
===================================================================
RCS file: /home/cvs/db-torque/proposals/henning/idtable-peer/idtable-peer.patch,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- idtable-peer.patch 20 Oct 2003 13:45:35 -0000 1.1.2.2
+++ idtable-peer.patch 21 Oct 2003 12:52:39 -0000 1.1.2.3
@@ -344,14 +344,14 @@
- map.setIdTable("ID_TABLE");
+ map.setIdTable(IDBroker.ID_TABLE);
TableMap tMap = map.getIdTable();
-- tMap.addPrimaryKey("ID_TABLE_ID", "IdTableId", new Integer(0));
-- tMap.addColumn("TABLE_NAME", "TableName", "");
-- tMap.addColumn("NEXT_ID", "NextId", new Integer(0));
-- tMap.addColumn("QUANTITY", "Quantity", new Integer(0));
-+ tMap.addPrimaryKey(IDBroker.COL_TABLE_ID, "IdTableId", new Integer(0));
-+ tMap.addColumn(IDBroker.COL_TABLE_NAME, "TableName", "");
-+ tMap.addColumn(IDBroker.COL_NEXT_ID, "NextId", new Integer(0));
-+ tMap.addColumn(IDBroker.COL_QUANTITY, "Quantity", new Integer(0));
+- tMap.addPrimaryKeyWithJavaName("ID_TABLE_ID", "IdTableId", new Integer(0));
+- tMap.addColumnWithJavaName("TABLE_NAME", "TableName", "");
+- tMap.addColumnWithJavaName("NEXT_ID", "NextId", new Integer(0));
+- tMap.addColumnWithJavaName("QUANTITY", "Quantity", new Integer(0));
++ tMap.addPrimaryKeyWithJavaName(IDBroker.COL_TABLE_ID, "IdTableId", new
Integer(0));
++ tMap.addColumnWithJavaName(IDBroker.COL_TABLE_NAME, "TableName", "");
++ tMap.addColumnWithJavaName(IDBroker.COL_NEXT_ID, "NextId", new Integer(0));
++ tMap.addColumnWithJavaName(IDBroker.COL_QUANTITY, "Quantity", new
Integer(0));
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]