quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.87k stars 2.71k forks source link

Hibernate ORM should use new optional config groups #5608

Open dmlloyd opened 5 years ago

dmlloyd commented 5 years ago

Description After #5387 is merged, we gain support for optional config groups. Optional config groups, as explained in the docs, allow a config group as a whole to be considered optional, which also implies that the required properties in the group are only required when any other property within the group or its nested children are specified.

This should fit the Hibernate ORM configuration well. Presently the Hibernate ORM configuration uses many individually-Optional properties with a query method typically named isAnyPropertySet, coupled with manual validation of combinations of properties. This extra validation step is ripe to be omitted, with a resultant savings in code complexity. Instead, it can simply query for the presence of the various configuration groups to determine if any of the corresponding properties have been set.

/cc @Sanne

gwenneg commented 5 years ago

I'll take care of this one.

machi1990 commented 5 years ago

Great @gwenneg. This will need fixes in the doc generation part too. I have opened up https://github.com/quarkusio/quarkus/pull/5719 to take care of that.

Sanne commented 5 years ago

Many thanks @gwenneg - I can use the help but take care to not take too much on your plate, that JDK11 update task is more urgent than this one :)

gwenneg commented 5 years ago

@Sanne I had the same priorities in mind, I won't treat this issue before I'm done with GraalVM 19.3.0.

gwenneg commented 4 years ago

I made the changes tonight but then I got local tests failures related to missing converters for the optional config groups: IllegalArgumentException: No Converter registered for class class my.optional.config.Group. It's a bit late here so I'll investigate this tomorrow :)