db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r149467 - incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile
Date Wed, 02 Feb 2005 00:59:33 GMT
Author: djd
Date: Tue Feb  1 16:59:26 2005
New Revision: 149467

URL: http://svn.apache.org/viewcvs?view=rev&rev=149467
Log:
Change setting of BigDecimal and other object types to be set through the Number
class rather than BigDecimal or explicit class, since BigDecimal is not supported
in J2ME/CDC/Foundation


Modified:
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/BooleanDataValue.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataType.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueDescriptor.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactory.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataValue.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBoolean.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLChar.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDecimal.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDouble.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongint.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLReal.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/StringDataValue.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/UserType.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement20.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BitTypeCompiler.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CharTypeCompiler.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UserDefinedTypeCompiler.java

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/BooleanDataValue.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/BooleanDataValue.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/BooleanDataValue.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/BooleanDataValue.java
Tue Feb  1 16:59:26 2005
@@ -118,69 +118,6 @@
 	 */
 	public void setValue(Boolean theValue);
 
-
-	/**
-	 * Set the value of this BooleanDataValue to the given int value
-	 *
-	 * @param theValue	The value to set this BooleanDataValue to
-	 *
-	 * @return	This BooleanDataValue
-	 *
-	 */
-	public void setValue(Integer theValue);
-
-	/**
-	 * Set the value of this BooleanDataValue to the given double value
-	 *
-	 * @param theValue	The value to set this BooleanDataValue to
-	 *
-	 * @return	This BooleanDataValue
-	 *
-	 */
-	public void setValue(Double theValue);
-
-	/**
-	 * Set the value of this BooleanDataValue to the given float value
-	 *
-	 * @param theValue	The value to set this BooleanDataValue to
-	 *
-	 * @return	This BooleanDataValue
-	 *
-	 */
-	public void setValue(Float theValue);
-
-
-	/**
-	 * Set the value of this BooleanDataValue to the given short value
-	 *
-	 * @param theValue	The value to set this BooleanDataValue to
-	 *
-	 * @return	This BooleanDataValue
-	 *
-	 */
-	public void setValue(Short theValue);
-
-	/**
-	 * Set the value of this BooleanDataValue to the given long value
-	 *
-	 * @param theValue	The value to set this BooleanDataValue to
-	 *
-	 * @return	This BooleanDataValue
-	 *
-	 */
-	public void setValue(Long theValue);
-
-
-	/**
-	 * Set the value of this BooleanDataValue to the given Byte value
-	 *
-	 * @param theValue	The value to set this BooleanDataValue to
-	 *
-	 * @return	This BooleanDataValue
-	 *
-	 */
-	public void setValue(Byte theValue);
-
 	/**
 	 * Tell whether a BooleanDataValue has the given value.  This is useful
 	 * for short-circuiting.

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataType.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataType.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataType.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataType.java Tue Feb
 1 16:59:26 2005
@@ -364,22 +364,6 @@
 	{
 		throwLangSetMismatch("java.sql.Date");
 	}
-	
-	/**
-	 * Set the value of this DataValueDescriptor.
-	 * At DataType level just throws an error lower classes will override
-	 *
-	 * @param theValue	The BigDecimal value to set this DataValueDescriptor to
-	 *
-	 * @return	This DataValueDescriptor
-	 *
-	 */
-
-	public void setValue(BigDecimal theValue) throws StandardException
-	{
-		throwLangSetMismatch("java.math.BigDecimal");
-	}
-
 
 	/**
 	 * Set the value of this DataValueDescriptor.
@@ -511,6 +495,14 @@
 	public void setValue(byte[] theValue) throws StandardException
 	{
 		throwLangSetMismatch("byte[]");
+	}
+
+	/**
+		Only to be called when the application sets a value using BigDecimal
+	*/
+	public void setBigDecimal(Number bigDecimal) throws StandardException
+	{
+		throwLangSetMismatch("java.math.BigDecimal");
 	}
 
 

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueDescriptor.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueDescriptor.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueDescriptor.java
Tue Feb  1 16:59:26 2005
@@ -445,15 +445,18 @@
 	 */
 	public void setValue(byte[] theValue) throws StandardException;
 
-/**
-	 * Set the value of this DataValueDescriptor.
-	 *
-	 * @param theValue	The BigDecimal value to set this DataValueDescriptor to
-	 *
-	 * @return	This DataValueDescriptor
-	 *
+	/**
+		Set this value from an application supplied java.math.BigDecimal.
+		This is to support the PreparedStatement.setBigDecimal method and
+		similar JDBC methods that allow an application to pass in a BigDecimal
+		to any SQL type.
+		Parameter is declared as java.lang.Number to allow compilation
+		under J2ME/CDC/Foundation. This method will not be called in
+		any environment that does not support java.math.BigDecimal.
+
+		@param bigDecimal required to be a BigDecimal or null.
 	 */
-	public void setValue(BigDecimal theValue) throws StandardException;
+	public void setBigDecimal(Number bigDecimal) throws StandardException;
 
 	/**
 	 * Set the value of this DataValueDescriptor.

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactory.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactory.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactory.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactory.java
Tue Feb  1 16:59:26 2005
@@ -298,8 +298,8 @@
          *
          * @exception StandardException         Thrown on error
          */
-        NumberDataValue         getDecimalDataValue(BigDecimal value) throws StandardException;
-        NumberDataValue         getDecimalDataValue(BigDecimal value, NumberDataValue previous)
+        NumberDataValue         getDecimalDataValue(Number value) throws StandardException;
+        NumberDataValue         getDecimalDataValue(Number value, NumberDataValue previous)
                                                         throws StandardException;
 
 

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
Tue Feb  1 16:59:26 2005
@@ -285,15 +285,15 @@
                 previous.setValue(value);
                 return previous;
         }
-        public NumberDataValue getDecimalDataValue(BigDecimal value)
+        public NumberDataValue getDecimalDataValue(Number value)
+			throws StandardException
         {
-                if (value != null)
-                        return new SQLDecimal(value);
-                else
-                        return new SQLDecimal();
+			NumberDataValue ndv = getNullDecimal((NumberDataValue) null);
+			ndv.setValue(value);
+			return ndv;
         }
 
-        public NumberDataValue getDecimalDataValue(BigDecimal value, NumberDataValue previous)
+        public NumberDataValue getDecimalDataValue(Number value, NumberDataValue previous)
                         throws StandardException
         {
                 if (previous == null)

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java
Tue Feb  1 16:59:26 2005
@@ -200,104 +200,51 @@
      *          For positive values or null, return false.
      */
     protected abstract boolean isNegative();
-
+		
 	/**
+	   Common code to handle java.lang.Integer as a Number,
+	   used for TINYINT, SMALLINT, INTEGER
 	 * @see NumberDataValue#setValue
 	 *
+	 * @exception StandardException		Thrown on error
 	 */
-	public final void setValue(Byte theValue) throws StandardException
+	public void setValue(Number theValue) throws StandardException
 	{
-		if (!objectNull(theValue))
+		if (objectNull(theValue))
+			return;
+		
+		if (SanityManager.ASSERT)
 		{
-			setValue(theValue.byteValue());
+			if (!(theValue instanceof java.lang.Integer))
+				SanityManager.THROWASSERT("NumberDataType.setValue(Number) passed a " + theValue.getClass());
 		}
-	}
-	
-	/**
-	 * @see NumberDataValue#setValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public final void setValue(Short theValue) throws StandardException
-	{
-		if (!objectNull(theValue))
-			setValue(theValue.shortValue());
-	}
-	
-	/**
-	 * @see NumberDataValue#setValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public final void setValue(Integer theValue) throws StandardException
-	{
-		if (!objectNull(theValue))
-			setValue(theValue.intValue());
-	}
-	
-	/**
-	 * @see NumberDataValue#setValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public final void setValue(Long theValue) throws StandardException
-	{
-		if (!objectNull(theValue))
-			setValue(theValue.longValue());
-	}
-	/**
-	 * @see NumberDataValue#setValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public final void setValue(Double theValue) throws StandardException
-	{
-		if (!objectNull(theValue))
-			setValue(theValue.doubleValue());
+		
+		setValue(theValue.intValue());
 	}
 
 	/**
 		setValue for integral exact numerics. Converts the BigDecimal
 		to a long to preserve precision
 	*/
-	public  void setValue(BigDecimal theValue) throws StandardException
+	public void setBigDecimal(Number bigDecimal) throws StandardException
 	{
-		if (objectNull(theValue))
+		if (objectNull(bigDecimal))
 			return;
 
+		Comparable bdc = (Comparable) bigDecimal;
+
+
 		// See comment in SQLDecimal.getLong()
 
-		if (   (theValue.compareTo(SQLDecimal.MINLONG_MINUS_ONE) == 1)
-			&& (theValue.compareTo(SQLDecimal.MAXLONG_PLUS_ONE) == -1)) {
+		if (   (bdc.compareTo(SQLDecimal.MINLONG_MINUS_ONE) == 1)
+			&& (bdc.compareTo(SQLDecimal.MAXLONG_PLUS_ONE) == -1)) {
 
-			setValue(theValue.longValue());
+			setValue(bigDecimal.longValue());
 		} else {
 
 			throw StandardException.newException(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE, getTypeName());
 		}
-	}
-
-	/**
-	 * @see NumberDataValue#setValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public final void setValue(Float theValue) throws StandardException
-	{
-		if (!objectNull(theValue))
-			setValue(theValue.floatValue());
-	}
-	
-	/**
-	 * @see NumberDataValue#setValue
-	 *
-	 */
-	public final void setValue(Boolean theValue) throws StandardException
-	{
-		if (!objectNull(theValue))
-			setValue(theValue.booleanValue());
-	}
-
+	}	
 	/**
 		Return the precision of this specific DECIMAL value.
 		If the value does not represent a SQL DECIMAL then

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataValue.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataValue.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataValue.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataValue.java
Tue Feb  1 16:59:26 2005
@@ -172,92 +172,28 @@
                             throws StandardException;
 
 	/**
-	 * Set the value of this NumberDataValue to the given int value
+	 * Set the value of this NumberDataValue to the given value.
+	   This is only intended to be called when mapping values from
+	   the Java space into the SQL space, e.g. parameters and return
+	   types from procedures and functions. Each specific type is only
+	   expected to handle the explicit type according the JDBC.
+	   <UL>
+	   <LI> SMALLINT from java.lang.Integer
+	   <LI> INTEGER from java.lang.Integer
+	   <LI> LONG from java.lang.Long
+	   <LI> FLOAT from java.lang.Float
+	   <LI> DOUBLE from java.lang.Double
+	   <LI> DECIMAL from java.math.BigDecimal
+	   </UL>
 	 *
-	 * @param theValue	An Integer containing the value to set this
+	 * @param theValue	An Number containing the value to set this
 	 *					NumberDataValue to.  Null means set the value
 	 *					to SQL null.
 	 *
 	 * @return	This NumberDataValue
 	 *
-	 * @exception StandardException		Thrown on error
 	 */
-	public void setValue(Integer theValue) throws StandardException;
-
-	/**
-	 * Set the value of this NumberDataValue to the given double value
-	 *
-	 * @param theValue	A Double containing the value to set this
-	 *					NumberDataValue to.  Null means set the value
-	 *					to SQL null.
-	 *
-	 * @return	This NumberDataValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public void setValue(Double theValue) throws StandardException;
-
-	/**
-	 * Set the value of this NumberDataValue to the given float value
-	 *
-	 * @param theValue	A Float containing the value to set this
-	 *					NumberDataValue to.  Null means set the value
-	 *					to SQL null.
-	 *
-	 * @return	This NumberDataValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public void setValue(Float theValue) throws StandardException;
-
-	/**
-	 * Set the value of this NumberDataValue to the given short value
-	 *
-	 * @param theValue	A Short containing the value to set this
-	 *					NumberDataValue to.  Null means set the value
-	 *					to SQL null.
-	 *
-	 * @return	This NumberDataValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public void setValue(Short theValue) throws StandardException;
-
-
-	/**
-	 * Set the value of this NumberDataValue to the given long value
-	 *
-	 * @param theValue	A Long containing the value to set this
-	 *					NumberDataValue to.  Null means set the value
-	 *					to SQL null.
-	 *
-	 * @return	This NumberDataValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public void setValue(Long theValue) throws StandardException;
-
-	/**
-	 * Set the value of this NumberDataValue to the given byte value
-	 *
-	 * @param theValue	A Byte containing the value to set this
-	 *					NumberDataValue to.  Null means set the value
-	 *					to SQL null.
-	 *
-	 * @return	This NumberDataValue
-	 *
-	 */
-	public void setValue(Byte theValue) throws StandardException;
-
-	/**
-	 * Set the value.
-	 *
-	 * @param theValue	Contains the boolean value to set this to
-	 *
-	 * @return	This value
-	 *
-	 */
-	public void setValue(Boolean theValue) throws StandardException;
+	public void setValue(Number theValue) throws StandardException;
 
 	/**
 		Return the precision of this specific DECIMAL value.

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBoolean.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBoolean.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBoolean.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBoolean.java Tue
Feb  1 16:59:26 2005
@@ -492,19 +492,19 @@
 
 	}
 
-	public void setValue(BigDecimal theValue)
+	public void setBigDecimal(Number bigDecimal)
 	{
 		if (SanityManager.DEBUG)
 			SanityManager.ASSERT( ! immutable,
 						"Attempt to set the value of an immutable SQLBoolean");
-		if (theValue == null)
+		if (bigDecimal == null)
 		{
 			value = false;
 			isnull = true;
 		}
 		else
 		{
-			value = theValue.compareTo(org.apache.derby.iapi.types.SQLDecimal.ZERO) != 0;
+			value = org.apache.derby.iapi.types.SQLDecimal.ZERO.compareTo(bigDecimal) != 0;
 			isnull = false;
 		}
 
@@ -595,78 +595,6 @@
 			isnull = false;
 		}
 
-	}
-
-	/**
-	 * Set the value of this BooleanDataValue to the given Byte value
-	 *
-	 * @param theValue	The value to set this BooleanDataValue to
-	 *
-	 * @return	This BooleanDataValue
-	 */
-	public void setValue(Byte theValue)
-	{
-		setValueCore(theValue);
-	}
-
-	/**
-	 * Set the value of this BooleanDataValue to the given Short value
-	 *
-	 * @param theValue	The value to set this BooleanDataValue to
-	 *
-	 * @return	This BooleanDataValue
-	 */
-	public void setValue(Short theValue)
-	{
-		setValueCore(theValue);
-	}
-	
-	/**
-	 * Set the value of this BooleanDataValue to the given Long value
-	 *
-	 * @param theValue	The value to set this BooleanDataValue to
-	 *
-	 * @return	This BooleanDataValue
-	 */
-	public void setValue(Long theValue)
-	{
-		setValueCore(theValue);
-	}
-
-	/**
-	 * Set the value of this BooleanDataValue to the given Integer value
-	 *
-	 * @param theValue	The value to set this BooleanDataValue to
-	 *
-	 * @return	This BooleanDataValue
-	 */
-	public void setValue(Integer theValue)
-	{
-		setValueCore(theValue);
-	}
-
-	/**
-	 * Set the value of this BooleanDataValue to the given Double value
-	 *
-	 * @param theValue	The value to set this BooleanDataValue to
-	 *
-	 * @return	This BooleanDataValue
-	 */
-	public void setValue(Double theValue)
-	{
-		setValueCore(theValue);
-	}
-
-	/**
-	 * Set the value of this BooleanDataValue to the given Double value
-	 *
-	 * @param theValue	The value to set this BooleanDataValue to
-	 *
-	 * @return	This BooleanDataValue
-	 */
-	public void setValue(Float theValue)
-	{
-		setValueCore(theValue);
 	}
 
 	private void setValueCore(Number theValue)

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLChar.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLChar.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLChar.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLChar.java Tue Feb
 1 16:59:26 2005
@@ -984,79 +984,36 @@
 		setValue(theValue ? "1" : "0");
 	}
 
-	/**
-	 * Set the value of this SQLChar to the given boolean.
-	 *
-	 * @param theValue	The Boolean
-	 *
-	 * @return	This as Boolean
-	 *
-	 */
-	public void setValue(Boolean theValue)  throws StandardException
-	{
-		setValue((Object) theValue);
-	}
-
 	public void setValue(int theValue)  throws StandardException
 	{
 		setValue(Integer.toString(theValue));
 	}
 
-	public void setValue(Integer theValue)  throws StandardException
-	{
-		setValue((Object) theValue);
-	}
-
 	public void setValue(double theValue)  throws StandardException
 	{
 		setValue(Double.toString(theValue));
 	}
 
-	public void setValue(Double theValue)  throws StandardException
-	{
-		setValue((Object) theValue);
-	}
-
 	public void setValue(float theValue)  throws StandardException
 	{
 		setValue(Float.toString(theValue));
 	}
 
-	public void setValue(Float theValue) throws StandardException
-	{
-		setValue((Object) theValue);
-	}
-
 	public void setValue(short theValue)  throws StandardException
 	{
 		setValue(Short.toString(theValue));
 	}
 
-	public void setValue(Short theValue) throws StandardException
-	{
-		setValue((Object) theValue);
-	}
-
 	public void setValue(long theValue)  throws StandardException
 	{
 		setValue(Long.toString(theValue));
 	}
 
-	public void setValue(Long theValue) throws StandardException
-	{
-		setValue((Object) theValue);
-	}
-
 	public void setValue(byte theValue)  throws StandardException
 	{
 		setValue(Byte.toString(theValue));
 	}
 
-	public void setValue(Byte theValue) throws StandardException
-	{
-		setValue((Object) theValue);
-	}
-
 	public void setValue(byte[] theValue) throws StandardException
 	{
 		if (theValue == null)
@@ -1098,9 +1055,13 @@
 		setValue(new String(carray));
 	}
 
-	public void setValue(BigDecimal theValue)  throws StandardException
+	/**
+		Only to be called when an application through JDBC is setting a
+		SQLChar to a java.math.BigDecimal.
+	*/
+	public void setBigDecimal(Number bigDecimal)  throws StandardException
 	{
-		setValue((Object) theValue);
+		setValue((Object) bigDecimal);
 	}
 
 	/** @exception StandardException		Thrown on error */

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java Tue Feb
 1 16:59:26 2005
@@ -215,7 +215,7 @@
 		throwLangSetMismatch("java.sql.Date");
 	}
 	
-	public void setValue(BigDecimal theValue) throws StandardException
+	public void setBigDecimal(Number bigDecimal) throws StandardException
 	{
 		throwLangSetMismatch("java.math.BigDecimal");
 	}

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDecimal.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDecimal.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDecimal.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDecimal.java Tue
Feb  1 16:59:26 2005
@@ -367,7 +367,7 @@
 		if ((theValue instanceof BigDecimal) ||
 			(theValue == null))
 		{
-			setValue((BigDecimal)theValue);
+			setCoreValue((BigDecimal)theValue);
 		}
 		else if (theValue instanceof Number)
 		{
@@ -380,7 +380,7 @@
 	}
 	protected void setFrom(DataValueDescriptor theValue) throws StandardException {
 
-		setValue(theValue.getBigDecimal());
+		setCoreValue(theValue.getBigDecimal());
 	}
 
 	public int	getLength()
@@ -663,12 +663,34 @@
 	}
 
 	/**
-	 * @see NumberDataValue#setValue
-	 *
-	 */
-	public void setValue(BigDecimal theValue)
+		Only to be called when the application sets a value using BigDecimal
+		through setBigDecimal calls.
+	*/
+	public void setBigDecimal(Number theValue) throws StandardException
 	{
-		setCoreValue(theValue);
+		setCoreValue((BigDecimal) theValue);
+	}
+
+	/**
+		Called when setting a DECIMAL value internally or from
+		through a procedure or function.
+		Handles long in addition to BigDecimal to handle
+		identity being stored as a long but returned as a DECIMAL.
+	*/
+	public void setValue(Number theValue) throws StandardException
+	{
+		if (SanityManager.ASSERT)
+		{
+			if (theValue != null &&
+				!(theValue instanceof java.math.BigDecimal) &&
+				!(theValue instanceof java.lang.Long))
+				SanityManager.THROWASSERT("SQLDecimal.setValue(Number) passed a " + theValue.getClass());
+		}
+
+		if (theValue instanceof BigDecimal || theValue == null)
+			setCoreValue((BigDecimal) theValue);
+		else
+			setValue(theValue.longValue());
 	}
 
 	/**
@@ -725,7 +747,7 @@
 		int desiredScale = desiredType.getScale();
 		int desiredPrecision = desiredType.getPrecision();
 
-		setValue(source.getBigDecimal());
+		setCoreValue(source.getBigDecimal());
 		setWidth(desiredPrecision, desiredScale, true);
 	}
 
@@ -764,7 +786,7 @@
 			return result;
 		}
 
-		result.setValue(addend1.getBigDecimal().add(addend2.getBigDecimal()));
+		result.setBigDecimal(addend1.getBigDecimal().add(addend2.getBigDecimal()));
 		return result;
 	}
 
@@ -797,7 +819,7 @@
 			return result;
 		}
 
-		result.setValue(left.getBigDecimal().subtract(right.getBigDecimal()));
+		result.setBigDecimal(left.getBigDecimal().subtract(right.getBigDecimal()));
 		return result;
 	}
 
@@ -830,7 +852,7 @@
 			return result;
 		}
 
-		result.setValue(left.getBigDecimal().multiply(right.getBigDecimal()));
+		result.setBigDecimal(left.getBigDecimal().multiply(right.getBigDecimal()));
 		return result;
 	}
 
@@ -902,7 +924,7 @@
 		** (for the whole result set column, eg.); otherwise dynamically
 		** calculates the scale according to actual values.  Beetle 3901
 		*/
-		result.setValue(dividendBigDecimal.divide(
+		result.setBigDecimal(dividendBigDecimal.divide(
 									divisorBigDecimal,
 									scale > -1 ? scale :
 									Math.max((dividendBigDecimal.scale() + 
@@ -938,7 +960,7 @@
 			return result;
 		}
 
-		result.setValue(getBigDecimal().negate());
+		result.setBigDecimal(getBigDecimal().negate());
 		return result;
 	}
 

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDouble.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDouble.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDouble.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDouble.java Tue
Feb  1 16:59:26 2005
@@ -461,12 +461,33 @@
 		isnull = false;
 	}
 
-	public  void setValue(BigDecimal theValue) throws StandardException
+	public  void setValue(Number theValue) throws StandardException
 	{
 		if (objectNull(theValue)) 
 			return;
 
+		if (SanityManager.ASSERT)
+		{
+			if (!(theValue instanceof java.lang.Double))
+				SanityManager.THROWASSERT("SQLDouble.setValue(Number) passed a " + theValue.getClass());
+		}
+
 		setValue(theValue.doubleValue());
+	}
+
+	/**
+		Called for an application setting this value using a BigDecimal 
+	*/
+	public  void setBigDecimal(Number bigDecimal) throws StandardException
+	{
+		if (objectNull(bigDecimal)) 
+			return;
+
+		// Note BigDecimal.doubleValue() handles the case where
+		// its value is outside the range of a double. It returns
+		// infinity values which should throw an exception in setValue(double).
+		setValue(bigDecimal.doubleValue());
+		
 	}
 
 	/**

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongint.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongint.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongint.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongint.java Tue
Feb  1 16:59:26 2005
@@ -356,6 +356,25 @@
 		}
 	}
 
+	/**
+	 * @see NumberDataValue#setValue
+	 *
+	 * @exception StandardException		Thrown on error
+	 */
+	public final void setValue(Number theValue)
+	{
+		if (objectNull(theValue))
+			return;
+		
+		if (SanityManager.ASSERT)
+		{
+			if (!(theValue instanceof java.lang.Long))
+				SanityManager.THROWASSERT("SQLLongint.setValue(Number) passed a " + theValue.getClass());
+		}
+		
+		setValue(theValue.longValue());
+	}
+
 	public void setValue(long theValue)
 	{
 		value = theValue;

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLReal.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLReal.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLReal.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLReal.java Tue Feb
 1 16:59:26 2005
@@ -398,22 +398,38 @@
 		}
 	}
 
-	public  void setValue(BigDecimal theValue) throws StandardException
+	public  void setValue(Number theValue) throws StandardException
 	{
 		if (objectNull(theValue)) 
 			return;
 
-		float value = theValue.floatValue();
-		setValue(value);
+		if (SanityManager.ASSERT)
+		{
+			if (!(theValue instanceof java.lang.Float))
+				SanityManager.THROWASSERT("SQLReal.setValue(Number) passed a " + theValue.getClass());
+		}
+
+		setValue(theValue.floatValue());
+	}
+	/**
+		Called for an application setting this value using a BigDecimal 
+	*/
+	public  void setBigDecimal(Number bigDecimal) throws StandardException
+	{
+		if (objectNull(bigDecimal)) 
+			return;
+
+		// Note BigDecimal.floatValue() handles the case where
+		// its value is outside the range of a float. It returns
+		// infinity values which should throw an exception in setValue(double).
+		setValue(bigDecimal.floatValue());
+		
 	}
 
 	public void setValue(float theValue)
 		throws StandardException
 	{
-//        new Throwable().printStackTrace();
-//        System.out.println("setValue(float "+theValue+")");
 		value = NumberDataType.normalizeREAL(theValue);
-//        System.out.println("value = "+value);
 		isnull = false;
 	}
 

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/StringDataValue.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/StringDataValue.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/StringDataValue.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/StringDataValue.java
Tue Feb  1 16:59:26 2005
@@ -131,83 +131,6 @@
                                     NumberDataValue result)
                                     throws StandardException;
 
-	/**
-	 * Set the value.
-	 *
-	 * @param theValue	Contains the boolean value to set this to
-	 *
-	 * @return	This value
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public void setValue(Boolean theValue)
-					throws StandardException;
-
-	/**
-	 * Set the value of this StringDataValue to the given int value
-	 *
-	 * @param theValue	The value to set this StringDataValue to
-	 *
-	 * @return	This StringDataValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public void setValue(Integer theValue) throws StandardException;
-
-	/**
-	 * Set the value of this StringDataValue to the given double value
-	 *
-	 * @param theValue	The value to set this StringDataValue to
-	 *
-	 * @return	This StringDataValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public void setValue(Double theValue) throws StandardException;
-
-	/**
-	 * Set the value of this StringDataValue to the given float value
-	 *
-	 * @param theValue	The value to set this StringDataValue to
-	 *
-	 * @return	This StringDataValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public void setValue(Float theValue) throws StandardException;
-
-	/**
-	 * Set the value of this StringDataValue to the given short value
-	 *
-	 * @param theValue	The value to set this StringDataValue to
-	 *
-	 * @return	This StringDataValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public void setValue(Short theValue) throws StandardException;
-
-	/**
-	 * Set the value of this StringDataValue to the given long value
-	 *
-	 * @param theValue	The value to set this StringDataValue to
-	 *
-	 * @return	This StringDataValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public void setValue(Long theValue) throws StandardException;
-
-	/**
-	 * Set the value of this StringDataValue to the given Byte value
-	 *
-	 * @param theValue	The value to set this StringDataValue to
-	 *
-	 * @return	This StringDataValue
-	 *
-	 * @exception StandardException		Thrown on error
-	 */
-	public void setValue(Byte theValue) throws StandardException;
 
 	/**
 	 * Get a char array.  Typically, this is a simple

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/UserType.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/UserType.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/UserType.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/UserType.java Tue Feb
 1 16:59:26 2005
@@ -527,10 +527,10 @@
 	 * @see UserDataValue#setValue
 	 *
 	 */
-	public void setValue(BigDecimal value)
+	public void setBigDecimal(Number theValue)
 	{
 		// needed to allow serializable BigDecimal
-		setValue((Object) value);
+		setValue((Object) theValue);
 	}
 
 	public void setValue(String theValue)

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement20.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement20.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement20.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement20.java
Tue Feb  1 16:59:26 2005
@@ -129,7 +129,7 @@
 		checkStatus();
 		try {
 			/* JDBC is one-based, DBMS is zero-based */
-			getParms().getParameterForSet(parameterIndex - 1).setValue(x);
+			getParms().getParameterForSet(parameterIndex - 1).setBigDecimal(x);
 
 		} catch (Throwable t) {
 			throw EmbedResultSet.noStateChangeException(t);

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java
Tue Feb  1 16:59:26 2005
@@ -55,7 +55,7 @@
 
 abstract class BaseTypeCompiler implements TypeCompiler
 {
-	TypeId correspondingTypeId;
+	private TypeId correspondingTypeId;
 
 	/**
 	 * Get the method name for getting out the corresponding primitive
@@ -110,17 +110,11 @@
 	}
 
 	/** @see TypeCompiler#generateDataValue */
-	public final void generateDataValue(MethodBuilder mb,
+	public void generateDataValue(MethodBuilder mb,
 										LocalField field)
 	{
 		String				interfaceName = interfaceName();
 
-		if (this instanceof UserDefinedTypeCompiler)
-		{
-			// cast the value to an object for method resolution
-			mb.upCast("java.lang.Object");
-		}
-
 		// push the second argument
 
 		/* If fieldName is null, then there is no
@@ -241,11 +235,11 @@
 		if (forDataTypeFunction)
 			retval = retval || 
 				(otherType.isFixedStringTypeId() &&
-				(correspondingTypeId.isFloatingPointTypeId()));
+				(getTypeId().isFloatingPointTypeId()));
 	   
 		retval = retval ||
 			(otherType.isFixedStringTypeId() && 					  
-			 (!correspondingTypeId.isFloatingPointTypeId()));
+			 (!getTypeId().isFloatingPointTypeId()));
 		
 		return retval;
 
@@ -312,7 +306,7 @@
 	 */
 	protected int getStoredFormatIdFromTypeId()
 	{
-		return correspondingTypeId.getTypeFormatId();
+		return getTypeId().getTypeFormatId();
 	}
 
 

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BitTypeCompiler.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BitTypeCompiler.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BitTypeCompiler.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BitTypeCompiler.java
Tue Feb  1 16:59:26 2005
@@ -62,7 +62,7 @@
                                   ClassFactory cf)
 		{
 
-			if (correspondingTypeId.isLongConcatableTypeId() ||
+			if (getTypeId().isLongConcatableTypeId() ||
 				otherType.isLongConcatableTypeId())
 				return false;
 

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CharTypeCompiler.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CharTypeCompiler.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CharTypeCompiler.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CharTypeCompiler.java
Tue Feb  1 16:59:26 2005
@@ -66,7 +66,7 @@
 		{
 				
 			// Long Types cannot be compared
-			if (correspondingTypeId.isLongConcatableTypeId() ||
+			if (getTypeId().isLongConcatableTypeId() ||
 				otherType.isLongConcatableTypeId())
 				return false;
 			
@@ -78,7 +78,7 @@
 			
 			
 			TypeCompiler otherTC = getTypeCompiler(otherType);
-			return (otherType.userType() && otherTC.comparable(correspondingTypeId,
+			return (otherType.userType() && otherTC.comparable(getTypeId(),
 															   forEquals, cf));
 		}
 	
@@ -92,14 +92,14 @@
         {
 			// LONGVARCHAR can only be converted from  character types
 			// or CLOB.
-			if (correspondingTypeId.isLongVarcharTypeId())
+			if (getTypeId().isLongVarcharTypeId())
 			{
 				return (otherType.isStringTypeId());
 			}
 
 			// The double function can convert CHAR and VARCHAR
 			if (forDataTypeFunction && otherType.isDoubleTypeId())
-				return (correspondingTypeId.isStringTypeId());
+				return (getTypeId().isStringTypeId());
 
 			// can't CAST to CHAR and VARCHAR from REAL or DOUBLE
 			// or binary types
@@ -120,7 +120,7 @@
 	 */
 	public boolean compatible(TypeId otherType)
 	{
-		return (otherType.isStringTypeId() || (otherType.isDateTimeTimeStampTypeId() &&
!correspondingTypeId.isLongVarcharTypeId()));
+		return (otherType.isStringTypeId() || (otherType.isDateTimeTimeStampTypeId() &&
!getTypeId().isLongVarcharTypeId()));
 		
 	}
 

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java
Tue Feb  1 16:59:26 2005
@@ -43,6 +43,8 @@
 import org.apache.derby.iapi.reference.ClassName;
 import org.apache.derby.iapi.reference.DB2Limit;
 import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.compiler.LocalField;
+import org.apache.derby.iapi.services.compiler.MethodBuilder;
 
 /**
  * This class implements TypeId for the SQL numeric datatype.
@@ -533,4 +535,18 @@
 		val = Math.min(NumberDataValue.MAX_DECIMAL_PRECISION_SCALE, val);
 		return (int)val;
 	}
+
+
+	public void generateDataValue(MethodBuilder mb,
+										LocalField field)
+	{
+		if (getTypeId().isDecimalTypeId())
+		{
+			// cast the value to an object for method resolution
+			mb.upCast("java.lang.Number");
+		}
+
+		super.generateDataValue(mb, field);
+	}
+
 }

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java
Tue Feb  1 16:59:26 2005
@@ -969,21 +969,22 @@
 
 						boolean isNumericType = paramdtd.getTypeId().isNumericTypeId();
 
+						// is the underlying type for the OUT/INOUT parameter primitive.
+						boolean isPrimitive = ((java.lang.reflect.Method) method).getParameterTypes()[i].getComponentType().isPrimitive();
+
 						if (isNumericType) {
-							if (!paramdtd.getTypeId().isDecimalTypeId()) {
+							// need to up-cast as the setValue(Number) method only exists on NumberDataValue
 
-								if (!((java.lang.reflect.Method) method).getParameterTypes()[i].getComponentType().isPrimitive())
-									mb.cast(ClassName.NumberDataValue);
-							}
+							if (!isPrimitive)
+								mb.cast(ClassName.NumberDataValue);
 						}
 						else if (paramdtd.getTypeId().isBooleanTypeId())
 						{
-							if (!((java.lang.reflect.Method) method).getParameterTypes()[i].getComponentType().isPrimitive())
+							// need to cast as the setValue(Boolean) method only exists on BooleanDataValue
+							if (!isPrimitive)
 								mb.cast(ClassName.BooleanDataValue);
 						}
 
-
-
 						if (paramdtd.getTypeId().variableLength()) {
 							// need another DVD reference for the set width below.
 							mb.dup();
@@ -992,6 +993,13 @@
 
 						mb.getField(lf); // pvs, dvd, array
 						mb.getArrayElement(0); // pvs, dvd, value
+
+						// The value needs to be set thorugh the setValue(Number) method.
+						if (isNumericType && !isPrimitive)
+						{
+							mb.upCast("java.lang.Number");
+						}
+
 						mb.callMethod(VMOpcode.INVOKEINTERFACE, null, "setValue", "void", 1);
 
 						if (paramdtd.getTypeId().variableLength()) {

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UserDefinedTypeCompiler.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UserDefinedTypeCompiler.java?view=diff&r1=149466&r2=149467
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UserDefinedTypeCompiler.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UserDefinedTypeCompiler.java
Tue Feb  1 16:59:26 2005
@@ -31,11 +31,11 @@
 import org.apache.derby.iapi.sql.compile.TypeCompiler;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.services.compiler.LocalField;
+import org.apache.derby.iapi.services.compiler.MethodBuilder;
 
 import org.apache.derby.iapi.reference.ClassName;
 
-import java.sql.Types;
-
 public class UserDefinedTypeCompiler extends BaseTypeCompiler
 {
 	/* TypeCompiler methods */
@@ -147,4 +147,16 @@
 	{
 		return "getNullObject";
 	}
+
+	public void generateDataValue(MethodBuilder mb,
+										LocalField field)
+	{
+		// cast the value to an object for method resolution
+		mb.upCast("java.lang.Object");
+
+		super.generateDataValue(mb, field);
+	}
+
+		
+
 }



Mime
View raw message