Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 138796 Details for
Bug 178897
Join needs to support object reference joins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Multi-project patch to add support for object column and parameter types
object_type.patch (text/plain), 56.85 KB, created by
Andreas Mayer
on 2009-06-10 10:14:38 EDT
(
hide
)
Description:
Multi-project patch to add support for object column and parameter types
Filename:
MIME Type:
Creator:
Andreas Mayer
Created:
2009-06-10 10:14:38 EDT
Size:
56.85 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.birt.core >Index: src/org/eclipse/birt/core/data/DataType.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.core/src/org/eclipse/birt/core/data/DataType.java,v >retrieving revision 1.13 >diff -u -r1.13 DataType.java >--- src/org/eclipse/birt/core/data/DataType.java 20 Feb 2009 06:30:00 -0000 1.13 >+++ src/org/eclipse/birt/core/data/DataType.java 10 Jun 2009 13:55:21 -0000 >@@ -8,9 +8,9 @@ > * > * Contributors: > * Actuate Corporation - initial API and implementation >- * >+ * > ************************************************************************* >- */ >+ */ > package org.eclipse.birt.core.data; > > import java.math.BigDecimal; >@@ -25,18 +25,19 @@ > public static final int UNKNOWN_TYPE = -1; > public static final int ANY_TYPE = 0; > public static final int BOOLEAN_TYPE = 1; >- public static final int INTEGER_TYPE = 2; >+ public static final int INTEGER_TYPE = 2; > public static final int DOUBLE_TYPE = 3; >- public static final int DECIMAL_TYPE = 4; >+ public static final int DECIMAL_TYPE = 4; > public static final int STRING_TYPE = 5; >- public static final int DATE_TYPE = 6; >+ public static final int DATE_TYPE = 6; > public static final int BLOB_TYPE = 7; > public static final int BINARY_TYPE = 8; > public static final int SQL_DATE_TYPE = 9; > public static final int SQL_TIME_TYPE = 10; >- >- private static final String[] names = >- { >+ public static final int OBJECT_TYPE = 11; >+ >+ private static final String[] names = >+ { > "Any", > "Boolean", > "Integer", >@@ -47,9 +48,10 @@ > "Blob", > "Binary", > "Date", >- "Time" >+ "Time", >+ "Java Object" > }; >- >+ > public static final String ANY_TYPE_NAME = names[0]; > public static final String BOOLEAN_TYPE_NAME = names[1]; > public static final String INTEGER_TYPE_NAME = names[2]; >@@ -61,9 +63,10 @@ > public static final String BINARY_TYPE_NAME = names[8]; > public static final String SQL_DATE_TYPE_NAME = names[9]; > public static final String SQL_TIME_TYPE_NAME = names[10]; >- >- private static final Class[] classes = >- { >+ public static final String JAVA_OBJECT_TYPE_NAME = names[11]; >+ >+ private static final Class[] classes = >+ { > AnyType.class, > Boolean.class, > Integer.class, >@@ -75,8 +78,9 @@ > byte[].class, > java.sql.Date.class, > java.sql.Time.class, >+ Object.class > }; >- >+ > /** > * Gets the description of a data type. > * @param typeCode Data type enumeration value >@@ -89,11 +93,11 @@ > return new String( "Unknown" ); > } > return names[typeCode]; >- } >- >+ } >+ > /** > * Gets the Java class used to represent the specified data type. >- * @return Class for the specified data type. If data type is unknown or ANY, returns null. >+ * @return Class for the specified data type. If data type is unknown or ANY, returns null. > */ > public static Class getClass( int typeCode ) > { >@@ -103,9 +107,9 @@ > } > return classes[typeCode]; > } >- >+ > /** >- * >+ * > * @param objClass > * @return > */ >@@ -120,13 +124,13 @@ > } > return false; > } >- >+ > /** > * Other type can be found in JDK, such as Integer and String, but AnyType >- * have to be manually created to make it correspond to "Any" name. >+ * have to be manually created to make it correspond to "Any" name. > */ > public static final class AnyType > { > }; >- >+ > } >Index: src/org/eclipse/birt/core/data/DataTypeUtil.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.core/src/org/eclipse/birt/core/data/DataTypeUtil.java,v >retrieving revision 1.84 >diff -u -r1.84 DataTypeUtil.java >--- src/org/eclipse/birt/core/data/DataTypeUtil.java 5 Jun 2009 06:27:16 -0000 1.84 >+++ src/org/eclipse/birt/core/data/DataTypeUtil.java 10 Jun 2009 13:55:22 -0000 >@@ -53,18 +53,18 @@ > // we will try to parse it for Locale.US > private static ULocale DEFAULT_LOCALE = ULocale.US; > private static ULocale JRE_DEFAULT_LOCALE = ULocale.getDefault( ); >- >+ > // cache DateFormatter of ICU > private static Map dfMap = new HashMap( ); > private static Map nfMap = new HashMap( ); > // Default Date/Time Style > private static int DEFAULT_DATE_STYLE = DateFormat.FULL; > >- // resource bundle for exception messages >+ // resource bundle for exception messages > public static ResourceBundle resourceBundle = ( new ResourceHandle( JRE_DEFAULT_LOCALE ) ).getUResourceBundle( ); > > public static long count = 0; >- >+ > /** > * convert an object to given type > * Types supported: >@@ -77,6 +77,7 @@ > * DataType.BLOB_TYPE > * DataType.SQL_DATE_TYPE > * DataType.SQL_TIME_TYPE >+ * DataType.OBJECT_TYPE > * @param source > * @param toType > * @return >@@ -86,7 +87,7 @@ > throws BirtException > { > source = JavascriptEvalUtil.convertJavascriptValue( source ); >- >+ > // here we assume the efficiency of if else is higher than switch case > if ( toType == DataType.UNKNOWN_TYPE || toType == DataType.ANY_TYPE ) > return source; >@@ -106,13 +107,15 @@ > case DataType.STRING_TYPE : > return toString( source ); > case DataType.BLOB_TYPE : >- return toBytes( source ); >+ return toBytes( source ); > case DataType.BINARY_TYPE : > return toBytes( source ); > case DataType.SQL_DATE_TYPE: > return toSqlDate( source ); > case DataType.SQL_TIME_TYPE: > return toSqlTime( source ); >+ case DataType.OBJECT_TYPE: >+ return source; > default : > throw new CoreException( ResourceConstants.INVALID_TYPE, > resourceBundle ); >@@ -142,7 +145,7 @@ > { > return source; > } >- >+ > if ( toTypeClass == DataType.getClass( DataType.ANY_TYPE ) ) > return source; > if ( toTypeClass == Integer.class ) >@@ -155,9 +158,9 @@ > return toSqlTime( source ); > if ( toTypeClass == java.sql.Date.class) > return toSqlDate( source ); >- if ( toTypeClass == java.sql.Timestamp.class ) >+ if ( toTypeClass == java.sql.Timestamp.class ) > return toTimestamp( source ); >- if ( toTypeClass == Date.class ) >+ if ( toTypeClass == Date.class ) > return toDate( source ); > if ( toTypeClass == Double.class ) > return toDouble( source ); >@@ -168,9 +171,10 @@ > if ( source instanceof byte[] ) > return source; > else >- return toBlob( source ); >+ return toBlob( source ); > } >- if ( toTypeClass == byte[].class ) >+ if ( toTypeClass == byte[].class || >+ toTypeClass == Object.class ) > return source; > > throw new CoreException( ResourceConstants.INVALID_TYPE, >@@ -180,7 +184,7 @@ > /** > * Boolean -> Integer > * true -> 1 >- * others -> 0 >+ * others -> 0 > * Date -> Integer > * Date.getTime(); > * String -> Integer >@@ -200,7 +204,7 @@ > } > else if ( source instanceof Number ) > { >- // This takes care of BigDecimal, BigInteger, Byte, Double, >+ // This takes care of BigDecimal, BigInteger, Byte, Double, > // Float, Long, Short > if ( !isConvertableToInteger( (Number) source ) ) > { >@@ -252,7 +256,7 @@ > } > return new Integer( number.intValue( )); > } >- >+ > throw new CoreException( ResourceConstants.CONVERT_FAILS, > new Object[]{ > source.toString( ), "Integer" >@@ -279,7 +283,7 @@ > /** > * Boolean -> BigDecimal > * true -> 1 >- * others -> 0 >+ * others -> 0 > * Date -> BigDecimal > * Date.getTime(); > * String -> BigDecimal >@@ -299,7 +303,7 @@ > } > else if ( source instanceof Number ) > { >- // This takes care of BigDecimal, BigInteger, Byte, Double, >+ // This takes care of BigDecimal, BigInteger, Byte, Double, > // Float, Long, Short, Integer > // An intermediate conversion using String is preferrable per JavaDoc > // comment in BigDecimal(String) constructor >@@ -310,7 +314,7 @@ > } > catch ( NumberFormatException e ) > { >- throw new CoreException( >+ throw new CoreException( > ResourceConstants.CONVERT_FAILS, > new Object[]{ > str, "BigDecimal" >@@ -342,7 +346,7 @@ > .parse( (String) source ); > if( number != null ) > return new BigDecimal( number.toString( ) ); >- >+ > throw new CoreException( ResourceConstants.CONVERT_FAILS, > new Object[]{ > source.toString( ), "BigDecimal" >@@ -424,7 +428,7 @@ > } > else > { >- throw new CoreException( >+ throw new CoreException( > ResourceConstants.CONVERT_FAILS, > new Object[]{ > source.toString( ), "Boolean" >@@ -436,7 +440,7 @@ > * Number -> Date > * new Date((long)Number) > * String -> Date >- * toDate(String) >+ * toDate(String) > * @param source > * @return > * @throws BirtException >@@ -463,9 +467,9 @@ > }); > } > } >- >+ > /** >- * >+ * > * @param source > * @return > * @throws BirtException >@@ -477,7 +481,7 @@ > return null; > return new Timestamp( date.getTime( )); > } >- >+ > /** > * Date -> Time > * String -> Time >@@ -508,7 +512,7 @@ > } > catch ( Exception e1 ) > { >- >+ > } > } > } >@@ -521,7 +525,7 @@ > } > > /** >- * >+ * > * @param value > * @return > */ >@@ -534,7 +538,7 @@ > int firstColon; > int secondColon; > int marker; >- >+ > if ( s == null ) > throw new java.lang.IllegalArgumentException( ); > >@@ -584,12 +588,12 @@ > second = Integer.parseInt( s.substring( secondColon + 1 ) ); > if( second < 0 || second > 60 ) > throw new java.lang.IllegalArgumentException( ); >- >+ > return toSqlTime( hour, minute, second ); > } >- >+ > /** >- * >+ * > * @param hour > * @param minute > * @param second >@@ -604,9 +608,9 @@ > calendar.set( Calendar.SECOND, second ); > return new java.sql.Time( calendar.getTimeInMillis( ) ); > } >- >+ > /** >- * >+ * > * @param c > * @return > */ >@@ -616,9 +620,9 @@ > return true; > return false; > } >- >+ > /** >- * >+ * > * @param date > * @return > */ >@@ -632,7 +636,7 @@ > calendar.set( Calendar.DAY_OF_MONTH, 1 ); > return new java.sql.Time( calendar.getTimeInMillis( ) ); > } >- >+ > /** > * Date -> Time > * String -> Time >@@ -663,7 +667,7 @@ > } > catch ( Exception e1 ) > { >- >+ > } > } > } >@@ -674,9 +678,9 @@ > source.toString( ), "java.sql.Date" > } ); > } >- >+ > /** >- * >+ * > * @param date > * @return > */ >@@ -688,14 +692,14 @@ > calendar.set( Calendar.HOUR_OF_DAY, 0 ); > calendar.set( Calendar.MINUTE, 0 ); > calendar.set( Calendar.SECOND, 0 ); >- calendar.set( Calendar.MILLISECOND, 0 ); >+ calendar.set( Calendar.MILLISECOND, 0 ); > return new java.sql.Date( calendar.getTimeInMillis( ) ); > } >- >+ > /** > * A temp solution to the adoption of ICU4J to BIRT. Simply delegate > * toDate( String, Locale) method. >- * >+ * > * @param source > * the String to be convert > * @param locate >@@ -710,7 +714,7 @@ > > /** > * convert String with the specified locale to java.util.Date >- * >+ * > * @param source > * the String to be convert > * @param locate >@@ -722,9 +726,9 @@ > { > return toDate( source, locale, null ); > } >- >+ > /** >- * >+ * > * @param source > * @param locale > * @param timeZone >@@ -739,7 +743,7 @@ > > DateFormat dateFormat = null; > Date resultDate = null; >- >+ > boolean existTime = source.matches( ".*[0-9]+:[0-9]+:[0-9]+.*" ) > || source.matches( ".*[0-9]+:[0-9]+.*" ); > >@@ -748,7 +752,7 @@ > for ( int j = DEFAULT_DATE_STYLE; j <= DateFormat.SHORT; j++ ) > { > dateFormat = DateFormatFactory.getDateTimeInstance( i, j, locale ); >- TimeZone savedTimeZone = null; >+ TimeZone savedTimeZone = null; > if( timeZone != null ) > { > savedTimeZone = dateFormat.getTimeZone( ); >@@ -762,18 +766,18 @@ > catch ( ParseException e1 ) > { > } >- finally >+ finally > { > if( savedTimeZone != null ) > dateFormat.setTimeZone( savedTimeZone ); > } > } > >- // only Date, no Time >+ // only Date, no Time > if ( !existTime ) > { > dateFormat = DateFormatFactory.getDateInstance( i, locale ); >- TimeZone savedTimeZone = null; >+ TimeZone savedTimeZone = null; > if( timeZone != null ) > { > savedTimeZone = dateFormat.getTimeZone( ); >@@ -787,7 +791,7 @@ > catch ( ParseException e1 ) > { > } >- finally >+ finally > { > if( savedTimeZone != null ) > dateFormat.setTimeZone( savedTimeZone ); >@@ -798,7 +802,7 @@ > // for the String can not be parsed, throws a BirtException > if ( resultDate == null ) > { >- throw new CoreException( >+ throw new CoreException( > ResourceConstants.CONVERT_FAILS, > new Object[]{ > source.toString( ), "Date" >@@ -811,7 +815,7 @@ > > /** > * Convert a string to a Date instance according to the TimeZone value >- * >+ * > * @param source > * @param timeZone > * @return >@@ -838,11 +842,11 @@ > } > } > } >- >+ > /** > * A temp solution to the adoption of ICU4J in BIRT. It is a simple > * delegation to toDateWithCheck( String, Locale ). >- * >+ * > * @param source > * @param locale > * @return Date >@@ -863,7 +867,7 @@ > * in DateFormat.SHORT case instead of all cases. > * Year is not lower than 0. > * Month is from 1 to 12. >- * Day is from 1 to 31. >+ * Day is from 1 to 31. > * @param source > * @param locale > * @return Date >@@ -887,7 +891,7 @@ > // check whether conversion is correct > if ( DateUtil.checkValid( dateFormat, source ) == false ) > { >- throw new CoreException( >+ throw new CoreException( > ResourceConstants.CONVERT_FAILS, > new Object[]{ > source.toString( ), "Date" >@@ -900,7 +904,7 @@ > /** > * Boolean -> Double > * true -> 1 >- * others -> 0 >+ * others -> 0 > * Date -> Double > * Date.getTime(); > * String -> Double >@@ -964,7 +968,7 @@ > } > return new Double( number.doubleValue( )); > } >- >+ > throw new CoreException( ResourceConstants.CONVERT_FAILS, > new Object[]{ > source.toString( ), "Double" >@@ -989,7 +993,7 @@ > } > } > >- >+ > /** > * Number -> String > * Number.toString() >@@ -1021,7 +1025,7 @@ > > /** > * Convert an object to an locale neutral String value. For Date values we will convert to ISO8601 format. >- * >+ * > * @param source > * @return > * @throws BirtException >@@ -1050,12 +1054,12 @@ > { > return ((Number) source).toString( ); > } >- else >+ else > { > return toLimitedSizeString( source ); > } > } >- >+ > /** > * Number -> String > * Number.toString() >@@ -1092,14 +1096,14 @@ > { > return toString( (Number) source, locale ); > } >- else >+ else > { > return toLimitedSizeString( source ); > } > } > > /** >- * >+ * > * @param source > * @return > */ >@@ -1131,7 +1135,7 @@ > } > > /** >- * >+ * > * @param source > * @param locale > * @return >@@ -1153,7 +1157,7 @@ > } > return nf.format( source ); > } >- >+ > /** > * Converting Blob to/from other types is not currently supported > * @param source >@@ -1227,7 +1231,7 @@ > > /** > * Converts a Java class to its corresponding data type constant >- * defined in DataType >+ * defined in DataType > */ > public static int toApiDataType( Class clazz ) > { >@@ -1263,14 +1267,14 @@ > else if ( clazz == Boolean.class ) > return DataType.BOOLEAN_TYPE; > else if ( clazz == Object.class ) >- return DataType.STRING_TYPE; >+ return DataType.OBJECT_TYPE; > > // any other types are not recognized nor supported; > return DataType.UNKNOWN_TYPE; > } > > /** >- * Converts an ODA data type code to its >+ * Converts an ODA data type code to its > * corresponding Data Engine API data type constant > * defined in DataType. > * @param odaDataTypeCode an ODA data type code >@@ -1284,7 +1288,7 @@ > } > > /** >- * Convert object to a suitable type from its value >+ * Convert object to a suitable type from its value > * Object -> Integer -> Double -> BigDecimal -> Date -> String > */ > public static Object toAutoValue( Object evaValue ) >@@ -1331,7 +1335,7 @@ > } > > /** >- * convert object to Integer. If fails, return null. >+ * convert object to Integer. If fails, return null. > * Object -> Integer > */ > public static Integer toIntegerValue( Object evaValue ) >@@ -1376,7 +1380,7 @@ > /** > * Convert String without specified locale to java.util.Date > * Try to format the given String for JRE default Locale, >- * if it fails, try to format the String for Locale.US >+ * if it fails, try to format the String for Locale.US > * @param source > * the String to be convert > * @param locate >@@ -1406,7 +1410,7 @@ > > /** > * convert String with ISO8601 date format to java.util.Date >- * >+ * > * @param source > * the String to be convert > * @param locate >@@ -1424,7 +1428,7 @@ > } > catch ( ParseException e1 ) > { >- throw new CoreException( >+ throw new CoreException( > ResourceConstants.CONVERT_FAILS, > new Object[]{ > source.toString( ), "Date" >@@ -1434,7 +1438,7 @@ > > /** > * Call org.eclipse.birt.core.format.DateFormatter >- * >+ * > * @param source > * @return > */ >@@ -1477,7 +1481,7 @@ > * JavaObject -> java.lang.Object<br> > * </i> > * @param odaDataTypeCode an ODA data type code >- * @return the ODI type class that corresponds with >+ * @return the ODI type class that corresponds with > * the specified ODA data type > * @throws BirtException if the specified ODA data type is not a supported type > */ >@@ -1556,7 +1560,7 @@ > } > > /** >- * Converts an ODI type class to its corresponding >+ * Converts an ODI type class to its corresponding > * ODA data type code. <br> > * <b>ODI Type Class -> ODA Data Type</b><br> > * <i>java.lang.Integer -> Integer<br> >@@ -1597,7 +1601,7 @@ > else if ( odiTypeClass == java.sql.Date.class ) > odaType = Types.DATE; > else if ( odiTypeClass == java.util.Date.class ) >- odaType = Types.TIMESTAMP; >+ odaType = Types.TIMESTAMP; > else if ( odiTypeClass == Blob.class ) > odaType = Types.BLOB; > else if ( odiTypeClass == Clob.class ) >@@ -1609,23 +1613,23 @@ > > return odaType; > } >- >+ > private static boolean isConvertableToInteger( Number n ) > { > assert n != null; >- >+ > long longValue = n.longValue( ); > return longValue >= Integer.MIN_VALUE && longValue <= Integer.MAX_VALUE; >- >+ > } >- >+ > private static boolean isConvertableToDouble( Number n ) > { > assert n != null; >- >+ > double doubleValue = n.doubleValue( ); > return !Double.isInfinite( doubleValue ); >- >+ > } > } > >#P org.eclipse.birt.report.model >Index: src/org/eclipse/birt/report/model/api/util/DataTypeConvertUtil.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/util/DataTypeConvertUtil.java,v >retrieving revision 1.1 >diff -u -r1.1 DataTypeConvertUtil.java >--- src/org/eclipse/birt/report/model/api/util/DataTypeConvertUtil.java 10 Nov 2008 07:01:43 -0000 1.1 >+++ src/org/eclipse/birt/report/model/api/util/DataTypeConvertUtil.java 10 Jun 2009 13:55:26 -0000 >@@ -25,7 +25,7 @@ > * Returns the corresponding parameter type choice with the given column > * data type. The column data type values are defined in > * <code>DesignChoiceConstants</code> can be one of the followings: >- * >+ * > * <ul> > * <li><code>COLUMN_DATA_TYPE_BOOLEAN</code> > * <li><code>COLUMN_DATA_TYPE_DATETIME</code> >@@ -36,8 +36,8 @@ > * <li><code>COLUMN_DATA_TYPE_INTEGER</code> > * <li><code>COLUMN_DATA_TYPE_STRING</code> > * </ul> >- * >- * >+ * >+ * > * @param columnType > * the column data type > * @return the parameter type >@@ -62,7 +62,9 @@ > || DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER > .equals( columnType ) > || DesignChoiceConstants.COLUMN_DATA_TYPE_STRING >- .equals( columnType ) ) >+ .equals( columnType ) >+ || DesignChoiceConstants.COLUMN_DATA_TYPE_OBJECT >+ .equals( columnType ) ) > return DataTypeConversionUtil.converToParamType( columnType ); > > return columnType; >@@ -72,7 +74,7 @@ > * Returns the corresponding column data type choice with the given > * parameter type. The column data type values are defined in > * <code>DesignChoiceConstants</code> can be one of the followings: >- * >+ * > * <ul> > * <li><code>PARAM_TYPE_BOOLEAN</code> > * <li><code>PARAM_TYPE_DATETIME</code> >@@ -83,7 +85,7 @@ > * <li><code>PARAM_TYPE_INTEGER</code> > * <li><code>PARAM_TYPE_STRING</code> > * </ul> >- * >+ * > * @param paramType > * the parameter type > * @return the column data type >@@ -101,7 +103,8 @@ > || DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals( paramType ) > || DesignChoiceConstants.PARAM_TYPE_FLOAT.equals( paramType ) > || DesignChoiceConstants.PARAM_TYPE_INTEGER.equals( paramType ) >- || DesignChoiceConstants.PARAM_TYPE_STRING.equals( paramType ) ) >+ || DesignChoiceConstants.PARAM_TYPE_STRING.equals( paramType ) >+ || DesignChoiceConstants.PARAM_TYPE_OBJECT.equals( paramType )) > return DataTypeConversionUtil.converToColumnDataType( paramType ); > > return paramType; >Index: src/org/eclipse/birt/report/model/elements/rom.def >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/elements/rom.def,v >retrieving revision 1.422 >diff -u -r1.422 rom.def >--- src/org/eclipse/birt/report/model/elements/rom.def 9 Jun 2009 07:33:57 -0000 1.422 >+++ src/org/eclipse/birt/report/model/elements/rom.def 10 Jun 2009 13:55:28 -0000 >@@ -187,6 +187,7 @@ > <Choice displayNameID="Choices.paramType.integer" name="integer"/> > <Choice displayNameID="Choices.paramType.date" name="date"/> > <Choice displayNameID="Choices.paramType.time" name="time"/> >+ <Choice displayNameID="Choices.paramType.javaObject" name="javaObject"/> > </ChoiceType> > <ChoiceType name="paramValueType"> > <Choice displayNameID="Choices.paramValueType.static" name="static"/> >@@ -394,6 +395,8 @@ > <Choice displayNameID="Choices.columnDataType.date" name="date"/> > <Choice displayNameID="Choices.columnDataType.time" name="time"/> > <Choice displayNameID="Choices.columnDataType.blob" name="blob"/> >+ <Choice displayNameID="Choices.columnDataType.javaObject" name="javaObject"/> >+ > <!-- not supported now > <Choice displayNameID="Choices.columnDataType.structure" name="structure"/> > <Choice displayNameID="Choices.columnDataType.table" name="table"/> >Index: src/org/eclipse/birt/report/model/i18n/Messages.properties >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/i18n/Messages.properties,v >retrieving revision 1.349 >diff -u -r1.349 Messages.properties >--- src/org/eclipse/birt/report/model/i18n/Messages.properties 9 Jun 2009 07:33:58 -0000 1.349 >+++ src/org/eclipse/birt/report/model/i18n/Messages.properties 10 Jun 2009 13:55:30 -0000 >@@ -118,6 +118,7 @@ > Choices.paramType.any=Any > Choices.paramType.date=Date > Choices.paramType.time=Time >+Choices.paramType.javaObject=Java Object > > #6.paramControl > Choices.paramControl.text-box=Text Box >@@ -429,6 +430,7 @@ > Choices.columnDataType.time=Time > Choices.columnDataType.date=Date > Choices.columnDataType.blob=Blob >+Choices.columnDataType.javaObject=Java Object > > #54. searchType > Choices.searchType.any=Any >@@ -1871,7 +1873,7 @@ > Structure.HighlightRule.border.right.color=Color > Structure.HighlightRule.background.color=Background Color > Structure.HighlightRule.format.dateTime=Date Time Format >-Structure.HighlightRule.format.number= NumbervFormat >+Structure.HighlightRule.format.number=Number Format > Structure.HighlightRule.format.number.align=Number Alignment > Structure.HighlightRule.format.string=String Format > Structure.HighlightRule.font.family=Font >Index: src/org/eclipse/birt/report/model/util/DataTypeConversionUtil.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/util/DataTypeConversionUtil.java,v >retrieving revision 1.4 >diff -u -r1.4 DataTypeConversionUtil.java >--- src/org/eclipse/birt/report/model/util/DataTypeConversionUtil.java 23 Oct 2007 08:45:56 -0000 1.4 >+++ src/org/eclipse/birt/report/model/util/DataTypeConversionUtil.java 10 Jun 2009 13:55:30 -0000 >@@ -17,7 +17,7 @@ > /** > * The utility class to convert values between parameter type choices and column > * data type choices. >- * >+ * > */ > > public class DataTypeConversionUtil >@@ -26,7 +26,7 @@ > /** > * Returns the corresponding parameter type choice with the given column > * data type. >- * >+ * > * @param columnType > * the column data type > * @return the parameter type >@@ -58,6 +58,8 @@ > return DesignChoiceConstants.PARAM_TYPE_STRING; > if ( DesignChoiceConstants.COLUMN_DATA_TYPE_BLOB.equals( columnType ) ) > return DesignChoiceConstants.PARAM_TYPE_ANY; >+ if ( DesignChoiceConstants.COLUMN_DATA_TYPE_OBJECT.equals( columnType ) ) >+ return DesignChoiceConstants.PARAM_TYPE_OBJECT; > > return columnType; > } >@@ -65,7 +67,7 @@ > /** > * Returns the corresponding column data type choice with the given > * parameter type. >- * >+ * > * @param paramType > * the parameter type > * @return the column data type >@@ -94,6 +96,8 @@ > return DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER; > if ( DesignChoiceConstants.PARAM_TYPE_STRING.equals( paramType ) ) > return DesignChoiceConstants.COLUMN_DATA_TYPE_STRING; >+ if ( DesignChoiceConstants.PARAM_TYPE_OBJECT.equals( paramType ) ) >+ return DesignChoiceConstants.COLUMN_DATA_TYPE_OBJECT; > > return paramType; > } >Index: src/org/eclipse/birt/report/model/api/elements/DesignChoiceConstants.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/elements/DesignChoiceConstants.java,v >retrieving revision 1.66 >diff -u -r1.66 DesignChoiceConstants.java >--- src/org/eclipse/birt/report/model/api/elements/DesignChoiceConstants.java 20 May 2009 02:52:58 -0000 1.66 >+++ src/org/eclipse/birt/report/model/api/elements/DesignChoiceConstants.java 10 Jun 2009 13:55:26 -0000 >@@ -14,7 +14,7 @@ > /** > * This class collects commonly-used choice constants. These constants define > * the internal value of choices for several property choice constants. >- * >+ * > * @see ReportDesignConstants > */ > >@@ -24,9 +24,9 @@ > // fontFamily > > public static final String CHOICE_FONT_FAMILY = "fontFamily"; //$NON-NLS-1$ >- public static final String FONT_FAMILY_SERIF = "serif"; //$NON-NLS-1$ >- public static final String FONT_FAMILY_SANS_SERIF = "sans-serif"; //$NON-NLS-1$ >- public static final String FONT_FAMILY_CURSIVE = "cursive"; //$NON-NLS-1$ >+ public static final String FONT_FAMILY_SERIF = "serif"; //$NON-NLS-1$ >+ public static final String FONT_FAMILY_SANS_SERIF = "sans-serif"; //$NON-NLS-1$ >+ public static final String FONT_FAMILY_CURSIVE = "cursive"; //$NON-NLS-1$ > public static final String FONT_FAMILY_FANTASY = "fantasy"; //$NON-NLS-1$ > public static final String FONT_FAMILY_MONOSPACE = "monospace"; //$NON-NLS-1$ > >@@ -257,6 +257,7 @@ > public static final String PARAM_TYPE_DATETIME = "dateTime"; //$NON-NLS-1$ > public static final String PARAM_TYPE_BOOLEAN = "boolean"; //$NON-NLS-1$ > public static final String PARAM_TYPE_INTEGER = "integer"; //$NON-NLS-1$ >+ public static final String PARAM_TYPE_OBJECT = "javaObject"; //$NON-NLS-1$ > /** > * @deprecated Now any is not supported. > */ >@@ -459,7 +460,7 @@ > public static final String FORMAT_TYPE_REPORTLET = "reportlet"; //$NON-NLS-1$ > public static final String FORMAT_TYPE_EXCEL = "excel"; //$NON-NLS-1$ > public static final String FORMAT_TYPE_WORD = "word"; //$NON-NLS-1$ >- public static final String FORMAT_TYPE_POWERPOINT = "powerpoint"; //$NON-NLS-1$ >+ public static final String FORMAT_TYPE_POWERPOINT = "powerpoint"; //$NON-NLS-1$ > public static final String FORMAT_TYPE_DOC = "doc"; //$NON-NLS-1$ > /** > * ImageRefType -- The image reference type. The first constant is the name >@@ -517,6 +518,7 @@ > public static final String COLUMN_DATA_TYPE_DATE = "date";//$NON-NLS-1$ > public static final String COLUMN_DATA_TYPE_TIME = "time";//$NON-NLS-1$ > public static final String COLUMN_DATA_TYPE_BLOB = "blob";//$NON-NLS-1$ >+ public static final String COLUMN_DATA_TYPE_OBJECT = "javaObject";//$NON-NLS-1$ > > /** > * searchType -- The search type for column hint The first constant is the >@@ -618,7 +620,7 @@ > */ > > public static final String CHOICE_NUMBER_FORMAT_TYPE = "numberFormat"; //$NON-NLS-1$ >- public static final String NUMBER_FORMAT_TYPE_UNFORMATTED = "Unformatted"; //$NON-NLS-1$ >+ public static final String NUMBER_FORMAT_TYPE_UNFORMATTED = "Unformatted"; //$NON-NLS-1$ > public static final String NUMBER_FORMAT_TYPE_GENERAL_NUMBER = "General Number"; //$NON-NLS-1$ > public static final String NUMBER_FORMAT_TYPE_CURRENCY = "Currency"; //$NON-NLS-1$ > public static final String NUMBER_FORMAT_TYPE_FIXED = "Fixed"; //$NON-NLS-1$ >@@ -677,8 +679,8 @@ > public static final String STRING_FORMAT_TYPE_UPPERCASE = ">"; //$NON-NLS-1$ > public static final String STRING_FORMAT_TYPE_LOWERCASE = "<"; //$NON-NLS-1$ > public static final String STRING_FORMAT_TYPE_CUSTOM = "Custom"; //$NON-NLS-1$ >- public static final String STRING_FORMAT_TYPE_ZIP_CODE = "Zip Code"; //$NON-NLS-1$ >- public static final String STRING_FORMAT_TYPE_ZIP_CODE_4 = "Zip Code + 4"; //$NON-NLS-1$ >+ public static final String STRING_FORMAT_TYPE_ZIP_CODE = "Zip Code"; //$NON-NLS-1$ >+ public static final String STRING_FORMAT_TYPE_ZIP_CODE_4 = "Zip Code + 4"; //$NON-NLS-1$ > public static final String STRING_FORMAT_TYPE_PHONE_NUMBER = "Phone Number"; //$NON-NLS-1$ > public static final String STRING_FORMAT_TYPE_SOCIAL_SECURITY_NUMBER = "Social Security Number"; //$NON-NLS-1$ > >@@ -818,7 +820,7 @@ > public static final String AGGREGATION_FUNCTION_IS_TOP_N = "is-top-n"; //$NON-NLS-1$ > public static final String AGGREGATION_FUNCTION_IS_BOTTOM_N = "is-bottom-n"; //$NON-NLS-1$ > public static final String AGGREGATION_FUNCTION_IS_TOP_N_PERCENT = "is-top-n-percent"; //$NON-NLS-1$ >- public static final String AGGREGATION_FUNCTION_IS_BOTTOM_N_PERCENT = "is-bottom-n-percent"; //$NON-NLS-1$ >+ public static final String AGGREGATION_FUNCTION_IS_BOTTOM_N_PERCENT = "is-bottom-n-percent"; //$NON-NLS-1$ > public static final String AGGREGATION_FUNCTION_PERCENT_RANK = "percent-rank"; //$NON-NLS-1$ > public static final String AGGREGATION_FUNCTION_PERCENTILE = "percentile"; //$NON-NLS-1$ > public static final String AGGREGATION_FUNCTION_TOP_QUARTILE = "quartile"; //$NON-NLS-1$ >@@ -939,7 +941,7 @@ > > /** > * Choice constants for workMode. >- * >+ * > */ > public static final String CHOICE_VARIABLE_TYPE = "variableType"; //$NON-NLS-1$ > public static final String VARIABLE_TYPE_REPORT = "report"; //$NON-NLS-1$ >#P org.eclipse.birt.report.data.adapter >Index: src/org/eclipse/birt/report/data/adapter/api/DataAdapterUtil.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/DataAdapterUtil.java,v >retrieving revision 1.34 >diff -u -r1.34 DataAdapterUtil.java >--- src/org/eclipse/birt/report/data/adapter/api/DataAdapterUtil.java 31 May 2009 10:03:37 -0000 1.34 >+++ src/org/eclipse/birt/report/data/adapter/api/DataAdapterUtil.java 10 Jun 2009 13:55:33 -0000 >@@ -59,7 +59,7 @@ > } > > /** >- * register model aggregation function names with build-in function names >+ * register model aggregation function names with build-in function names > */ > private static void registerAggregationFunction( ) > { >@@ -122,7 +122,7 @@ > aggrAdapterMap.put( DesignChoiceConstants.AGGREGATION_FUNCTION_RANK, > IBuildInAggregation.TOTAL_RANK_FUNC ); > } >- >+ > /** > * register model filter operator with dte's IConditionalExpression operator > */ >@@ -177,11 +177,11 @@ > /** > * This method is used to register the Java Script Objects which are defined in the scope of > * source ResultSet ( might be IResultSet or CubeCursor ) to target scope. One possible client >- * of this method is Report Engine. A classic use case is that instead of register its own "row" object >+ * of this method is Report Engine. A classic use case is that instead of register its own "row" object > * the Report Engine can simply call this method with proper argument so that the "row" object > * registered in IResultIterator's scope, that is, JSResultSetRow, can be accessed by engine using >- * engine scope. >- * >+ * engine scope. >+ * > * @param targetScope > * @param source > */ >@@ -205,7 +205,7 @@ > scope ) ); > } > } >- >+ > /** > * Adapts a Model data type (string) to Data Engine data type constant > * (integer) on column >@@ -234,9 +234,12 @@ > return DataType.BOOLEAN_TYPE; > if ( modelDataType.equals( DesignChoiceConstants.COLUMN_DATA_TYPE_BLOB ) ) > return DataType.BLOB_TYPE; >+ if ( modelDataType.equals( DesignChoiceConstants.COLUMN_DATA_TYPE_OBJECT ) ) >+ return DataType.OBJECT_TYPE; >+ > return DataType.UNKNOWN_TYPE; > } >- >+ > /** > * @param type: a Data Engine data type > * @return Data Engine data types compatible with <code>type</code>, including <code>type</code> itself >@@ -256,8 +259,8 @@ > return new int[]{ DataType.DECIMAL_TYPE, DataType.DOUBLE_TYPE, DataType.INTEGER_TYPE }; > case DataType.STRING_TYPE: > return new int[]{ DataType.STRING_TYPE, DataType.BOOLEAN_TYPE, >- DataType.DECIMAL_TYPE, DataType.DOUBLE_TYPE, DataType.INTEGER_TYPE, >- DataType.DATE_TYPE, DataType.BLOB_TYPE, DataType.BINARY_TYPE, >+ DataType.DECIMAL_TYPE, DataType.DOUBLE_TYPE, DataType.INTEGER_TYPE, >+ DataType.DATE_TYPE, DataType.BLOB_TYPE, DataType.BINARY_TYPE, > DataType.SQL_DATE_TYPE, DataType.SQL_TIME_TYPE }; > case DataType.DATE_TYPE: > return new int[]{ DataType.DATE_TYPE, DataType.SQL_DATE_TYPE, DataType.SQL_TIME_TYPE }; >@@ -265,6 +268,8 @@ > return new int[]{ DataType.BLOB_TYPE }; > case DataType.BINARY_TYPE: > return new int[]{ DataType.BINARY_TYPE }; >+ case DataType.OBJECT_TYPE: >+ return new int[]{ DataType.OBJECT_TYPE }; > case DataType.SQL_DATE_TYPE: > return new int[]{ DataType.SQL_DATE_TYPE, DataType.DATE_TYPE }; > case DataType.SQL_TIME_TYPE: >@@ -273,7 +278,7 @@ > throw new AdapterException( ResourceConstants.INVALID_DATA_TYPE, type ); > } > } >- >+ > /** > * Adapter dte's data type to model data type > * @param apiDataType >@@ -299,12 +304,14 @@ > return DesignChoiceConstants.COLUMN_DATA_TYPE_BOOLEAN; > else if ( apiDataType == DataType.BLOB_TYPE ) > return DesignChoiceConstants.COLUMN_DATA_TYPE_BLOB; >+ else if ( apiDataType == DataType.OBJECT_TYPE ) >+ return DesignChoiceConstants.COLUMN_DATA_TYPE_OBJECT; > > return DesignChoiceConstants.COLUMN_DATA_TYPE_ANY; > } >- >+ > /** >- * >+ * > * @param modelAggrType > * @return > * @throws AdapterException >@@ -315,11 +322,11 @@ > Object o = aggrAdapterMap.get( modelAggrType ); > return o == null ? modelAggrType : o.toString( ); > } >- >+ > /** > * This method is used to adapter model filter's operator into dte's > * operator >- * >+ * > * @param modelOpr > * @return > */ >@@ -331,12 +338,12 @@ > else > return IConditionalExpression.OP_NONE; > } >- >+ > /** > * Get the rollup aggregation name. If the function is TOTAL_AVE_FUNC, > * TOTAL_COUNT_FUNC, or TOTAL_COUNT_DISTINCT_FUNC, return TOTAL_SUM_FUNC as > * measure function name >- * >+ * > * @param functionName > * @return > */ >@@ -360,10 +367,10 @@ > else > return func; > } >- >+ > /** > * This method is used to adapter model sort direction into dte's direction. >- * >+ * > * @param dir > * @return > */ >@@ -372,9 +379,9 @@ > return DesignChoiceConstants.SORT_DIRECTION_DESC.equals( modelSortDir ) > ? ISortDefinition.SORT_DESC : ISortDefinition.SORT_ASC; > } >- >+ > /** >- * >+ * > * @param type > * @return > */ >@@ -399,9 +406,9 @@ > typeNum = DataType.INTEGER_TYPE; > return typeNum; > } >- >+ > /** >- * >+ * > * @param dteDTName > * @return > */ >@@ -430,9 +437,9 @@ > modelDataType = DesignChoiceConstants.PARAM_TYPE_TIME; > return modelDataType; > } >- >+ > /** >- * >+ * > * @param name > * @return > */ >@@ -442,10 +449,10 @@ > ? org.eclipse.birt.data.aggregation.impl.Constants.EXPRESSION_NAME > : name; > } >- >+ > /** > * Get the parameter value from .rptconfig file if it does exist >- * >+ * > * @return Object[] the parameter value > */ > public static Object getParamValueFromConfigFile( ScalarParameterHandle paramHandle ) >@@ -463,8 +470,8 @@ > String reportConfigName = designFileName.substring( 0, index + 1 ) > + "rptconfig"; > final File file = new File( reportConfigName ); >- >- >+ >+ > if ( AccessController.doPrivileged( new PrivilegedAction<Boolean>() > { > public Boolean run() >@@ -529,7 +536,7 @@ > { > try > { >- return DataTypeUtil.convert( >+ return DataTypeUtil.convert( > values.get( 0 ), DataAdapterUtil.modelDataTypeToCoreDataType( parameterHandle.getDataType() ) ); > } > catch ( BirtException e ) >@@ -537,12 +544,12 @@ > return null; > } > } >- >+ > try { > Object[] reValues = new Object[values.size()]; > for (int i = 0; i < reValues.length; i++) > { >- reValues[i] = DataTypeUtil.convert( >+ reValues[i] = DataTypeUtil.convert( > values.get(i), DataAdapterUtil.modelDataTypeToCoreDataType(parameterHandle.getDataType())); > } > return reValues; >@@ -559,7 +566,7 @@ > > /** > * Delete the last "_" part >- * >+ * > * @param name > * @return String > */ >@@ -571,7 +578,7 @@ > > /** > * Checks whether the parameter value is null in the rptconfig file >- * >+ * > * @param varName > * @param varValue > * @param newParaName >@@ -583,23 +590,23 @@ > return varName.toLowerCase( ).startsWith( "__isnull" ) > && varValue.equals( newParaName ); > } >- >+ > private static class JSResultIteratorObject extends ScriptableObject > { > /** >- * >+ * > */ > private static final long serialVersionUID = 684728008759347940L; > private ILinkedResult it; > private IResultIterator currentIterator; >- >+ > JSResultIteratorObject( ILinkedResult it ) > { > this.it = it; > if ( it.getCurrentResultType( ) == ILinkedResult.TYPE_TABLE ) > this.currentIterator = (IResultIterator) it.getCurrentResult( ); > } >- >+ > public String getClassName( ) > { > return "JSResultIteratorObject"; >#P org.eclipse.birt.report.model.adapter.oda >Index: src/org/eclipse/birt/report/model/adapter/oda/impl/ODAFactory.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.model.adapter.oda/src/org/eclipse/birt/report/model/adapter/oda/impl/ODAFactory.java,v >retrieving revision 1.7 >diff -u -r1.7 ODAFactory.java >--- src/org/eclipse/birt/report/model/adapter/oda/impl/ODAFactory.java 7 Oct 2008 03:04:31 -0000 1.7 >+++ src/org/eclipse/birt/report/model/adapter/oda/impl/ODAFactory.java 10 Jun 2009 13:55:36 -0000 >@@ -27,7 +27,7 @@ > > /* > * (non-Javadoc) >- * >+ * > * @see > * org.eclipse.birt.report.model.adapter.oda.api.IODAFactory#getUpdatedDataType > * (java.lang.String, java.lang.String, int, java.lang.String, >@@ -99,6 +99,8 @@ > return DesignChoiceConstants.COLUMN_DATA_TYPE_BOOLEAN; > case DataType.BLOB_TYPE : > return DesignChoiceConstants.COLUMN_DATA_TYPE_BLOB; >+ case DataType.OBJECT_TYPE : >+ return DesignChoiceConstants.COLUMN_DATA_TYPE_OBJECT; > case DataType.BINARY_TYPE : > case DataType.ANY_TYPE : > default : >@@ -126,6 +128,8 @@ > return DesignChoiceConstants.PARAM_TYPE_FLOAT; > case DataType.BOOLEAN_TYPE : > return DesignChoiceConstants.PARAM_TYPE_BOOLEAN; >+ case DataType.OBJECT_TYPE : >+ return DesignChoiceConstants.PARAM_TYPE_OBJECT; > case DataType.ANY_TYPE : > case DataType.BLOB_TYPE : > case DataType.BINARY_TYPE : >@@ -136,7 +140,7 @@ > > /** > * Converts DTE api data type to ROM defined data type. >- * >+ * > * @param choiceName > * the ROM choice to map > * @param apiDataType >@@ -163,7 +167,7 @@ > > /** > * Checks whether the oda data type is compaible with rom data type. >- * >+ * > * @param romDataType > * the rom data type in string > * @param odaDataTypeCode >#P org.eclipse.birt.data >Index: src/org/eclipse/birt/data/engine/odaconsumer/ParameterHint.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/odaconsumer/ParameterHint.java,v >retrieving revision 1.10 >diff -u -r1.10 ParameterHint.java >--- src/org/eclipse/birt/data/engine/odaconsumer/ParameterHint.java 25 Aug 2007 03:57:39 -0000 1.10 >+++ src/org/eclipse/birt/data/engine/odaconsumer/ParameterHint.java 10 Jun 2009 13:55:37 -0000 >@@ -10,7 +10,7 @@ > * Actuate Corporation - initial API and implementation > * > ****************************************************************************** >- */ >+ */ > > package org.eclipse.birt.data.engine.odaconsumer; > >@@ -26,7 +26,7 @@ > import org.eclipse.datatools.connectivity.oda.IClob; > > /** >- * <code>ParameterHint</code> provides hints to map static >+ * <code>ParameterHint</code> provides hints to map static > * parameter definitions to runtime parameters. > */ > public class ParameterHint >@@ -42,8 +42,8 @@ > private boolean m_isInputMode; > private boolean m_isOutputMode; > private boolean m_isNullable; >- >- private static final int UNKNOWN_NATIVE_TYPE = 0; >+ >+ private static final int UNKNOWN_NATIVE_TYPE = 0; > > // trace logging variables > private static String sm_className = ParameterHint.class.getName(); >@@ -55,7 +55,7 @@ > * @param parameterName the parameter name. > * @param isInputMode whether this is an input parameter. > * @param isOutputMode whether this is an output parameter. >- * @throws IllegalArgumentException if the parameter name is null or >+ * @throws IllegalArgumentException if the parameter name is null or > * empty. > */ > public ParameterHint( String parameterName, boolean isInputMode, boolean isOutputMode ) >@@ -64,24 +64,24 @@ > if( sm_logger.isLoggingEnterExitLevel() ) > sm_logger.entering( sm_className, methodName, > new Object[] { parameterName, new Boolean( isInputMode ), new Boolean( isOutputMode ) } ); >- >+ > if( parameterName == null || parameterName.length() == 0 ) > { >- String localizedMessage = >+ String localizedMessage = > DataResourceHandle.getInstance().getMessage( ResourceConstants.PARAMETER_NAME_CANNOT_BE_EMPTY_OR_NULL ); >- >- sm_logger.logp( Level.SEVERE, sm_className, methodName, >+ >+ sm_logger.logp( Level.SEVERE, sm_className, methodName, > "The given parameter is null or empty." ); //$NON-NLS-1$ > throw new IllegalArgumentException( localizedMessage ); > } >- >+ > m_name = parameterName; > m_isInputMode = isInputMode; > m_isOutputMode = isOutputMode; >- >+ > m_isInputOptional = true; > m_isNullable = true; >- >+ > sm_logger.exiting( sm_className, methodName, this ); > } > >@@ -93,39 +93,39 @@ > { > return m_name; > } >- >+ > /** > * Sets the parameter 1-based position for this parameter hint. > * @param position the 1-based position of the parameter. >- * @throws IllegalArgumentException if the parameter position is less >+ * @throws IllegalArgumentException if the parameter position is less > * than 1. > */ > public void setPosition( int position ) > { > final String methodName = "setPosition( int )"; //$NON-NLS-1$ >- >+ > if( position < 1 ) > { >- String localizedMessage = >+ String localizedMessage = > DataResourceHandle.getInstance().getMessage( ResourceConstants.PARAMETER_POSITION_CANNOT_BE_LESS_THAN_ONE ); >- sm_logger.logp( Level.SEVERE, sm_className, methodName, >+ sm_logger.logp( Level.SEVERE, sm_className, methodName, > "Invalid parameter position {0} ", new Integer( position ) ); //$NON-NLS-1$ > throw new IllegalArgumentException( localizedMessage ); > } >- >+ > m_position = position; > } >- >+ > /** > * Returns the parameter 1-based position for this parameter hint. >- * @return the 1-based position of the parameter; 0 if no position was >+ * @return the 1-based position of the parameter; 0 if no position was > * specified. > */ > public int getPosition() > { > return m_position; > } >- >+ > /** > * Sets the data type for this parameter hint. > * @param dataType the data type of the parameter. >@@ -134,11 +134,11 @@ > public void setDataType( Class dataType ) > { > final String methodName = "setDataType( Class )"; //$NON-NLS-1$ >- >+ > // validate given data type; > // data type for a hint may be null > boolean isValid = false; >- if( dataType == null || >+ if( dataType == null || > dataType == Integer.class || > dataType == Double.class || > dataType == String.class || >@@ -149,34 +149,35 @@ > dataType == Timestamp.class || > dataType == IBlob.class || > dataType == IClob.class || >- dataType == Boolean.class ) >+ dataType == Boolean.class || >+ dataType == Object.class) > { > isValid = true; > } >- >+ > // input parameter does not support Blob/Clob data type > if( isValid && isInputMode() && dataType != null ) > { >- if( dataType == IBlob.class || >+ if( dataType == IBlob.class || > dataType == IClob.class ) > { > isValid = false; > } > } >- >+ > if( isValid == false ) > { >- String localizedMessage = >+ String localizedMessage = > DataResourceHandle.getInstance().getMessage( ResourceConstants.UNSUPPORTED_PARAMETER_VALUE_TYPE, > new Object[]{ dataType } ); >- sm_logger.logp( Level.SEVERE, sm_className, methodName, >+ sm_logger.logp( Level.SEVERE, sm_className, methodName, > "Invalid parameter data type {0}.", dataType ); //$NON-NLS-1$ > throw new IllegalArgumentException( localizedMessage ); > } >- >+ > m_dataType = dataType; > } >- >+ > /** > * Returns the parameter ODI data type specified in this parameter hint. > * Note that this may not be the most effective data type to use. >@@ -208,9 +209,9 @@ > { > return m_nativeDataType; > } >- >+ > /** >- * Sets whether the input parameter is optional. Has >+ * Sets whether the input parameter is optional. Has > * no effect on non-input parameters. > * @param isInputOptional whether this input parameter is optional. > */ >@@ -219,18 +220,18 @@ > if( m_isInputMode ) > m_isInputOptional = isInputOptional; > } >- >+ > /** >- * Returns whether the input parameter is optional. Returns true >+ * Returns whether the input parameter is optional. Returns true > * for non-input parameters. >- * @return true if the input parameter is optional or if this is a >+ * @return true if the input parameter is optional or if this is a > * non-input parameter, false otherwise. > */ > public boolean isInputOptional() > { > return ( m_isInputMode ) ? m_isInputOptional : true; > } >- >+ > /** > * Sets whether the parameter can be null. > * @param isNullable whether this parameter can be null. >@@ -239,7 +240,7 @@ > { > m_isNullable = isNullable; > } >- >+ > /** > * Returns whether the parameter can be null. > * @return true if the parameter can be null, false otherwise. >@@ -248,9 +249,9 @@ > { > return m_isNullable; > } >- >+ > /** >- * Sets the default value of the input parameter. Has no effect on >+ * Sets the default value of the input parameter. Has no effect on > * non-input parameters. > * @param defaultInputValue the default value. > */ >@@ -259,18 +260,18 @@ > if( m_isInputMode ) > m_defaultInputValue = defaultInputValue; > } >- >+ > /** >- * Gets the default vlaue of the input parameter. Returns null for >+ * Gets the default vlaue of the input parameter. Returns null for > * non-input parameters. >- * @return the default value of the input parameter, or null for >+ * @return the default value of the input parameter, or null for > * non-input parameters. > */ > public String getDefaultInputValue() > { > return ( m_isInputMode ) ? m_defaultInputValue : null; > } >- >+ > /** > * Returns whether the parameter is an input parameter. > * @return true if the parameter is an input parameter, false otherwise. >@@ -291,17 +292,17 @@ > > /** > * Sets the native name of the parameter as known to the underlying data source. >- * @param nativeName The native name to set; may be a null value if the name >+ * @param nativeName The native name to set; may be a null value if the name > * is not available or this parameter is not named. > */ > public void setNativeName( String nativeName ) > { > m_nativeName = nativeName; > } >- >+ > /** > * Returns the native name of the parameter as known to the underlying data source. >- * @return the parameter native name, or >+ * @return the parameter native name, or > * null if the name is not available or this parameter is not named. > */ > public String getNativeName() >@@ -310,7 +311,7 @@ > } > > /** >- * Sets hether this parameter allows binding with multiple input values. >+ * Sets hether this parameter allows binding with multiple input values. > * Has no effect on non-input parameters. > * @param isMultiInputValuesAllowed true if multiple input values are allowed; > * false if at most a single input value is allowed. >@@ -333,7 +334,7 @@ > } > > /** >- * Helper method to update this <code>ParameterHint</code> with >+ * Helper method to update this <code>ParameterHint</code> with > * information from another <code>ParameterHint</code>. > * @param hint the <code>ParameterHint</code> instance. > */ >@@ -343,7 +344,7 @@ > sm_logger.entering( sm_className, methodName, hint ); > > m_name = hint.m_name; >- >+ > // don't update if the specified hint has default values > > if( hint.m_nativeName != null ) >@@ -351,13 +352,13 @@ > > if( hint.m_position != 0 ) > m_position = hint.m_position; >- >+ > if( hint.m_dataType != null ) > m_dataType = hint.m_dataType; >- >+ > if( hint.m_nativeDataType != UNKNOWN_NATIVE_TYPE ) > m_nativeDataType = hint.m_nativeDataType; >- >+ > m_isInputOptional = hint.m_isInputOptional; > m_defaultInputValue = hint.m_defaultInputValue; > m_isInputMode = hint.m_isInputMode; >@@ -366,30 +367,30 @@ > > sm_logger.exiting( sm_className, methodName, this ); > } >- >+ > /** > * Returns the most effective ODI data type defined in the hint. > * It determines the best type to use based on the native data type defined. > * @param odaDataSourceId underlying ODA driver's data source id that defines > * the native data type mappings >- * @param dataSetType type of data set; may be null >+ * @param dataSetType type of data set; may be null > * if the oda data source has only one type of data set > * @return the most effective ODI data type to use > */ > public Class getEffectiveDataType( String odaDataSourceId, String dataSetType ) > { >- return DataTypeUtil.toTypeClass( >+ return DataTypeUtil.toTypeClass( > getEffectiveOdaType( odaDataSourceId, dataSetType ) ); > } >- >+ > int getEffectiveOdaType( String odaDataSourceId, String dataSetType ) > { > /* The BIRT DtE ODI data type specified in a parameter hint may be based on >- * what an user manually entered in BIRT host designer, and was not necessarily >+ * what an user manually entered in BIRT host designer, and was not necessarily > * validated against an underlying ODA driver. > * Whereas, the native data type in hint, if available, is provided by >- * a custom ODA designer. It is thus a more reliable type to use in a retry. >- * So we first try to use the native data type for the effective ODA data type. >+ * a custom ODA designer. It is thus a more reliable type to use in a retry. >+ * So we first try to use the native data type for the effective ODA data type. > */ > if( getNativeDataType() != UNKNOWN_NATIVE_TYPE ) > { >@@ -399,10 +400,10 @@ > if( odaType != Types.NULL ) > return odaType; // found valid native to oda type mapping > } >- >- // no native data type mapping info, use the BIRT DtE ODI API data type instead >+ >+ // no native data type mapping info, use the BIRT DtE ODI API data type instead > Class typeInHint = getDataType(); > return DataTypeUtil.toOdaType( typeInHint ); > } >- >+ > } >Index: src/org/eclipse/birt/data/engine/executor/ResultClassHelper.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor/ResultClassHelper.java,v >retrieving revision 1.1 >diff -u -r1.1 ResultClassHelper.java >--- src/org/eclipse/birt/data/engine/executor/ResultClassHelper.java 28 Jul 2006 09:38:04 -0000 1.1 >+++ src/org/eclipse/birt/data/engine/executor/ResultClassHelper.java 10 Jun 2009 13:55:37 -0000 >@@ -41,7 +41,7 @@ > } > > /** >- * >+ * > * @throws DataException > */ > private void initIndex( ) throws DataException >@@ -52,9 +52,9 @@ > { > Class valueClass = resultClass.getFieldValueClass( i + 1 ); > assert valueClass != null; >- if ( valueClass.isAssignableFrom( IClob.class ) ) >+ if ( IClob.class.isAssignableFrom( valueClass ) ) > clobIndexList.add( new Integer( i ) ); >- else if ( valueClass.isAssignableFrom( IBlob.class ) ) >+ else if ( IBlob.class.isAssignableFrom( valueClass ) ) > blobIndexList.add( new Integer( i ) );; > } > clobIndex = toIntArray( clobIndexList ); >@@ -64,7 +64,7 @@ > } > > /** >- * >+ * > * @param integerList > * @return > */ >@@ -77,9 +77,9 @@ > } > return reArray; > } >- >+ > /** >- * >+ * > * @return > */ > boolean hasClobOrBlob( ) >@@ -88,7 +88,7 @@ > } > > /** >- * >+ * > * @return > */ > int[] getClobIndexArray( ) >@@ -97,12 +97,12 @@ > } > > /** >- * >+ * > * @return > */ > int[] getBlobIndexArray( ) > { > return blobIndex; > } >- >+ > } >Index: src/org/eclipse/birt/data/engine/olap/data/util/DataType.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/util/DataType.java,v >retrieving revision 1.5 >diff -u -r1.5 DataType.java >--- src/org/eclipse/birt/data/engine/olap/data/util/DataType.java 7 Nov 2007 08:29:42 -0000 1.5 >+++ src/org/eclipse/birt/data/engine/olap/data/util/DataType.java 10 Jun 2009 13:55:37 -0000 >@@ -16,7 +16,7 @@ > import java.util.Date; > > /** >- * >+ * > */ > > public class DataType >@@ -33,7 +33,7 @@ > public static final int BYTES_TYPE = 102; > public static final int SQL_DATE_TYPE = org.eclipse.birt.core.data.DataType.SQL_DATE_TYPE; > public static final int SQL_TIME_TYPE = org.eclipse.birt.core.data.DataType.SQL_TIME_TYPE; >- >+ > > private static final String[] names = { > "Boolean", >@@ -87,7 +87,7 @@ > > /** > * Gets the description of a data type. >- * >+ * > * @param typeCode > * Data type enumeration value > * @return Textual description of data type. "Unknown" if an undefined data >@@ -111,7 +111,7 @@ > > /** > * Gets the Java class used to represent the specified data type. >- * >+ * > * @return Class for the specified data type. If data type is unknown or > * ANY, returns null. > */ >@@ -132,7 +132,7 @@ > } > > /** >- * >+ * > * @param objClass > * @return > */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 178897
: 138796