Fix 2.0 for Bug 404069 - MOXy should not append .0 to time info for dateTime and time formats + unit test (#1403)

This new feature optionally add suffix/decimal part to time part/seconds in case of conversion from supported date/time formats into String. This suffix is controlled by new "org.eclipse.persistence.xml.time.suffix" system property.
It happens only if source time doesn't contain fraction of seconds and for XML, JSON conversion. E.g.:
For -Dorg.eclipse.persistence.xml.time.suffix=.0
Source value: 2003-08-29T03:00:00-04:00 -> Output string: 2003-08-29T03:00:00.0-04:00
Source value: 1975-02-21T07:47:15 -> Output string: 1975-02-21T07:47:15.0

In case of fraction of seconds in the input behavior is still same e.g.:
Source value: 1975-02-21T07:47:15.123 -> Output string: 1975-02-21T07:47:15.123

It simplifies migration from WebLogic Server 11g to 12c.
Signed-off-by: Radek Felcman <radek.felcman@oracle.com>
7 files changed
tree: c3497aa1fd02d3a099ba14ba92b3bb4dded5db1b
  1. .github/
  2. bundles/
  3. dbws/
  4. etc/
  5. features/
  6. foundation/
  7. jpa/
  8. moxy/
  9. performance/
  10. project-admin/
  11. sdo/
  12. src/
  13. testing/
  14. utils/
  15. .gitattributes
  16. .gitignore
  17. .lgtm.yml
  18. CONTRIBUTING.md
  19. findbugs-exclude.xml
  20. LICENSE.md
  21. NOTICE.md
  22. pom.xml
  23. README.md
  24. SECURITY.md
README.md

Language grade: Java Total alerts

EclipseLink master (3.1.x) Maven Central Jakarta Staging (Snapshots) Master Build Status

EclipseLink 3.0.0 Maven Central 3.0 Build Status

EclipseLink 2.7.x Maven Central 2.7.x  Build Status

EclipseLink

The EclipseLink project's goal is to provide a complete persistence framework that is both comprehensive and universal. It will run in any Java environment and read and write objects to virtually any type of data source, including relational databases, XML, JSON, or EIS systems. EclipseLink will focus on providing leading edge support, including advanced feature extensions, for the dominant persistence standards for each target data source; Jakarta Persistence for relational databases, Jakarta XML Binding for XML, Jakarta Connectors for EIS and other types of legacy systems, and Service Data Objects (SDO).

This project is part of the EclipseLink project.

License

EclipseLink is dual licensed under an EPL 2.0 and EDL 1.0 license.

Contributing

We use contribution policy, which means we can only accept contributions under the terms of Eclipse Contributor Agreement.

Links

Issue/bug trackers

Hint: If it‘s possible, it helps if some test reproducer is attached to the new bug. If it’s not possible, attached entities and persistence.xml file should help too for JPA related bugs. For MOXy, entities and XML or JSON resources/files are welcome.