Hibernate ORM guide examples / quickstart are more complex than they should be #45715
Labels
area/hibernate-orm
Hibernate ORM
area/housekeeping
Issue type for generalized tasks not related to bugs or enhancements
good first issue
Good for newcomers
Description
Creating this issue to collect a few pre-existing problems I noticed while reviewing https://github.com/quarkusio/quarkus-quickstarts/pull/1493/files ; fixing them will conflict with that PR, so it'll have to wait a bit.
Most of these comments apply to all Hibernate ORM quickstarts, with the possible exception of the Panache ones.
Fruit
entities use complex configuration for their ID, with custom allocation size, initial value, etc. This should be used instead, it's enough for a simple quickstart:ALTER SEQUENCE known_fruits_id_seq RESTART WITH 4;
(with proper prefixing ofknown_fruits_id_seq
with a schema name if relevant). See for example how it's done here: https://github.com/quarkusio/quarkus-quickstarts/blob/1cce4732bad55733c9208296d2a3e18ae0abf906/hibernate-orm-quickstart/src/main/resources/import.sqlapplication.properties
files are way too complex:native-image-xmx
,jdbc.max-size
/jdbc.min-size
.db-kind
should not be configured explicitly, since it's inferred automatically from the classpath when there's only one JDBC driver.quarkus.datasource.jdbc.url
,quarkus.datasource.username
, andquarkus.datasource.jdbc.password
should at least be prefixed with%prod.
(to limit them to production mode), and IMO should be at the end of the file, and should be accompanied with an override of thequarkus.hibernate-orm.database.generation
tocreate
for convenience. Something like what we have in the Hibernate Search docs/quickstart: https://quarkus.io/guides/hibernate-search-orm-elasticsearch#configuring-the-application (without thedb-kind
...)IMPORTANT: If you fix this in quickstarts, don't forget to update the docs to stay consistent, since the docs have copy-pasted examples taken from quickstarts. See https://github.com/quarkusio/quarkus/blob/df602e0adea2e46006aeab636c3d5b25d2eb44ee/docs/src/main/asciidoc/hibernate-orm.adoc
Implementation ideas
No response
The text was updated successfully, but these errors were encountered: