micronaut-projects / micronaut-projects/micronaut-data

GraalVM Native image metadata for JPA Metamodel implementation

Open
#2,155 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: question
Dominant language
Java
Stars
482
Forks
229
Avg merge
1d 7h
Merged PRs (30d)
32

Description

Issue description

io.micronaut.data.runtime.criteria.metamodel.StaticMetamodelInitializer class is using reflection to set values for metamodel attributes, for example

ReflectionUtils.setField(field, field.getDeclaringClass(), new RuntimePersistentPropertySingularAttribute<>(persistentEntity, prop));

which fails when executed in a native image.

Can native image metadata be automatically created when JPA Metamodel implementation is used?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with io.micronaut.data.runtime.criteria.metamodel.StaticMetamodelInitializer and the ReflectionUtils.setField call shown in the issue. Trace how native-image metadata is configured for this JPA Metamodel implementation; done means the reflective attribute initialization works when running as a native image.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.