瀏覽代碼

测试自定义 mapper 接口父类

jobob 8 年之前
父節點
當前提交
b34b04f9f7

+ 32 - 0
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/mysql/mapper/MyBaseMapper.java

@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2011-2014, hubin (jobob@qq.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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.baomidou.mybatisplus.test.mysql.mapper;
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 自定义 Mapper 接口
+ * </p>
+ *
+ * @author hubin
+ * @date 2017-03-14
+ */
+public interface MyBaseMapper<T> extends BaseMapper<T> {
+
+	// 测试自定义 Mapper 接口
+
+}

+ 4 - 4
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/mysql/mapper/UserMapper.java

@@ -15,13 +15,13 @@
  */
 package com.baomidou.mybatisplus.test.mysql.mapper;
 
-import com.baomidou.mybatisplus.mapper.BaseMapper;
-import com.baomidou.mybatisplus.test.mysql.entity.User;
+import java.util.List;
+
 import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.session.RowBounds;
 
-import java.util.List;
+import com.baomidou.mybatisplus.test.mysql.entity.User;
 
 /**
  * <p>
@@ -31,7 +31,7 @@ import java.util.List;
  * @author hubin
  * @Date 2016-01-23
  */
-public interface UserMapper extends BaseMapper<User> {
+public interface UserMapper extends MyBaseMapper<User> {
 
 	/**
 	 * 用户列表,分页显示