From 11b16237744d07c7f6310325daff82b432673742 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Fri, 7 Feb 2020 13:41:22 +0000 Subject: [PATCH] HHH-13804 Update comments in Environment to suggest the ability to inject an externally defined ProxyFactoryFactory instance --- .../src/main/java/org/hibernate/cfg/Environment.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java b/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java index 30d97d5bcb..824f556d1f 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java @@ -351,8 +351,15 @@ public final class Environment implements AvailableSettings { LOG.bytecodeProvider( providerName ); - // todo : allow a custom class name - just check if the config is a FQN - // currently we assume it is only ever the Strings "javassist" or "bytebuddy"... + // there is no need to support plugging in a custom BytecodeProvider via FQCN: + // - the static helper methods on this class are deprecated + // - it's possible to plug a custom BytecodeProvider directly into the ServiceRegistry + // + // This also allows integrators to inject a BytecodeProvider instance which has some + // state; particularly useful to inject proxy definitions which have been prepared in + // advance. + // See also https://hibernate.atlassian.net/browse/HHH-13804 and how this was solved in + // Quarkus. LOG.unknownBytecodeProvider( providerName, BYTECODE_PROVIDER_NAME_DEFAULT ); return new org.hibernate.bytecode.internal.bytebuddy.BytecodeProviderImpl();