[
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14949947#comment-14949947
]
Ralf Handl commented on OLINGO-793:
-----------------------------------
Hi Ramesh,
The definition of Scale for decimals originates from [Decimal-Scale], which
defines the default scale to be 0.
Instead of breaking with this tradition we introduced Scale="variable" to
indicate an unknown/variable number of fractional digits. If you combine this
with unspecified Precision, you actually have no restriction on the decimal
data that property can contain.
The Precision of temporal properties is similar to Scale for decimals, so for
consistency we defined a default of 0, too.
Changing the default of Scale to variable/unspecified and doing the same for
the Precision of temporal values would have been another option, and the next
logical step would have been to use Precision consistently for the number of
fractional digits across all data types, thus inverting its meaning for decimal
values, and using MaxLength instead for the length of the decimal mantissa. But
that seemed a rather radical change, although it would have been the most
consistent approach :-)
Thanks!
--Ralf
[Decimal-Scale] https://msdn.microsoft.com/en-us/library/dd541612.aspx
[Decimal-Precision] https://msdn.microsoft.com/en-us/library/dd541430.aspx
[DateTimeOffset-Precision]
https://msdn.microsoft.com/en-us/library/dd541481.aspx
> Precision on EdmDateTimeOffset should be optional
> -------------------------------------------------
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
> Issue Type: Bug
> Components: odata4-commons
> Affects Versions: (Java) V4 4.0.0
> Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional
> facet that can be defined. However the code [2] fails with
> IllegalArgumentException is it found to be null.
> [1]
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2]
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)