From 89f7d82b4a726cd5cb60b04a5a76e5d631b9f5ac Mon Sep 17 00:00:00 2001
From: Jeremy Landis
Date: Tue, 2 Aug 2022 22:41:34 -0400
Subject: [PATCH 01/11] [jakarta] Move over all imports to jakarta from javax
---
src/main/java/org/mybatis/cdi/CDIUtils.java | 16 +++++------
.../cdi/JtaTransactionInterceptor.java | 20 ++++++-------
.../cdi/LocalTransactionInterceptor.java | 20 ++++++-------
src/main/java/org/mybatis/cdi/Mapper.java | 2 +-
.../java/org/mybatis/cdi/MyBatisBean.java | 12 ++++----
.../org/mybatis/cdi/MybatisExtension.java | 28 +++++++++----------
.../mybatis/cdi/SerializableMapperProxy.java | 4 +--
.../mybatis/cdi/SessionFactoryProvider.java | 2 +-
.../cdi/SqlSessionManagerRegistry.java | 12 ++++----
.../java/org/mybatis/cdi/Transactional.java | 6 ++--
src/site/xdoc/getting-started.xml.vm | 4 +--
src/site/zh/xdoc/getting-started.xml.vm | 4 +--
src/test/java/org/mybatis/cdi/FooService.java | 8 +++---
.../java/org/mybatis/cdi/FooServiceJTA.java | 4 +--
.../org/mybatis/cdi/FooServiceJTATest.java | 6 ++--
.../java/org/mybatis/cdi/FooServiceTest.java | 4 +--
src/test/java/org/mybatis/cdi/JtaManager.java | 2 +-
.../org/mybatis/cdi/ManagerProducers.java | 10 +++----
.../org/mybatis/cdi/ManagerProducersJta.java | 6 ++--
.../org/mybatis/cdi/MySpecialManager.java | 2 +-
.../org/mybatis/cdi/MybatisExtensionTest.java | 18 ++++++------
.../java/org/mybatis/cdi/OtherQualifier.java | 2 +-
.../mybatis/cdi/SerializableFooService.java | 4 +--
.../mybatis/cdi/UserTransactionProvider.java | 6 ++--
24 files changed, 101 insertions(+), 101 deletions(-)
diff --git a/src/main/java/org/mybatis/cdi/CDIUtils.java b/src/main/java/org/mybatis/cdi/CDIUtils.java
index 499ee34b..defe7e48 100644
--- a/src/main/java/org/mybatis/cdi/CDIUtils.java
+++ b/src/main/java/org/mybatis/cdi/CDIUtils.java
@@ -19,16 +19,16 @@
import java.util.Iterator;
import java.util.Set;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.Any;
-import javax.enterprise.inject.Default;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.CDI;
-import javax.enterprise.util.AnnotationLiteral;
-
import org.apache.ibatis.session.SqlSessionFactory;
+import jakarta.enterprise.context.spi.CreationalContext;
+import jakarta.enterprise.inject.Any;
+import jakarta.enterprise.inject.Default;
+import jakarta.enterprise.inject.spi.Bean;
+import jakarta.enterprise.inject.spi.BeanManager;
+import jakarta.enterprise.inject.spi.CDI;
+import jakarta.enterprise.util.AnnotationLiteral;
+
/**
* @author Frank D. Martinez [mnesarco]
*/
diff --git a/src/main/java/org/mybatis/cdi/JtaTransactionInterceptor.java b/src/main/java/org/mybatis/cdi/JtaTransactionInterceptor.java
index 2641ecdc..4ae8461b 100644
--- a/src/main/java/org/mybatis/cdi/JtaTransactionInterceptor.java
+++ b/src/main/java/org/mybatis/cdi/JtaTransactionInterceptor.java
@@ -15,16 +15,16 @@
*/
package org.mybatis.cdi;
-import javax.enterprise.inject.Instance;
-import javax.inject.Inject;
-import javax.interceptor.Interceptor;
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-import javax.transaction.UserTransaction;
+import jakarta.enterprise.inject.Instance;
+import jakarta.inject.Inject;
+import jakarta.interceptor.Interceptor;
+import jakarta.transaction.HeuristicMixedException;
+import jakarta.transaction.HeuristicRollbackException;
+import jakarta.transaction.NotSupportedException;
+import jakarta.transaction.RollbackException;
+import jakarta.transaction.Status;
+import jakarta.transaction.SystemException;
+import jakarta.transaction.UserTransaction;
/**
* Interceptor for JTA transactions. MyBatis should be configured to use the {@code MANAGED} transaction manager.
diff --git a/src/main/java/org/mybatis/cdi/LocalTransactionInterceptor.java b/src/main/java/org/mybatis/cdi/LocalTransactionInterceptor.java
index 0e9f4d96..24f5f128 100644
--- a/src/main/java/org/mybatis/cdi/LocalTransactionInterceptor.java
+++ b/src/main/java/org/mybatis/cdi/LocalTransactionInterceptor.java
@@ -19,18 +19,18 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.UndeclaredThrowableException;
-import javax.inject.Inject;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.Interceptor;
-import javax.interceptor.InvocationContext;
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.SystemException;
-
import org.apache.ibatis.session.SqlSessionManager;
+import jakarta.inject.Inject;
+import jakarta.interceptor.AroundInvoke;
+import jakarta.interceptor.Interceptor;
+import jakarta.interceptor.InvocationContext;
+import jakarta.transaction.HeuristicMixedException;
+import jakarta.transaction.HeuristicRollbackException;
+import jakarta.transaction.NotSupportedException;
+import jakarta.transaction.RollbackException;
+import jakarta.transaction.SystemException;
+
/**
* Best-effort interceptor for local transactions. It locates all the instances of {@code SqlSssionManager} and starts
* transactions on all them. It cannot guarantee atomiticy if there is more than one {@code SqlSssionManager}. Use XA
diff --git a/src/main/java/org/mybatis/cdi/Mapper.java b/src/main/java/org/mybatis/cdi/Mapper.java
index b613caa6..213c08b9 100644
--- a/src/main/java/org/mybatis/cdi/Mapper.java
+++ b/src/main/java/org/mybatis/cdi/Mapper.java
@@ -22,7 +22,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
-import javax.enterprise.inject.Stereotype;
+import jakarta.enterprise.inject.Stereotype;
/**
* Marker interface for MyBatis mappers.
diff --git a/src/main/java/org/mybatis/cdi/MyBatisBean.java b/src/main/java/org/mybatis/cdi/MyBatisBean.java
index 3884a568..90943407 100644
--- a/src/main/java/org/mybatis/cdi/MyBatisBean.java
+++ b/src/main/java/org/mybatis/cdi/MyBatisBean.java
@@ -23,17 +23,17 @@
import java.util.HashSet;
import java.util.Set;
-import javax.enterprise.context.Dependent;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.InjectionPoint;
-import javax.enterprise.inject.spi.PassivationCapable;
-
import org.apache.ibatis.executor.ErrorContext;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionManager;
+import jakarta.enterprise.context.Dependent;
+import jakarta.enterprise.context.spi.CreationalContext;
+import jakarta.enterprise.inject.spi.Bean;
+import jakarta.enterprise.inject.spi.InjectionPoint;
+import jakarta.enterprise.inject.spi.PassivationCapable;
+
/**
* Internal CDI metadata for a mapper bean.
*
diff --git a/src/main/java/org/mybatis/cdi/MybatisExtension.java b/src/main/java/org/mybatis/cdi/MybatisExtension.java
index 36033bf2..4e30613e 100644
--- a/src/main/java/org/mybatis/cdi/MybatisExtension.java
+++ b/src/main/java/org/mybatis/cdi/MybatisExtension.java
@@ -23,25 +23,25 @@
import java.util.List;
import java.util.Set;
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.spi.AfterBeanDiscovery;
-import javax.enterprise.inject.spi.AnnotatedMember;
-import javax.enterprise.inject.spi.AnnotatedType;
-import javax.enterprise.inject.spi.Extension;
-import javax.enterprise.inject.spi.InjectionPoint;
-import javax.enterprise.inject.spi.InjectionTarget;
-import javax.enterprise.inject.spi.ProcessAnnotatedType;
-import javax.enterprise.inject.spi.ProcessInjectionTarget;
-import javax.enterprise.inject.spi.ProcessProducer;
-import javax.enterprise.inject.spi.WithAnnotations;
-import javax.inject.Named;
-import javax.inject.Qualifier;
-
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import jakarta.enterprise.event.Observes;
+import jakarta.enterprise.inject.spi.AfterBeanDiscovery;
+import jakarta.enterprise.inject.spi.AnnotatedMember;
+import jakarta.enterprise.inject.spi.AnnotatedType;
+import jakarta.enterprise.inject.spi.Extension;
+import jakarta.enterprise.inject.spi.InjectionPoint;
+import jakarta.enterprise.inject.spi.InjectionTarget;
+import jakarta.enterprise.inject.spi.ProcessAnnotatedType;
+import jakarta.enterprise.inject.spi.ProcessInjectionTarget;
+import jakarta.enterprise.inject.spi.ProcessProducer;
+import jakarta.enterprise.inject.spi.WithAnnotations;
+import jakarta.inject.Named;
+import jakarta.inject.Qualifier;
+
/**
* MyBatis CDI extension.
*
diff --git a/src/main/java/org/mybatis/cdi/SerializableMapperProxy.java b/src/main/java/org/mybatis/cdi/SerializableMapperProxy.java
index 8a45a70f..cedae03b 100644
--- a/src/main/java/org/mybatis/cdi/SerializableMapperProxy.java
+++ b/src/main/java/org/mybatis/cdi/SerializableMapperProxy.java
@@ -23,10 +23,10 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import javax.enterprise.context.spi.CreationalContext;
-
import org.apache.ibatis.session.SqlSessionFactory;
+import jakarta.enterprise.context.spi.CreationalContext;
+
/**
* @author Frank D. Martinez [mnesarco]
*/
diff --git a/src/main/java/org/mybatis/cdi/SessionFactoryProvider.java b/src/main/java/org/mybatis/cdi/SessionFactoryProvider.java
index 6f83565b..4cb99ba7 100644
--- a/src/main/java/org/mybatis/cdi/SessionFactoryProvider.java
+++ b/src/main/java/org/mybatis/cdi/SessionFactoryProvider.java
@@ -22,7 +22,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
-import javax.enterprise.inject.Stereotype;
+import jakarta.enterprise.inject.Stereotype;
/**
* Qualifies an SqlSessionFactory provider method as usable by mybatis-cdi.
diff --git a/src/main/java/org/mybatis/cdi/SqlSessionManagerRegistry.java b/src/main/java/org/mybatis/cdi/SqlSessionManagerRegistry.java
index 8783b557..14114b83 100644
--- a/src/main/java/org/mybatis/cdi/SqlSessionManagerRegistry.java
+++ b/src/main/java/org/mybatis/cdi/SqlSessionManagerRegistry.java
@@ -20,15 +20,15 @@
import java.util.HashMap;
import java.util.Map;
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.Any;
-import javax.enterprise.inject.Instance;
-import javax.inject.Inject;
-
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionManager;
+import jakarta.annotation.PostConstruct;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.inject.Any;
+import jakarta.enterprise.inject.Instance;
+import jakarta.inject.Inject;
+
/**
* @author Frank D. Martinez [mnesarco]
*/
diff --git a/src/main/java/org/mybatis/cdi/Transactional.java b/src/main/java/org/mybatis/cdi/Transactional.java
index 4dc7460a..fa640a38 100644
--- a/src/main/java/org/mybatis/cdi/Transactional.java
+++ b/src/main/java/org/mybatis/cdi/Transactional.java
@@ -20,11 +20,11 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import javax.enterprise.util.Nonbinding;
-import javax.interceptor.InterceptorBinding;
-
import org.apache.ibatis.session.ExecutorType;
+import jakarta.enterprise.util.Nonbinding;
+import jakarta.interceptor.InterceptorBinding;
+
/**
* Adds transaction demarcation to the annotated method.
*
diff --git a/src/site/xdoc/getting-started.xml.vm b/src/site/xdoc/getting-started.xml.vm
index bf10f69b..1190566e 100644
--- a/src/site/xdoc/getting-started.xml.vm
+++ b/src/site/xdoc/getting-started.xml.vm
@@ -63,7 +63,7 @@