Skip to main content

2015 | OriginalPaper | Buchkapitel

5. Many-to-One and One-to-One Mapping

verfasst von : Joseph Ottinger, Srinivas Guruzu, Gary Mak

Erschienen in: Hibernate Recipes

Verlag: Apress

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

In general, entities are related or associated to each other. For example, a Customer entity is associated with an Address entity. A Customer entity can have one or more than one Address entity (for example, Billing and Shipping). These relationships or associations are represented differently in a relational model and the domain/object model.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Fußnoten
1
Or, as discussed in Chapter 3, we could have holiday contact addresses, too, which much be a really nice problem to have to address, so to speak.
 
2
There are multiple tools available to help generate a model, including Hibernate Tools ( http://hibernate.org/tools/ ), which is supported and maintained by the Hibernate team.
 
3
Why Book1 and not Book? We may reuse this object model in other recipes in this chapter, and we don’t want collisions. We could use namespaces to help, but this naming convention means that we don’t have to try to avoid collisions; they’re avoided by default, at the cost of the names being a touch silly.
 
4
Clearly, this example is entirely fabricated and has no bearing on what happens with actual books.
 
5
Apparently only one person is allowed to live at any given address in this model. Thankfully, it is only an example.
 
6
Trust us, this makes sense. If it is confusing, it is because one-to-one relationships like this should be fairly rare.
 
Metadaten
Titel
Many-to-One and One-to-One Mapping
verfasst von
Joseph Ottinger
Srinivas Guruzu
Gary Mak
Copyright-Jahr
2015
Verlag
Apress
DOI
https://doi.org/10.1007/978-1-4842-0127-5_5