-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
595 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.type; | ||
|
||
import java.sql.CallableStatement; | ||
import java.sql.PreparedStatement; | ||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.time.OffsetDateTime; | ||
|
||
/** | ||
* @since 3.4.5 | ||
* @author Tomas Rohovsky | ||
*/ | ||
public class OffsetDateTimeTypeHandler extends BaseTypeHandler<OffsetDateTime> { | ||
|
||
@Override | ||
public void setNonNullParameter(PreparedStatement ps, int i, OffsetDateTime parameter, JdbcType jdbcType) | ||
throws SQLException { | ||
ps.setObject(i, parameter); | ||
} | ||
|
||
@Override | ||
public OffsetDateTime getNullableResult(ResultSet rs, String columnName) throws SQLException { | ||
return rs.getObject(columnName, OffsetDateTime.class); | ||
} | ||
|
||
@Override | ||
public OffsetDateTime getNullableResult(ResultSet rs, int columnIndex) throws SQLException { | ||
return rs.getObject(columnIndex, OffsetDateTime.class); | ||
} | ||
|
||
@Override | ||
public OffsetDateTime getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { | ||
return cs.getObject(columnIndex, OffsetDateTime.class); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* 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.submitted.duplicate_statements; | ||
|
||
import org.apache.ibatis.session.RowBounds; | ||
|
||
import java.util.List; | ||
|
||
public interface Mapper { | ||
|
||
List<User> getAllUsers(); | ||
|
||
List<User> getAllUsers(RowBounds rowBounds); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Copyright 2009-2015 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.typehandler; | ||
|
||
public class User { | ||
|
||
private Integer id; | ||
private String name; | ||
private String city; | ||
private String state; | ||
|
||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getCity() { | ||
return city; | ||
} | ||
|
||
public void setCity(String city) { | ||
this.city = city; | ||
} | ||
|
||
public String getState() { | ||
return state; | ||
} | ||
|
||
public void setState(String state) { | ||
this.state = state; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* Copyright 2009-2016 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.keygen; | ||
|
||
/** | ||
* @author liuzh | ||
*/ | ||
public class Country { | ||
private Integer id; | ||
private String countryname; | ||
private String countrycode; | ||
|
||
public Country() { | ||
} | ||
|
||
public Country(String countryname, String countrycode) { | ||
this.countryname = countryname; | ||
this.countrycode = countrycode; | ||
} | ||
|
||
public Country(Integer id, String countryname, String countrycode) { | ||
this.id = id; | ||
this.countryname = countryname; | ||
this.countrycode = countrycode; | ||
} | ||
|
||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public String getCountryname() { | ||
return countryname; | ||
} | ||
|
||
public void setCountryname(String countryname) { | ||
this.countryname = countryname; | ||
} | ||
|
||
public String getCountrycode() { | ||
return countrycode; | ||
} | ||
|
||
public void setCountrycode(String countrycode) { | ||
this.countrycode = countrycode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.huifer.aop.advisor; | ||
|
||
import org.springframework.aop.ClassFilter; | ||
|
||
/** | ||
* 描述: | ||
* 类过滤器 | ||
* | ||
* @author huifer | ||
* @date 2019-03-03 | ||
*/ | ||
public class MyClassFilter implements ClassFilter { | ||
/*** | ||
* 判断当前实现类是否是我们的织入所相关的类 | ||
* 本次案例中 男性上厕所不需要带纸巾,女性上厕所需要带纸巾, | ||
* 那么BaseAopPointCut接口应该要对女性进行判断,完成此步骤后还需要一个方法匹配器 , | ||
* 再次我们只要对上厕所匹配 吃饭不需要匹配 | ||
* | ||
* @param aClass 当前被拦截的类 | ||
* @return boolean | ||
*/ | ||
@Override | ||
public boolean matches(Class<?> aClass) { | ||
if (aClass == WoMan.class) { | ||
|
||
return true; | ||
} | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.huifer.hystrix; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.netflix.hystrix.EnableHystrix; | ||
import org.springframework.context.annotation.EnableAspectJAutoProxy; | ||
|
||
/** | ||
* <p>Title : HystrixApp </p> | ||
* <p>Description : </p> | ||
* | ||
* @author huifer | ||
* @date 2019-05-30 | ||
*/ | ||
@SpringBootApplication | ||
@EnableHystrix | ||
@EnableAspectJAutoProxy(proxyTargetClass = true) | ||
public class HystrixApp { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(HystrixApp.class, args); | ||
} | ||
|
||
} |
Oops, something went wrong.