From a2ea48979572013101885e22921fd911846f3a0a Mon Sep 17 00:00:00 2001 From: Suomm <1474983351@qq.com> Date: Mon, 3 Jul 2023 21:06:02 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B5=8B=E8=AF=95=20APT=20=E7=94=9F?= =?UTF-8?q?=E6=88=90=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mybatisflex/test/Account.java | 17 +++++++++++ .../java/com/mybatisflex/test/Account2.java | 30 +++++++++++++++++++ .../java/com/mybatisflex/test/AccountVV.java | 27 ++++++++++++++++- 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account2.java diff --git a/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account.java b/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account.java index 09432546..c47fef27 100644 --- a/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account.java +++ b/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account.java @@ -1,3 +1,19 @@ +/* + * 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; import com.mybatisflex.annotation.*; @@ -17,6 +33,7 @@ public class Account extends BaseEntity implements Serializable, AgeAware { private static final long serialVersionUID = 1L; @Id(keyType = KeyType.Auto) + @ColumnAlias("account_id") private Long id; @ColumnMask(Masks.CHINESE_NAME) diff --git a/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account2.java b/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account2.java new file mode 100644 index 00000000..32da3644 --- /dev/null +++ b/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account2.java @@ -0,0 +1,30 @@ +/* + * 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; + +import com.mybatisflex.annotation.Table; + +import java.io.Serializable; + +@Table(value = "tb_account_2") +public class Account2 extends AccountVV implements Serializable { + + private static final long serialVersionUID = 1L; + + private int age; + +} \ No newline at end of file diff --git a/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/AccountVV.java b/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/AccountVV.java index 607f62d6..0dd453fe 100644 --- a/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/AccountVV.java +++ b/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/AccountVV.java @@ -1,6 +1,25 @@ +/* + * 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; -import com.mybatisflex.annotation.*; +import com.mybatisflex.annotation.ColumnAlias; +import com.mybatisflex.annotation.Id; +import com.mybatisflex.annotation.KeyType; +import com.mybatisflex.annotation.Table; import java.io.Serializable; @@ -16,4 +35,10 @@ public class AccountVV extends Account implements Serializable { private int age; private int ageVV; + + @Override + @ColumnAlias("account_v_v_id") + public Long getId() { + return id; + } } \ No newline at end of file