From 1eb91bfef72d991e35f4f1c2211e5e59ea3e2c78 Mon Sep 17 00:00:00 2001 From: Suomm <1474983351@qq.com> Date: Fri, 23 Jun 2023 16:02:15 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=96=B0=20APT=20=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=99=A8=E6=B5=8B=E8=AF=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/{Test.java => TestEntity.java} | 2 +- .../main/resources/mybatis-flex.properties | 4 ++- .../test/mapper/AccountMapper.java | 27 +++++++++++++++++++ .../main/resources/mybatis-flex.properties | 7 ++--- .../com/mybatisflex/test/AccountTest.java | 20 ++++++++++++-- 5 files changed, 53 insertions(+), 7 deletions(-) rename mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/entity/{Test.java => TestEntity.java} (96%) create mode 100644 mybatis-flex-test/mybatis-flex-spring-test/src/main/java/com/mybatisflex/test/mapper/AccountMapper.java diff --git a/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/entity/Test.java b/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/entity/TestEntity.java similarity index 96% rename from mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/entity/Test.java rename to mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/entity/TestEntity.java index 966961c1..95f5a8ec 100644 --- a/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/entity/Test.java +++ b/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/entity/TestEntity.java @@ -23,5 +23,5 @@ import com.mybatisflex.annotation.Table; * @since 2023-06-16 */ @Table("test") -public class Test { +public class TestEntity { } \ No newline at end of file diff --git a/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/resources/mybatis-flex.properties b/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/resources/mybatis-flex.properties index a226f192..7263da34 100644 --- a/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/resources/mybatis-flex.properties +++ b/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/resources/mybatis-flex.properties @@ -1,3 +1,5 @@ -processor.mappersGenerateEnable = true +processor.mappersGenerateEnable=true +processor.entity.ignoreSuffixes=Entity +#processor.allInTables=true #processor.baseMapperClass=com.test.mapper.ExBaseMapper diff --git a/mybatis-flex-test/mybatis-flex-spring-test/src/main/java/com/mybatisflex/test/mapper/AccountMapper.java b/mybatis-flex-test/mybatis-flex-spring-test/src/main/java/com/mybatisflex/test/mapper/AccountMapper.java new file mode 100644 index 00000000..6764840e --- /dev/null +++ b/mybatis-flex-test/mybatis-flex-spring-test/src/main/java/com/mybatisflex/test/mapper/AccountMapper.java @@ -0,0 +1,27 @@ +/* + * 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 + *
+ * 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.mybatisflex.test.mapper;
+
+import com.mybatisflex.core.BaseMapper;
+import com.mybatisflex.test.model.Account;
+
+/**
+ * @author 王帅
+ * @since 2023-06-23
+ */
+public interface AccountMapper extends BaseMapper
+ * 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.mybatisflex.test;
import com.mybatisflex.core.query.QueryWrapper;
@@ -14,7 +30,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.List;
-import static com.mybatisflex.test.model.table.AccountTableDef.accountDef;
+import static com.mybatisflex.test.model.table.Tables.account_def;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = AppConfig.class)
@@ -33,7 +49,7 @@ public class AccountTest implements WithAssertions {
@Test
public void testSelectByQuery() {
QueryWrapper queryWrapper = QueryWrapper.create()
- .where(accountDef.age.eq(18));
+ .where(account_def.age.eq(18));
List