Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 285108 - Add one BIRT data type: "Java Object"
Summary: Add one BIRT data type: "Java Object"
Status: VERIFIED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.5.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 2.5.1   Edit
Assignee: Wenjie Tu CLA
QA Contact: Tianli Zhang CLA
URL:
Whiteboard: Autoed-All
Keywords:
Depends on:
Blocks: 178897
  Show dependency tree
 
Reported: 2009-07-30 01:08 EDT by Wenjie Tu CLA
Modified: 2010-03-30 01:35 EDT (History)
6 users (show)

See Also:


Attachments
OdaFactory patch to handle DataType.JAVA_OBJECT correctly (1.22 KB, application/octet-stream)
2009-08-26 05:24 EDT, Andreas Mayer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wenjie Tu CLA 2009-07-30 01:08:50 EDT
see https://bugs.eclipse.org/bugs/show_bug.cgi?id=178897, now BIRT wants to add Java Object data type, First needs Model support.
Comment 1 Rick Lu CLA 2009-07-30 01:20:45 EDT
Please list what need to done here and set the dependence.
Comment 2 Lin Zhu CLA 2009-07-30 01:37:57 EDT
Model need to add corresponding data type to computed column, column binding, parameter etc. just similar to that of "String" or other built-in BIRT type support. The new Object reference data type is expecting to be an expansion to built-in BIRT type, and we've done similar things when support Date/Time type in BIRT.
Comment 3 Rick Lu CLA 2009-07-30 01:43:08 EDT
(In reply to comment #2)
> Model need to add corresponding data type to computed column, column binding,
> parameter etc. just similar to that of "String" or other built-in BIRT type
> support. The new Object reference data type is expecting to be an expansion to
> built-in BIRT type, and we've done similar things when support Date/Time type
> in BIRT.
> 

in both data set parameter and report parameter? BTW, do we want to expose this type to BIRT user on UI?
Comment 4 Lin Zhu CLA 2009-07-30 01:45:36 EDT
Yes. Both data set parameter and report parameter.

This new type must expose in UI so that user can define column/binding using this type.
Comment 5 Andreas Mayer CLA 2009-07-30 05:51:50 EDT
(In reply to comment #2)
> Model need to add corresponding data type to computed column, column binding,
> parameter etc. just similar to that of "String" or other built-in BIRT type
> support. The new Object reference data type is expecting to be an expansion to
> built-in BIRT type, and we've done similar things when support Date/Time type
> in BIRT.

Much of this can simply be added to the existing code (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=178897#c3). In addition, the handling of parameters for queries has to be modified, which might have more impact on the existing code base. 

In DataSetRuntime a parameter value can have any type, but ParameterHint only accepts values of type String. Before a query is executed, the parameter values are converted by ParameterUtil.resolveDataSetParameter(boolean), before the queries are executed. DataSourceQuery.getParameterInputValue(ParameterHint) in turn converts the strings back to the corresponding object. This is not suitable for arbitrary types of objects. For example, what should be the textual representation of an object in an EMF-based model? How can I restore that object from the textual representation? 
Comment 6 Yueqian Wang CLA 2009-07-31 03:31:45 EDT
A new data type "Java Object" added in rom.
Now this new type is not allowed for report parameters.
Comment 7 Yueqian Wang CLA 2009-08-02 23:33:12 EDT
Close this bug
Comment 8 Wenjie Tu CLA 2009-08-04 01:42:56 EDT
Now, It's for DtE to continue... 
Comment 9 Wenjie Tu CLA 2009-08-12 04:08:12 EDT
DtE part finished.
Mark it fixed.
Comment 10 Tianli Zhang CLA 2009-08-23 22:35:52 EDT
New Java Object data type is working in 2.5.1 v20090824-0630 build. Further testing is go on, mark this bug as verified first
Comment 11 Andreas Mayer CLA 2009-08-26 05:24:32 EDT
Created attachment 145646 [details]
OdaFactory patch to handle DataType.JAVA_OBJECT correctly

A patch for org.eclipse.birt.report.model.adapter.oda.impl.ODAFactory in plug-in org.eclipse.birt.report.model.adapter.oda, which converts DataType.JAVA_OBJECT to the corresponding DesignChoiceConstants instead of DesignChoiceConstants.COLUMN_DATA_TYPE_STRING and PARAM_TYPE_STRING.
Comment 12 Andreas Mayer CLA 2009-08-26 05:31:43 EDT
(In reply to comment #11)
> Created an attachment (id=145646) [details]
> OdaFactory patch to handle DataType.JAVA_OBJECT correctly

Objects can now be used in columns and parameters. However, DesignSessionUtil.toDataSetParametersDesign() converts DataType.JAVA_OBJECT to "String" instead of "Java Object". It seems that the native data type code is preserved and correctly handled at runtime, but the respective column and parameter types are labeled as "String" instead of "Java Object" in the report designer. The above mentioned patch fixes this.
Comment 13 Rick Lu CLA 2009-08-26 05:35:50 EDT
(In reply to comment #12)
> (In reply to comment #11)
> > Created an attachment (id=145646) [details] [details]
> > OdaFactory patch to handle DataType.JAVA_OBJECT correctly
> 
> Objects can now be used in columns and parameters. However,
> DesignSessionUtil.toDataSetParametersDesign() converts DataType.JAVA_OBJECT to
> "String" instead of "Java Object". It seems that the native data type code is
> preserved and correctly handled at runtime, but the respective column and
> parameter types are labeled as "String" instead of "Java Object" in the report
> designer. The above mentioned patch fixes this.
> 

The patch will be checked in 2.5.1 RC3.