judo-runtime:entity-mapping

Map entity types to transfer objects within the JUDO DAO Core framework.

Updated May 5, 2022
One-click install
npx skills add https://github.com/BlackBeltTechnology/judo-runtime-core --skill judo-runtime-entity-mapping
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: judo-runtime:entity-mapping
Source: https://github.com/BlackBeltTechnology/judo-runtime-core/tree/main/judo-runtime-core-dao-core/src/main/resources/claude/plugins/judo-dao-core/skills/entity-mapping
Command: npx skills add https://github.com/BlackBeltTechnology/judo-runtime-core --skill judo-runtime-entity-mapping

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the process of mapping data between internal entity representations and external transfer objects, ensuring data consistency and simplifying integration.

Core Features & Use Cases

  • Attribute Mapping: Handles the conversion and mapping of individual data attributes between different object types.
  • Reference Mapping: Manages relationships and links between entities and their referenced objects.
  • Measure Unit Conversion: Automatically converts values when units differ between source and target objects.
  • Use Case: When receiving data from an external API (transfer objects) and needing to store it in your database (entities), this Skill ensures that fields like 'distance_km' are correctly mapped and converted to 'distance_m' for your internal system.

Quick Start

Use the judo-runtime:entity-mapping skill to map the 'Customer' transfer object to the 'CustomerEntity'.

Frequently Asked Questions about judo-runtime:entity-mapping

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I map entities to transfer objects in a DAO framework?

Mapping entities to transfer objects is handled by resolving attributes and references, applying measure unit conversions, and setting default values within the JUDO DAO Core framework. This ensures data consistency when moving between internal entities and external transfer objects.

How does measure unit conversion work during data mapping?

Measure unit conversion during data mapping automatically transforms values when source and target units differ. For example, it converts a distance attribute from kilometers in a transfer object to meters for an internal entity representation.

How are embedded versus referenced entities distinguished during data transfer?

Embedded versus referenced entities are distinguished based on payload identifiers during data transfer. This mechanism determines whether an entity should be processed as an embedded attribute or resolved as a separate referenced object.

Can I apply default values when mapping data between entities and transfer objects?

Default values can be applied during entity and transfer object mapping. The mapping mechanism includes default value application to ensure that target objects are fully populated even when source data lacks certain attributes.

What is the best way to handle reference mapping between transfer objects and entities?

Reference mapping is managed by resolving links between entities and their referenced objects. The skill leverages AsmUtils for metamodel operations to accurately process these relationships during data conversion.