| Summary: | ODA Driver can not be used for reporting on models with null attributes | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | John Conlon <jconlon> | ||||||
| Component: | Core | Assignee: | Kenn Hussey <Kenn.Hussey> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | Kenn Hussey <Kenn.Hussey> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | Flags: | Kenn.Hussey:
indigo+
|
||||||
| Version: | unspecified | ||||||||
| Target Milestone: | SR2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
John Conlon
Created attachment 204205 [details]
Checks for nulls
This just checks the values for nulls and just returns the null before attempting any casts.
I don't know all the context, but null should be valid only for EDoubleObject not for EDouble. So if the data can contain null, it really shouldn't be using EDouble as the type but rather EDoubleObject. Same goes for all the primitive types... Yeah, the problem is with cases where we try to "auto box" object types to their primitive counterparts. I'd like to approach the solution a little differently; will attach a patch soon. Created attachment 204218 [details]
proposed changes
Please confirm whether this patch addresses the issues.
Is it correct/intended that for types that do support null (the wrappers for primitive numeric types), you nevertheless convert to a wrapped zero value? If yes, then why not do that for BigDecimal? (In reply to comment #4) > Created attachment 204218 [details] > proposed changes > > Please confirm whether this patch addresses the issues. Yes, this works. (In reply to comment #5) > Is it correct/intended that for types that do support null (the wrappers for > primitive numeric types), you nevertheless convert to a wrapped zero value? If > yes, then why not do that for BigDecimal? For object like BigDecimal, I think that null would be preferred as it seems that BIRT, would just leave a blank in the report. Something one wants if there was no value set in the model. But instead of 0 in the case of Double and the wrapped primitive double should we instead return a NaN if the value was null? (In reply to comment #5) > Is it correct/intended that for types that do support null (the wrappers for > primitive numeric types), you nevertheless convert to a wrapped zero value? If > yes, then why not do that for BigDecimal? For anything that has a primitive return type (rather than a wrapped one), I return the default value for that type in the case of a null value; in all other cases (i.e., where the return type is an object), I return null. (In reply to comment #7) > But instead of 0 in the case of Double and the wrapped primitive double should > we instead return a NaN if the value was null? It seemed better to me to be consistent about how we treat primitive return values for null attributes, i.e., to return the default value for the primitive. I believe clients are expected to use the wasNull() method to determine whether a value ended up the way it is because the source value was null... The fix has been committed to CVS (maintenance and HEAD) and will be available the next builds. Builds (integration and maintenance) containing this fix are now available. |