Support Hibernate 3.3
RENAME
dd-java-agent/instrumentation/hibernate/core-3.5/core-3.5.gradle
dd-java-agent/instrumentation/hibernate/core-3.3/core-3.3.gradle
@@ -16,7 +16,7 @@ muzzle {
pass {
group = "org.hibernate"
module = "hibernate-core"
- versions = "[3.3.2.GA,4.0.0.Final)"
+ versions = "[3.3.0.GA,4.0.0.Final)"
assertInverse = true
}
}
@@ -32,7 +32,7 @@ testSets {
}
dependencies {
- compileOnly group: 'org.hibernate', name: 'hibernate-core', version: '3.3.2.GA'
+ compileOnly group: 'org.hibernate', name: 'hibernate-core', version: '3.3.0.GA'
compile project(':dd-java-agent:agent-tooling')
compile project(':dd-java-agent:instrumentation:hibernate')
@@ -45,7 +45,7 @@ dependencies {
testCompile project(':dd-java-agent:testing')
testCompile project(':dd-java-agent:instrumentation:jdbc')
- testCompile group: 'org.hibernate', name: 'hibernate-core', version: '3.3.2.GA'
+ testCompile group: 'org.hibernate', name: 'hibernate-core', version: '3.3.0.GA'
testCompile group: 'org.hibernate', name: 'hibernate-annotations', version: '+'
testCompile group: 'javassist', name: 'javassist', version: '+'
testCompile group: 'com.h2database', name: 'h2', version: '1.4.197'

RENAME
dd-java-agent/instrumentation/hibernate/core-3.5/src/main/java/datadog/trace/instrumentation/hibernate/core/v3_5/AbstractHibernateInstrumentation.java
dd-java-agent/instrumentation/hibernate/core-3.3/src/main/java/datadog/trace/instrumentation/hibernate/core/v3_3/AbstractHibernateInstrumentation.java
-package datadog.trace.instrumentation.hibernate.core.v3_5;
+package datadog.trace.instrumentation.hibernate.core.v3_3;
import datadog.trace.agent.tooling.Instrumenter;
-import org.hibernate.EntityNameResolver;
import org.hibernate.classic.Validatable;
+import org.hibernate.transaction.JBossTransactionManagerLookup;
public abstract class AbstractHibernateInstrumentation extends Instrumenter.Default {
@@ -28,15 +28,15 @@ public abstract class AbstractHibernateInstrumentation extends Instrumenter.Defa
/**
* Some cases of instrumentation will match more broadly than others, so this unused method
- * allows all instrumentation to uniformly match versions of Hibernate between 3.5 and 4.
+ * allows all instrumentation to uniformly match versions of Hibernate between 3.3 and 4.
*/
public static void muzzleCheck(
// Not in 4.0
final Validatable validatable,
- // Not before 3.2.0.GA (Can't find anything not before 3.5)
- final EntityNameResolver resolver) {
+ // Not before 3.3.0.GA
+ final JBossTransactionManagerLookup lookup) {
validatable.validate();
- resolver.resolveEntityName(null);
+ lookup.getUserTransactionName();
}
}
}

RENAME
dd-java-agent/instrumentation/hibernate/core-3.5/src/main/java/datadog/trace/instrumentation/hibernate/core/v3_5/CriteriaInstrumentation.java
dd-java-agent/instrumentation/hibernate/core-3.3/src/main/java/datadog/trace/instrumentation/hibernate/core/v3_3/CriteriaInstrumentation.java
-package datadog.trace.instrumentation.hibernate.core.v3_5;
+package datadog.trace.instrumentation.hibernate.core.v3_3;
import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
import static java.util.Collections.singletonMap;

RENAME
dd-java-agent/instrumentation/hibernate/core-3.5/src/main/java/datadog/trace/instrumentation/hibernate/core/v3_5/QueryInstrumentation.java
dd-java-agent/instrumentation/hibernate/core-3.3/src/main/java/datadog/trace/instrumentation/hibernate/core/v3_3/QueryInstrumentation.java
-package datadog.trace.instrumentation.hibernate.core.v3_5;
+package datadog.trace.instrumentation.hibernate.core.v3_3;
import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
import static datadog.trace.instrumentation.hibernate.HibernateDecorator.DECORATOR;

RENAME
dd-java-agent/instrumentation/hibernate/core-3.5/src/main/java/datadog/trace/instrumentation/hibernate/core/v3_5/SessionFactoryInstrumentation.java
dd-java-agent/instrumentation/hibernate/core-3.3/src/main/java/datadog/trace/instrumentation/hibernate/core/v3_3/SessionFactoryInstrumentation.java
-package datadog.trace.instrumentation.hibernate.core.v3_5;
+package datadog.trace.instrumentation.hibernate.core.v3_3;
import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
import static datadog.trace.instrumentation.hibernate.HibernateDecorator.DECORATOR;

RENAME
dd-java-agent/instrumentation/hibernate/core-3.5/src/main/java/datadog/trace/instrumentation/hibernate/core/v3_5/SessionInstrumentation.java
dd-java-agent/instrumentation/hibernate/core-3.3/src/main/java/datadog/trace/instrumentation/hibernate/core/v3_3/SessionInstrumentation.java
-package datadog.trace.instrumentation.hibernate.core.v3_5;
+package datadog.trace.instrumentation.hibernate.core.v3_3;
import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
import static datadog.trace.instrumentation.hibernate.HibernateDecorator.DECORATOR;

RENAME
dd-java-agent/instrumentation/hibernate/core-3.5/src/main/java/datadog/trace/instrumentation/hibernate/core/v3_5/TransactionInstrumentation.java
dd-java-agent/instrumentation/hibernate/core-3.3/src/main/java/datadog/trace/instrumentation/hibernate/core/v3_3/TransactionInstrumentation.java
-package datadog.trace.instrumentation.hibernate.core.v3_5;
+package datadog.trace.instrumentation.hibernate.core.v3_3;
import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
import static java.util.Collections.singletonMap;

RENAME
dd-java-agent/instrumentation/hibernate/core-3.5/src/test/groovy/AbstractHibernateTest.groovy
dd-java-agent/instrumentation/hibernate/core-3.3/src/test/groovy/AbstractHibernateTest.groovy
RENAME
dd-java-agent/instrumentation/hibernate/core-3.5/src/test/groovy/CriteriaTest.groovy
dd-java-agent/instrumentation/hibernate/core-3.3/src/test/groovy/CriteriaTest.groovy
RENAME
dd-java-agent/instrumentation/hibernate/core-3.5/src/test/groovy/QueryTest.groovy
dd-java-agent/instrumentation/hibernate/core-3.3/src/test/groovy/QueryTest.groovy
RENAME
dd-java-agent/instrumentation/hibernate/core-3.5/src/test/groovy/SessionTest.groovy
dd-java-agent/instrumentation/hibernate/core-3.3/src/test/groovy/SessionTest.groovy
RENAME
dd-java-agent/instrumentation/hibernate/core-3.5/src/test/java/Value.java
dd-java-agent/instrumentation/hibernate/core-3.3/src/test/java/Value.java
RENAME
dd-java-agent/instrumentation/hibernate/core-3.5/src/test/resources/hibernate.cfg.xml
dd-java-agent/instrumentation/hibernate/core-3.3/src/test/resources/hibernate.cfg.xml
MODIFY
settings.gradle
settings.gradle
@@ -41,7 +41,7 @@ include ':dd-java-agent:instrumentation:elasticsearch:transport-5.3'
include ':dd-java-agent:instrumentation:elasticsearch:transport-6'
include ':dd-java-agent:instrumentation:grpc-1.5'
include ':dd-java-agent:instrumentation:hibernate'
-include ':dd-java-agent:instrumentation:hibernate:core-3.5'
+include ':dd-java-agent:instrumentation:hibernate:core-3.3'
include ':dd-java-agent:instrumentation:hibernate:core-4.0'
include ':dd-java-agent:instrumentation:hibernate:core-4.3'
include ':dd-java-agent:instrumentation:http-url-connection'

Support Hibernate 3.3