mpoeschl 2003/01/18 06:51:34
Modified: src/java/org/apache/torque/om NumberKey.java SimpleKey.java
src/rttest test-schema.xml
xdocs changes.xml
Log:
TRQS118: Generated OM doesn't compile when using FLOAT as primary key
Revision Changes Path
1.15 +9 -1
jakarta-turbine-torque/src/java/org/apache/torque/om/NumberKey.java
Index: NumberKey.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/om/NumberKey.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- NumberKey.java 26 Nov 2002 22:32:55 -0000 1.14
+++ NumberKey.java 18 Jan 2003 14:51:34 -0000 1.15
@@ -125,6 +125,14 @@
/**
* Creates a NumberKey equivalent to <code>key</code>.
+ */
+ public NumberKey(double key)
+ {
+ this.key = new BigDecimal(key);
+ }
+
+ /**
+ * Creates a NumberKey equivalent to <code>key</code>.
* Convenience only. Not very efficient at all.
*
* @param key the key value
1.5 +11 -1
jakarta-turbine-torque/src/java/org/apache/torque/om/SimpleKey.java
Index: SimpleKey.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/om/SimpleKey.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SimpleKey.java 25 Sep 2002 05:46:51 -0000 1.4
+++ SimpleKey.java 18 Jan 2003 14:51:34 -0000 1.5
@@ -99,6 +99,16 @@
* @param key the key value
* @return a SimpleKey
*/
+ public static SimpleKey keyFor(double key)
+ {
+ return new NumberKey(key);
+ }
+
+ /**
+ * Creates a SimpleKey equivalent to key
+ * @param key the key value
+ * @return a SimpleKey
+ */
public static SimpleKey keyFor(Number key)
{
return new NumberKey(key);
1.9 +5 -1 jakarta-turbine-torque/src/rttest/test-schema.xml
Index: test-schema.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/rttest/test-schema.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- test-schema.xml 20 Dec 2002 16:39:21 -0000 1.8
+++ test-schema.xml 18 Jan 2003 14:51:34 -0000 1.9
@@ -78,5 +78,9 @@
</foreign-key>
</table>
-</database>
+ <!-- TRQS118 primary key of type FLOAT -->
+ <table name="float_pk">
+ <column name="test_key" required="true" primaryKey="true" type="FLOAT" />
+ </table>
+</database>
1.64 +3 -0 jakarta-turbine-torque/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/xdocs/changes.xml,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- changes.xml 3 Jan 2003 20:22:59 -0000 1.63
+++ changes.xml 18 Jan 2003 14:51:34 -0000 1.64
@@ -68,6 +68,9 @@
<li>
TRQS104: Use of null Object
</li>
+ <li>
+ TRQS118: Generated OM doesn't compile when using FLOAT as primary key
+ </li>
</ul>
</p>
</subsection>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>