mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-06-04 14:13:18 +00:00
docs: Content SEO updates (#2990)
* update yaml frontmatter format * update abstract document * update abstract factory * use the new pattern template * acyclic visitor seo * adapter seo * ambassador seo * acl seo * aaa seo * async method invocation seo * balking seo * bridge seo * builder seo * business delegate and bytecode seo * caching seo * callback seo * chain seo * update headings * circuit breaker seo * client session + collecting parameter seo * collection pipeline seo * combinator SEO * command seo * cqrs seo * commander seo * component seo * composite seo * composite entity seo * composite view seo * context object seo * converter seo * crtp seo * currying seo * dao seo * data bus seo * data locality seo * data mapper seo * dto seo * decorator seo * delegation seo * di seo * dirty flag seo * domain model seo * double buffer seo * double checked locking seo * double dispatch seo * dynamic proxy seo * event aggregator seo * event-based asynchronous seo * eda seo * event queue seo * event sourcing seo * execute around seo * extension objects seo * facade seo * factory seo * factory kit seo * factory method seo * fanout/fanin seo * feature toggle seo * filterer seo * fluent interface seo * flux seo * flyweight seo * front controller seo * function composition seo * game loop seo * gateway seo * guarded suspension seo * half-sync/half-async seo * health check seo * hexagonal seo * identity map seo * intercepting filter seo * interpreter seo * iterator seo * layers seo * lazy loading seo * leader election seo * leader/followers seo * lockable object seo * rename and add seo for marker interface * master-worker seo * mediator seo * memento seo * metadata mapping seo * microservice aggregator seo * api gw seo * microservices log aggregration seo * mvc seo * mvi seo * mvp seo * mvvm seo * monad seo * monitor seo * monostate seo * multiton seo * mute idiom seo * naked objects & notification seo * null object seo * object mother seo * object pool seo * observer seo * optimistic locking seo * page controller seo * page object seo * parameter object seo * partial response seo * pipeline seo * poison pill seo * presentation model seo * private class data seo * producer-consumer seo * promise seo * property seo * prototype seo * proxy seo * queue-based load leveling seo * reactor seo * registry seo * repository seo * RAII seo * retry seo * role object seo * saga seo * separated interface seo * serialized entity seo * serialized lob seo * servant seo * server session seo * service layer seo * service locator seo * service to worker seo * sharding seo * single table inheritance seo * singleton seo * spatial partition seo * special case seo * specification seo * state seo * step builder seo * strangler seo * strategy seo * subclass sandbox seo * table module seo * template method seo * throttling seo * tolerant reader seo * trampoline seo * transaction script seo * twin seo * type object seo * unit of work seo * update method seo * value object seo * version number seo * virtual proxy seo * visitor seo * seo enhancements * seo improvements * SEO enhancements * SEO improvements * SEO additions * SEO improvements * more SEO improvements * rename hexagonal + SEO improvements * SEO improvements * more SEO stuff * SEO improvements * SEO optimizations * SEO enhancements * enchance SEO * improve SEO * SEO improvements * update headers
This commit is contained in:
+18
-16
@@ -1,19 +1,21 @@
|
||||
---
|
||||
title: Metadata Mapping
|
||||
title: "Metadata Mapping Pattern in Java: Bridging Objects and Data Stores Seamlessly"
|
||||
shortTitle: Metadata Mapping
|
||||
description: "Explore the Metadata Mapping Design Pattern for managing the mapping between database records and objects in Java applications. Learn implementation with Hibernate, use cases, benefits, and best practices."
|
||||
category: Data access
|
||||
language: en
|
||||
tag:
|
||||
- Decoupling
|
||||
- Enterprise patterns
|
||||
- Object mapping
|
||||
- Persistence
|
||||
- Decoupling
|
||||
- Enterprise patterns
|
||||
- Object mapping
|
||||
- Persistence
|
||||
---
|
||||
|
||||
## Intent
|
||||
## Intent of Metadata Mapping Design Pattern
|
||||
|
||||
Metadata Mapping is designed to manage the mapping between database records and objects in a way that keeps the database schema and object model decoupled and manageable.
|
||||
Metadata Mapping Design Pattern is designed to manage the mapping between database records and Java objects in a way that keeps the database schema and object model decoupled and manageable.
|
||||
|
||||
## Explanation
|
||||
## Detailed Explanation of Metadata Mapping Pattern with Real-World Examples
|
||||
|
||||
Real-world example
|
||||
|
||||
@@ -27,7 +29,7 @@ Wikipedia says
|
||||
|
||||
> Create a "virtual [object database](https://en.wikipedia.org/wiki/Object_database)" that can be used from within the programming language.
|
||||
|
||||
**Programmatic Example**
|
||||
## Programmatic Example of Metadata Mapping Pattern in Java
|
||||
|
||||
Hibernate ORM Tool uses Metadata Mapping Pattern to specify the mapping between classes and tables either using XML or annotations in code.
|
||||
|
||||
@@ -225,16 +227,16 @@ Console output:
|
||||
14:44:18.551 [main] INFO o.hibernate.orm.connections.pooling - HHH10001008: Cleaning up connection pool [jdbc:h2:mem:metamapping]
|
||||
```
|
||||
|
||||
## Applicability
|
||||
## When to Use the Metadata Mapping Pattern in Java
|
||||
|
||||
Use this pattern when you need to bridge the gap between an object-oriented domain model and a relational database, without hard-coding database queries into the domain logic.
|
||||
Use the Metadata Mapping Design Pattern when you need to bridge the gap between an object-oriented domain model and a relational database in Java applications, without hard-coding database queries into the domain logic.
|
||||
|
||||
## Known Uses
|
||||
## Real-World Applications of Metadata Mapping Pattern in Java
|
||||
|
||||
* Object-Relational Mapping (ORM) frameworks like Hibernate, JPA, EclipseLink and MyBatis.
|
||||
* Object-Relational Mapping (ORM) frameworks like Hibernate, JPA, EclipseLink, and MyBatis frequently utilize the Metadata Mapping Design Pattern to map Java objects to database tables.
|
||||
* Mapping database rows to domain objects in enterprise applications.
|
||||
|
||||
## Consequences
|
||||
## Benefits and Trade-offs of Metadata Mapping Pattern
|
||||
|
||||
Benefits:
|
||||
|
||||
@@ -247,13 +249,13 @@ Trade-offs:
|
||||
* Adds complexity due to an additional layer of abstraction.
|
||||
* Can impact performance if not properly optimized.
|
||||
|
||||
## Related Patterns
|
||||
## Related Java Design Patterns
|
||||
|
||||
* [Data Mapper](https://java-design-patterns.com/patterns/data-mapper/): Metadata Mapping is often used within the broader Data Mapper pattern to facilitate the mapping process.
|
||||
* Active Record: Differently from Active Record, Metadata Mapping separates the data access logic from the domain entities.
|
||||
* [Repository](https://java-design-patterns.com/patterns/repository/): Works well with the Repository pattern by abstracting data access further, allowing more complex domain logic to be cleanly separated from data mapping.
|
||||
|
||||
## Credits
|
||||
## References and Credits
|
||||
|
||||
* [J2EE Design Patterns](https://amzn.to/4dpzgmx)
|
||||
* [Java Persistence with Hibernate](https://amzn.to/44tP1ox)
|
||||
|
||||
Reference in New Issue
Block a user