HHH-11253 Make Byte Buddy BytecodeProvider impl the default

This commit is contained in:
Sanne Grinovero 2018-02-27 16:59:41 +00:00
parent a77c4081f7
commit 0f5c3a0abc
8 changed files with 13 additions and 9 deletions

View File

@ -387,8 +387,8 @@ Enable lazy loading feature in runtime bytecode enhancement. This way, even basi
`*hibernate.enhancer.enableAssociationManagement*` (e.g. `true` or `false` (default value))::
Enable association management feature in runtime bytecode enhancement which automatically synchronizes a bidirectional association when only one side is changed.
`*hibernate.bytecode.provider*` (e.g. `javassist` (default value))::
The https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/bytecode/spi/BytecodeProvider.html[`BytecodeProvider`] built-in implementation flavor. Currently, only `javassist` is supported.
`*hibernate.bytecode.provider*` (e.g. `bytebuddy` (default value))::
The https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/bytecode/spi/BytecodeProvider.html[`BytecodeProvider`] built-in implementation flavor. Currently, only `bytebuddy` and `javassist` are valid values.
`*hibernate.bytecode.use_reflection_optimizer*` (e.g. `true` or `false` (default value))::
Should we use reflection optimization? The reflection optimizer implements the https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/bytecode/spi/ReflectionOptimizer.html[`ReflectionOptimizer`] interface and improves entity instantiation and property getter/setter calls.

View File

@ -37,9 +37,10 @@ dependencies {
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compile( libraries.jpa )
compile( libraries.javassist )
// provided until 6.0 when we make it the default and drop Javassist support
provided( libraries.byteBuddy )
// Not wanting a transitive dependency on javassist anymore as it's not the default anymore:
provided( libraries.javassist )
// Could be made optional?
compile( libraries.byteBuddy )
compile( libraries.antlr )
compile( libraries.jta )
compile( libraries.jandex )

View File

@ -1123,6 +1123,9 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings {
String CHECK_NULLABILITY = "hibernate.check_nullability";
/**
* Pick which bytecode enhancing library to use. Currently supports javassist and bytebuddy, bytebuddy being the default since version 5.3.
*/
String BYTECODE_PROVIDER = "hibernate.bytecode.provider";
String JPAQL_STRICT_COMPLIANCE= "hibernate.query.jpaql_strict_compliance";

View File

@ -317,7 +317,7 @@ public final class Environment implements AvailableSettings {
public static final String BYTECODE_PROVIDER_NAME_JAVASSIST = "javassist";
public static final String BYTECODE_PROVIDER_NAME_BYTEBUDDY = "bytebuddy";
public static final String BYTECODE_PROVIDER_NAME_DEFAULT = BYTECODE_PROVIDER_NAME_JAVASSIST;
public static final String BYTECODE_PROVIDER_NAME_DEFAULT = BYTECODE_PROVIDER_NAME_BYTEBUDDY;
public static BytecodeProvider buildBytecodeProvider(Properties properties) {
String provider = ConfigurationHelper.getString( BYTECODE_PROVIDER, properties, BYTECODE_PROVIDER_NAME_DEFAULT );

View File

@ -8,7 +8,6 @@ dependencies {
compile( libraries.dom4j )
compile( libraries.commons_annotations )
compile( libraries.jpa )
compile( libraries.javassist )
compile( libraries.byteBuddy )
compile( libraries.jta )
}

View File

@ -12,6 +12,8 @@ description = 'Hibernate\'s entity version (audit/history) support'
dependencies {
compile( project( ':hibernate-core' ) )
//Ideally javassist should be only an optional dependency but it's currently required by Envers: see HHH-12327
compile( libraries.javassist )
provided( [group: 'org.hibernate', name: 'hibernate-tools', version: '3.2.0.ga'] )
provided( libraries.ant )
@ -19,7 +21,6 @@ dependencies {
testCompile( project( ':hibernate-testing' ) )
testCompile( project( path: ':hibernate-core', configuration: 'tests' ) )
testRuntime( libraries.javassist )
testRuntime( libraries.byteBuddy )
}

View File

@ -33,7 +33,6 @@ dependencies {
testRuntime( libraries.expression_language )
testRuntime('jaxen:jaxen:1.1')
testRuntime(libraries.javassist)
testRuntime(libraries.byteBuddy)
}

View File

@ -16,6 +16,7 @@ dependencies {
compile( libraries.byteman )
compile( libraries.byteman_install )
compile( libraries.byteman_bmunit )
compile( libraries.javassist )
compile( libraries.xapool )
compile( libraries.log4j )
compile ( libraries.jboss_jta ) {