Skip to main content

XML Mapping Files

  • Chapter
  • First Online:
Book cover Pro JPA 2 in Java EE 8

Abstract

Back in the early days, after the release of Java SE 5, there was a quiet, and sometimes not-so-quiet, debate about whether annotations were better or worse than XML. The defenders of annotations vigorously proclaimed how annotations are so much simpler and provide in-lined metadata that is co-located with the code that it is describing. The claim was that this avoids the need to replicate the information that is inherent in the source code context of where the metadata applies. The XML proponents then retorted that annotations unnecessarily couple the metadata to the code, and that changes to metadata should not require changes to the source code.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Technically, there is a description element in many of the elements, just as there are in most of the standard schemas in Java EE, but they have little functional value and will not be mentioned here. They might be of some use to tools that parse XML schemas and use the descriptions for tooltips and similar actions.

  2. 2.

    It is possible, and even probable, that vendors will process the mapping files in the order that they are listed, but this is neither required nor standardized.

  3. 3.

    Some have argued that these kinds of tuning exercises are precisely why XML should be used to begin with.

  4. 4.

    The provider may pick one at random or throw an exception at startup time and disallow it altogether.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Mike Keith, Merrick Schincariol, Massimo Nardone

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Keith, M., Schincariol, M., Nardone, M. (2018). XML Mapping Files. In: Pro JPA 2 in Java EE 8. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3420-4_13

Download citation

Publish with us

Policies and ethics