Skip to content

Commit

Permalink
write a line into test.file
Browse files Browse the repository at this point in the history
  • Loading branch information
huifer committed Nov 29, 2023
1 parent db26a08 commit b47fc2e
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docs/spring/csaac6068a-8e57-11ee-b769-acde48001122.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Copyright 2009-2019 the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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<Blog> selectWithBothOneAndMany();

}
33 changes: 33 additions & 0 deletions docs/spring/csaaf3c26e-8e57-11ee-b769-acde48001122.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright 2009-2018 the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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);
}
}
20 changes: 20 additions & 0 deletions docs/spring/csab23d774-8e57-11ee-b769-acde48001122.java
Original file line number Diff line number Diff line change
@@ -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();
}
}
51 changes: 51 additions & 0 deletions docs/spring/csab54b088-8e57-11ee-b769-acde48001122.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Copyright 2009-2019 the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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
}
}

0 comments on commit b47fc2e

Please sign in to comment.