Skip to content

Commit

Permalink
Only allow activating XML_MAPPING_ENABLED if Hibernate Envers is present
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed Dec 2, 2020
1 parent 8560764 commit 66b8bd6
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,18 @@ private MergedSettings mergeSettings(PersistenceUnitDescriptor persistenceUnit)
}
cfg.put(WRAP_RESULT_SETS, "false");

if (readBooleanConfigurationValue(cfg, XML_MAPPING_ENABLED)) {
LOG.warn("XML mapping is not supported. Setting " + XML_MAPPING_ENABLED + " to false.");
//Hibernate Envers requires XML_MAPPING_ENABLED to be activated, but we don't want to enable this for any other use:
if (isEnversPresent) {
if (readBooleanConfigurationValue(cfg, XML_MAPPING_ENABLED)) {
LOG.warn(
"XML mapping is not supported. It will be partially activated to allow compatibility with Hibernate Envers, but this support is temporary");
}
} else {
if (readBooleanConfigurationValue(cfg, XML_MAPPING_ENABLED)) {
LOG.warn("XML mapping is not supported. Setting " + XML_MAPPING_ENABLED + " to false.");
}
cfg.put(XML_MAPPING_ENABLED, "false");
}
cfg.put(XML_MAPPING_ENABLED, "false");

// Note: this one is not a boolean, just having the property enables it
if (cfg.containsKey(JACC_ENABLED)) {
Expand Down

0 comments on commit 66b8bd6

Please sign in to comment.