Skip to content

[0%] Phase 5: CritterMapper implementation #4187

@evanchooly

Description

@evanchooly

Parent: #4179
Blocked by: #4186

Goal

Implement the hybrid discovery mapper with three-tier fallback: pre-generated → runtime generation → reflection.

Details

See Phase 5 in planning doc

Tasks

  • Create CritterMapper extends AbstractMapper
  • Implement fail-fast dependency check in constructor
  • Implement tryLoadPregenerated() — load by naming convention from app classloader
  • Implement tryRuntimeGeneration() — Gizmo + VarHandle via CritterClassLoader
  • Implement fallbackToReflection() — standard EntityModel creation
  • Implement per-entity-type error logging (once per type, not per access)
  • Implement copy() — share immutable CritterEntityModel refs, new DiscriminatorLookup
  • Thread safety: check-then-register pattern, synchronized classloader ops
  • Tests: pre-generated loading, runtime generation, reflection fallback, concurrent access, copy semantics

Progress Tracking

phase_percentage = (completed_tasks / 9) * 100, rounded to nearest integer
gh issue edit 4187 --repo MorphiaOrg/morphia --title "[XX%] Phase 5: CritterMapper implementation"

parent_percentage = (total_completed_tasks_across_all_phases / 55) * 100, rounded to nearest integer
gh issue edit 4179 --repo MorphiaOrg/morphia --title "[XX%] Integrate critter-core into morphia-core"

When all tasks are complete (100%), close this issue and check its box in #4179.

Metadata

Metadata

Assignees

No one assigned

    Labels

    critterCritter bytecode generation integrationenhancement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions