+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.mybatisflex.core.handler;
+
+import com.mybatisflex.core.util.StringUtil;
+import org.apache.ibatis.type.BaseTypeHandler;
+import org.apache.ibatis.type.JdbcType;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+public abstract class BaseJsonTypeHandler extends BaseTypeHandler {
+
+ @Override
+ public void setNonNullParameter(PreparedStatement ps, int i, T parameter, JdbcType jdbcType) throws SQLException {
+ ps.setString(i, toJson(parameter));
+ }
+
+ @Override
+ public T getNullableResult(ResultSet rs, String columnName) throws SQLException {
+ final String json = rs.getString(columnName);
+ return StringUtil.isBlank(json) ? null : parseJson(json);
+ }
+
+ @Override
+ public T getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
+ final String json = rs.getString(columnIndex);
+ return StringUtil.isBlank(json) ? null : parseJson(json);
+ }
+
+ @Override
+ public T getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
+ final String json = cs.getString(columnIndex);
+ return StringUtil.isBlank(json) ? null : parseJson(json);
+ }
+
+ protected abstract T parseJson(String json);
+
+ protected abstract String toJson(T object);
+}
\ No newline at end of file
diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/handler/Fastjson2TypeHandler.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/handler/Fastjson2TypeHandler.java
new file mode 100644
index 00000000..7800899a
--- /dev/null
+++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/handler/Fastjson2TypeHandler.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2022-2023, Mybatis-Flex (fuhai999@gmail.com).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.mybatisflex.core.handler;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONWriter;
+import org.apache.ibatis.type.JdbcType;
+import org.apache.ibatis.type.MappedJdbcTypes;
+import org.apache.ibatis.type.MappedTypes;
+
+@MappedTypes({Object.class})
+@MappedJdbcTypes(JdbcType.VARCHAR)
+public class Fastjson2TypeHandler extends BaseJsonTypeHandler