Quick background information for context: I'm writing a relatively small tool for a small gaming community to download and manage user generated content. It's a modular Java 24 + JavaFX Project done with Maven and IntelliJ.
I store data on a SQLite DB. So far I've used bare-metal JDBC and wrote queries myself. As the tool grows, I would like to simplify DB access. At work we use Hibernate ORM in a Jakarta EE environment with Jakarta Contexts and Dependency Injection (CDI) etc., but I've read you can use Hibernate without relying on dependency injection.
So I've tried Hibernate for my tool and it does work well in my dev environment. Problems arise when trying to package a build via jlink, specifically using the javafx-maven-plugin to make things a lot easier for me.
The downside is that Hibernate does not seem to be modularized. Meaning I cannot easily package it with jlink. Running mvn javafx:jlink reports the "automatic module cannot be used with jlink".
I've then tried EclipseLink as an alternative Jakarta Persistence (JPA) implementation, had no issues with automatic modules but other resources apparently not being properly packaged with jlink. Specifically some locale resources appeared to be missing when trying to launch the packaged app, so they got left out the final package.
The last resort would be trying some SQL-first libraries like jOOQ to at least make it more bearable than plain JDBC. But I'd really prefer a Jakarta Persistence/ORM approach to keep database handling as easy and painless as possible.
Does anyone have a working approach I can use for my case? Or share your setup that actually works for you? Or find a way to get any Jakarta Persistence implementation to work well with the module system and Maven/JLink? The reason I'm using these is that packaging really is as simple as invoking a single Maven goal and for the most part that worked really well. Especially because of that I'm hesitant to get into any other packaging method, like the other jlink Maven plugin or something like jpackage, which seem to be very tedious to configure and get working.
include-locales.module-infodescriptor). But you're right about jpackage; that tool can work with non-modular code.--runtime-imagefor a preexisting runtime image or via arguments like--module-path,--add-modules, and--jlink-optionsfor a runtime image it generates in the same invocation.