Mirror of Apache Olingo
Go to file
Adrian Görler 932af8fb5d [OLINGO-1408] Support new date time API (#57)
* Fix usage of Calendar in tests

The tests use Calendar instances. For some test cases the time zone of a
Calendar instance is changed and then passed to the valueToString
method.

Unfortunately after just changing the time zone the Calendar only
changes the time zone but not the value of the calculated fields like
YEAR, MONTH, ... . These fields are recalculated only if they are read
by get(YEAR), get(MONTH), ... . The implementation of valueToString
clones the Calendar instance before fields are computed resulting in
a corrupt clone.

This change

1) makes sure that the test the fields in the Calendar instances used
   in the tests are computed
2) makes sure that the valueToString method triggers a computation of
the fields before cloning the Calendar

* Support types of new Date/Time API

The types of the new Date/Time API can now be used as property values.

The following mappings are now supported

EdmDateTimeOffset
- java.time.Instant
- java.time.ZonedDateTime
- java.util.Calendar
- java.util.Date
- java.sql.Timestamp
- java.lang.Long

EdmDate
- java.time.LocalDate
- java.sql.Date

EdmTimeOfDay
- java.time.LocalTime
- java.sql.Time

Only these mappings capture the semantics correctly.

For legacy reasons also supported are the following mappings are still
supported:

EdmDate
- java.util.Calendar (date component in the TZ of the calendar)
- java.util.Date     (date component in UTC)
- java.sql.Timestamp (date component in UTC)
- java.lang.Long     (date component in UTC)

EdmTimeOfDay
- java.util.Calendar (time component in the TZ of the calendar)
- java.util.Date     (time component in UTC)
- java.sql.Timestamp (time component in UTC)
- java.lang.Long     (time component in UTC)

For legacy reasons the default mapping types are unchanged (and remain
semantically incorrect):

EdmDateTimeOffset -> java.sql.Timestamp
EdmDate           -> java.util.Calendar
EdmTimeOfDay      -> java.util.Calendar

* Allow additional (but semantically wrong) conversions

EdmDate -> java.util.Date, java.sql.Timestamp
EdmTimeOfDay -> java.util.Date, java.sql.Timestamp
2019-11-25 19:32:58 +01:00
dist [OLINGO-1352] Set 4.7.0-SNAPSHOT as development version 2019-05-05 08:12:19 +02:00
ext [OLINGO-1410] Better XMLMetadata parsing 2019-11-25 09:34:41 +01:00
fit [OLINGO-1410] Better XMLMetadata parsing 2019-11-25 09:34:41 +01:00
lib [OLINGO-1408] Support new date time API (#57) 2019-11-25 19:32:58 +01:00
samples [OLINGO-1352] Set 4.7.0-SNAPSHOT as development version 2019-05-05 08:12:19 +02:00
src [OLINGO-1391]OData V4: Move the olingo library to java 8 2019-09-04 09:17:51 +05:30
.gitignore [OLINGO-344] introduce shade plugin 2014-07-21 14:43:24 +02:00
LICENSE [OLINGO-362] OAuth2 supporting abstract class provided + concrete CXF-based IT 2014-07-16 10:05:04 +02:00
NOTICE [OLINGO-1171] Set 4.4.0-RC01 version 2017-08-29 09:58:49 +02:00
README [OLINGO-362] OAuth2 supporting abstract class provided + concrete CXF-based IT 2014-07-16 10:05:04 +02:00
pom.xml [OLINGO-1407] Updated dependency versions 2019-11-12 19:45:32 +01:00

README

==========================
Apache Olingo
==========================

Apache Olingo is a Java library and extensions around
the OData specification.

Apache Olingo supports the specification versions
 - OData 4.0 <http://www.odata.org/documentation/odata-version-4-0/>

Building Apache Olingo
======================

You can build Apache Olingo like this:

    mvn clean install

You need Maven 3 with Java 6 (or higher) for the build.
Set the environment variable MAVEN_OPTS to 
'-Xmx1024m -XX:MaxPermSize=256m' to give Maven more memory.

Documentation
=============

The project documentation is available here:

http://olingo.apache.org/

License (see also package specific LICENSE files)
=================================================

Collective work: Copyright 2014 The Apache Software Foundation.

Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Dependencies with "Weak Copyleft" or dual licenses
==================================================

Apache Olingo uses some libraries with open source licenses that require reciprocal
licensing when modified. These libraries are included in unmodified binary
form and can be redistributed under terms that are compatible with the
Apache License.

Some libraries used by Apache Olingo are dual-licensed under different open source
licenses. These libraries are redistributed under the license whose terms
are compatible with the Apache License.

See LICENSE file included in all Apache Olingo packages for 
full licensing details.