From b47fc2e2b87d4070f70f3c55c4f97e3eae5492b3 Mon Sep 17 00:00:00 2001 From: Zen Huifer Date: Wed, 29 Nov 2023 09:36:08 +0800 Subject: [PATCH] write a line into test.file --- ...saac6068a-8e57-11ee-b769-acde48001122.java | 37 ++++++++++++++ ...saaf3c26e-8e57-11ee-b769-acde48001122.java | 33 ++++++++++++ ...sab23d774-8e57-11ee-b769-acde48001122.java | 20 ++++++++ ...sab54b088-8e57-11ee-b769-acde48001122.java | 51 +++++++++++++++++++ 4 files changed, 141 insertions(+) create mode 100644 docs/spring/csaac6068a-8e57-11ee-b769-acde48001122.java create mode 100644 docs/spring/csaaf3c26e-8e57-11ee-b769-acde48001122.java create mode 100644 docs/spring/csab23d774-8e57-11ee-b769-acde48001122.java create mode 100644 docs/spring/csab54b088-8e57-11ee-b769-acde48001122.java diff --git a/docs/spring/csaac6068a-8e57-11ee-b769-acde48001122.java b/docs/spring/csaac6068a-8e57-11ee-b769-acde48001122.java new file mode 100644 index 00000000..860966fc --- /dev/null +++ b/docs/spring/csaac6068a-8e57-11ee-b769-acde48001122.java @@ -0,0 +1,37 @@ +/** + * Copyright 2009-2019 the original author or authors. + *

+ * 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 org.apache.ibatis.binding; + +import org.apache.ibatis.annotations.*; +import org.apache.ibatis.domain.blog.Blog; + +import java.util.List; + +public interface MapperWithOneAndMany { + + @Select({ + "SELECT *", + "FROM blog" + }) + @Results({ + @Result( + property = "author", column = "author_id", + one = @One(select = "org.apache.ibatis.binding.BoundAuthorMapper.selectAuthor"), + many = @Many(select = "selectPostsById")) + }) + List selectWithBothOneAndMany(); + +} diff --git a/docs/spring/csaaf3c26e-8e57-11ee-b769-acde48001122.java b/docs/spring/csaaf3c26e-8e57-11ee-b769-acde48001122.java new file mode 100644 index 00000000..ac85f650 --- /dev/null +++ b/docs/spring/csaaf3c26e-8e57-11ee-b769-acde48001122.java @@ -0,0 +1,33 @@ +/** + * Copyright 2009-2018 the original author or authors. + *

+ * 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 org.apache.ibatis.domain.misc; + +import org.apache.ibatis.domain.blog.Author; +import org.apache.ibatis.reflection.MetaObject; +import org.apache.ibatis.reflection.wrapper.ObjectWrapper; +import org.apache.ibatis.reflection.wrapper.ObjectWrapperFactory; + +public class CustomBeanWrapperFactory implements ObjectWrapperFactory { + @Override + public boolean hasWrapperFor(Object object) { + return object instanceof Author; + } + + @Override + public ObjectWrapper getWrapperFor(MetaObject metaObject, Object object) { + return new CustomBeanWrapper(metaObject, object); + } +} diff --git a/docs/spring/csab23d774-8e57-11ee-b769-acde48001122.java b/docs/spring/csab23d774-8e57-11ee-b769-acde48001122.java new file mode 100644 index 00000000..fc1b9906 --- /dev/null +++ b/docs/spring/csab23d774-8e57-11ee-b769-acde48001122.java @@ -0,0 +1,20 @@ +package com.huifer.mvc.config; + +import com.huifer.mvc.adapter.MyHandlerInterceptorAdapter; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class WebConfig implements WebMvcConfigurer { + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(myHandlerInterceptorAdapter()).addPathPatterns("/**"); + } + + @Bean + MyHandlerInterceptorAdapter myHandlerInterceptorAdapter() { + return new MyHandlerInterceptorAdapter(); + } +} diff --git a/docs/spring/csab54b088-8e57-11ee-b769-acde48001122.java b/docs/spring/csab54b088-8e57-11ee-b769-acde48001122.java new file mode 100644 index 00000000..23763a90 --- /dev/null +++ b/docs/spring/csab54b088-8e57-11ee-b769-acde48001122.java @@ -0,0 +1,51 @@ +/** + * Copyright 2009-2019 the original author or authors. + *

+ * 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 org.apache.ibatis.submitted.xml_references; + +public class Person { + private Long id; + private String firstName; + private String lastName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public enum Type { + EMPLOYEE, + DIRECTOR + } +}