This repository is a prototype for exploring and utilizing the Jakarta Data StaticMetamodel annotation. The goal is to generate a model for Jakarta NoSQL and Jakarta Persistence entities using two different approaches: one at build time using a Java Annotation Processor and the other at runtime using reflection and CDI extension.
In this approach, a Java Annotation Processor is used to generate a final and immutable model at build time. The processor generates AttributeInfo implementations using a Mustache template as immutable classes.
The second approach involves using reflection and CDI extension to generate the model at runtime. It scans a StaticMetamodel class and sets the instances matching the field names.
The project is structured into three main folders:
The build-time folder contains the project engine for generating classes at build time. It uses a Mustache template to generate immutable AttributeInfo implementations. This approach ensures compile-time safety and efficiency.
The runtime folder contains the engine that operates in reflection with CDI. It scans a StaticMetamodel class and sets instances matching the field names. This approach allows for runtime generation and flexibility.